mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Merge pull request #887 from sbrunner/environ_mapfile
Add QGIS_PROJECT_FILE environement option
This commit is contained in:
commit
b14e13388e
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user