Skip to content
Permalink
Browse files

Properly deal with empty cache/directory in WFS provider, server and …

…globe plugin

Fixes #15111
  • Loading branch information
rouault committed Oct 6, 2016
1 parent a9850ae commit 41693604674384ddd2b3869378db9b9d645d61a4
Showing with 9 additions and 3 deletions.
  1. +3 −1 src/plugins/globe/globe_plugin.cpp
  2. +3 −1 src/providers/wfs/qgswfsutils.cpp
  3. +3 −1 src/server/qgsserver.cpp
@@ -342,7 +342,9 @@ void GlobePlugin::run()
}
else
{
QString cacheDirectory = settings.value( "cache/directory", QgsApplication::qgisSettingsDirPath() + "cache" ).toString();
QString cacheDirectory = settings.value( "cache/directory" ).toString();
if ( cacheDirectory.isEmpty() )
cacheDirectory = QgsApplication::qgisSettingsDirPath() + "cache";
osgEarth::Drivers::FileSystemCacheOptions cacheOptions;
cacheOptions.rootPath() = cacheDirectory.toStdString();

@@ -37,7 +37,9 @@ int QgsWFSUtils::gmCounter = 0;
QString QgsWFSUtils::getBaseCacheDirectory( bool createIfNotExisting )
{
QSettings settings;
QString cacheDirectory = settings.value( "cache/directory", QgsApplication::qgisSettingsDirPath() + "cache" ).toString();
QString cacheDirectory = settings.value( "cache/directory" ).toString();
if ( cacheDirectory.isEmpty() )
cacheDirectory = QgsApplication::qgisSettingsDirPath() + "cache";
if ( createIfNotExisting )
{
QMutexLocker locker( &gmMutex );
@@ -115,7 +115,9 @@ void QgsServer::setupNetworkAccessManager()
QSettings settings;
QgsNetworkAccessManager *nam = QgsNetworkAccessManager::instance();
QNetworkDiskCache *cache = new QNetworkDiskCache( nullptr );
QString cacheDirectory = settings.value( "cache/directory", QgsApplication::qgisSettingsDirPath() + "cache" ).toString();
QString cacheDirectory = settings.value( "cache/directory" ).toString();
if ( cacheDirectory.isEmpty() )
cacheDirectory = QgsApplication::qgisSettingsDirPath() + "cache";
qint64 cacheSize = settings.value( "cache/size", 50 * 1024 * 1024 ).toULongLong();
QgsMessageLog::logMessage( QString( "setCacheDirectory: %1" ).arg( cacheDirectory ), "Server", QgsMessageLog::INFO );
QgsMessageLog::logMessage( QString( "setMaximumCacheSize: %1" ).arg( cacheSize ), "Server", QgsMessageLog::INFO );

0 comments on commit 4169360

Please sign in to comment.
You can’t perform that action at this time.