Skip to content

Commit 689cbad

Browse files
committedFeb 24, 2016
[bugfix][server] Fixes #13291
1 parent 1af724f commit 689cbad

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed
 

‎src/server/qgsserver.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
// Default values are for C++, SIP bindings will override their
6060
// options in in init()
6161

62-
QString QgsServer::sConfigFilePath = QString();
62+
QString* QgsServer::sConfigFilePath = nullptr;
6363
QgsCapabilitiesCache* QgsServer::sCapabilitiesCache = nullptr;
6464
QgsMapRenderer* QgsServer::sMapRenderer = nullptr;
6565
#ifdef HAVE_SERVER_PYTHON_PLUGINS
@@ -403,10 +403,9 @@ bool QgsServer::init( int & argc, char ** argv )
403403
defaultConfigFilePath = adminSLDFileInfo.absoluteFilePath();
404404
}
405405
}
406-
if ( !defaultConfigFilePath.isEmpty() )
407-
{
408-
sConfigFilePath = defaultConfigFilePath;
409-
}
406+
// Store the config file path
407+
sConfigFilePath = new QString( defaultConfigFilePath );
408+
410409

411410
//create cache for capabilities XML
412411
sCapabilitiesCache = new QgsCapabilitiesCache();
@@ -514,7 +513,7 @@ QPair<QByteArray, QByteArray> QgsServer::handleRequest( const QString& queryStri
514513
printRequestParameters( parameterMap, logLevel );
515514
QMap<QString, QString>::const_iterator paramIt;
516515
//Config file path
517-
QString configFilePath = configPath( sConfigFilePath, parameterMap );
516+
QString configFilePath = configPath( *sConfigFilePath, parameterMap );
518517
#ifdef HAVE_SERVER_PYTHON_PLUGINS
519518
sServerInterface->setConfigFilePath( configFilePath );
520519
#endif

‎src/server/qgsserver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class SERVER_EXPORT QgsServer
115115
static QString &serverName();
116116

117117
// Status
118-
static QString sConfigFilePath;
118+
static QString* sConfigFilePath;
119119
static QgsCapabilitiesCache* sCapabilitiesCache;
120120
static QgsMapRenderer* sMapRenderer;
121121
#ifdef HAVE_SERVER_PYTHON_PLUGINS

0 commit comments

Comments
 (0)
Please sign in to comment.