Skip to content
Permalink
Browse files

Merge pull request #887 from sbrunner/environ_mapfile

Add QGIS_PROJECT_FILE environement option
  • Loading branch information
mhugent committed Sep 13, 2013
2 parents e7956a5 + ccda1c4 commit b14e13388e65b77baf469581a0d14d5274bf5dac
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/mapserver/qgis_map_serv.cpp
@@ -297,14 +297,22 @@ int main( int argc, char * argv[] )
//set admin config file to wms server object
QString configFilePath( defaultConfigFilePath );

paramIt = parameterMap.find( "MAP" );
if ( paramIt == parameterMap.constEnd() )
QString projectFile = getenv( "QGIS_PROJECT_FILE" );
if ( !projectFile.isEmpty() )
{
QgsDebugMsg( QString( "Using default configuration file path: %1" ).arg( defaultConfigFilePath ) );
configFilePath = projectFile;
}
else
{
configFilePath = paramIt.value();
paramIt = parameterMap.find( "MAP" );
if ( paramIt == parameterMap.constEnd() )
{
QgsDebugMsg( QString( "Using default configuration file path: %1" ).arg( defaultConfigFilePath ) );
}
else
{
configFilePath = paramIt.value();
}
}

QgsConfigParser* adminConfigParser = QgsConfigCache::instance()->searchConfiguration( configFilePath );

0 comments on commit b14e133

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