Skip to content

Commit

Permalink
Merge pull request #35956 from alexbruy/global-settings
Browse files Browse the repository at this point in the history
look for qgis_global_settings.ini also in the AppDataLocation (fix #31288)
  • Loading branch information
alexbruy committed Apr 24, 2020
2 parents 46dea07 + 8681826 commit 9183f7b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/main.cpp
Expand Up @@ -896,12 +896,22 @@ int main( int argc, char *argv[] )
// Set up the QgsSettings Global Settings:
// - use the path specified with --globalsettingsfile path,
// - use the environment if not found
// - use the AppDataLocation ($HOME/.local/share/QGIS/QGIS3 on Linux, roaming path on Windows)
// - use a default location as a fallback
if ( globalsettingsfile.isEmpty() )
{
globalsettingsfile = getenv( "QGIS_GLOBAL_SETTINGS_FILE" );
}

if ( globalsettingsfile.isEmpty() )
{
QStringList startupPaths = QStandardPaths::locateAll( QStandardPaths::AppDataLocation, QStringLiteral( "qgis_global_settings.ini" ) );
if ( !startupPaths.isEmpty() )
{
globalsettingsfile = startupPaths.at( 0 );
}
}

if ( globalsettingsfile.isEmpty() )
{
QString default_globalsettingsfile = QgsApplication::resolvePkgPath() + "/resources/qgis_global_settings.ini";
Expand Down

0 comments on commit 9183f7b

Please sign in to comment.