Skip to content
Permalink
Browse files
Properly deal with empty cache/directory in server
backport 4169360
  • Loading branch information
rouault authored and rldhont committed Apr 24, 2017
1 parent 7ce99ca commit 466758ff5a1229d834b4e17b989e9db1aba0347b
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/server/qgsserver.cpp
@@ -113,7 +113,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 466758f

Please sign in to comment.