File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -297,14 +297,22 @@ int main( int argc, char * argv[] )
297
297
// set admin config file to wms server object
298
298
QString configFilePath ( defaultConfigFilePath );
299
299
300
- paramIt = parameterMap. find ( " MAP " );
301
- if ( paramIt == parameterMap. constEnd () )
300
+ QString projectFile = getenv ( " QGIS_PROJECT_FILE " );
301
+ if ( !projectFile. isEmpty () )
302
302
{
303
- QgsDebugMsg ( QString ( " Using default configuration file path: %1 " ). arg ( defaultConfigFilePath ) ) ;
303
+ configFilePath = projectFile ;
304
304
}
305
305
else
306
306
{
307
- configFilePath = paramIt.value ();
307
+ paramIt = parameterMap.find ( " MAP" );
308
+ if ( paramIt == parameterMap.constEnd () )
309
+ {
310
+ QgsDebugMsg ( QString ( " Using default configuration file path: %1" ).arg ( defaultConfigFilePath ) );
311
+ }
312
+ else
313
+ {
314
+ configFilePath = paramIt.value ();
315
+ }
308
316
}
309
317
310
318
QgsConfigParser* adminConfigParser = QgsConfigCache::instance ()->searchConfiguration ( configFilePath );
You can’t perform that action at this time.
0 commit comments