Skip to content
Permalink
Browse files

Add QGIS_PROJECT_FILE environement option

To be able to configure the project file in apache configuration
like:
SetEnv QGIS_PROJECT_FILE  <path to project file>.qgs
  • Loading branch information
Stéphane Brunner
Stéphane Brunner committed Sep 12, 2013
1 parent 02ed712 commit ccda1c46f741c3b578d36329a67c7dedb38f38ca
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 ccda1c4

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