@@ -785,35 +785,6 @@ int main( int argc, char *argv[] )
785
785
QCoreApplication::setApplicationName ( QgsApplication::QGIS_APPLICATION_NAME );
786
786
QCoreApplication::setAttribute ( Qt::AA_DontShowIconsInMenus, false );
787
787
788
-
789
- // SetUp the QgsSettings Global Settings:
790
- // - use the path specified with --globalsettingsfile path,
791
- // - use the environment if not found
792
- // - use a default location as a fallback
793
- if ( globalsettingsfile.isEmpty () )
794
- {
795
- globalsettingsfile = getenv ( " QGIS_GLOBAL_SETTINGS_FILE" );
796
- }
797
- if ( globalsettingsfile.isEmpty () )
798
- {
799
- QString default_globalsettingsfile = QgsApplication::pkgDataPath () + " /qgis_global_settings.ini" ;
800
- if ( QFile::exists ( default_globalsettingsfile ) )
801
- {
802
- globalsettingsfile = default_globalsettingsfile;
803
- }
804
- }
805
- if ( !globalsettingsfile.isEmpty () )
806
- {
807
- if ( ! QgsSettings::setGlobalSettingsPath ( globalsettingsfile ) )
808
- {
809
- QgsMessageLog::logMessage ( QString ( " Invalid globalsettingsfile path: %1" ).arg ( globalsettingsfile ), QStringLiteral ( " QGIS" ) );
810
- }
811
- else
812
- {
813
- QgsMessageLog::logMessage ( QString ( " Successfully loaded globalsettingsfile path: %1" ).arg ( globalsettingsfile ), QStringLiteral ( " QGIS" ) );
814
- }
815
- }
816
-
817
788
QgsSettings settings;
818
789
if ( configLocalStorageLocation.isEmpty () )
819
790
{
@@ -848,6 +819,34 @@ int main( int argc, char *argv[] )
848
819
849
820
QgsApplication myApp ( argc, argv, myUseGuiFlag, profileFolder );
850
821
822
+ // SetUp the QgsSettings Global Settings:
823
+ // - use the path specified with --globalsettingsfile path,
824
+ // - use the environment if not found
825
+ // - use a default location as a fallback
826
+ if ( globalsettingsfile.isEmpty () )
827
+ {
828
+ globalsettingsfile = getenv ( " QGIS_GLOBAL_SETTINGS_FILE" );
829
+ }
830
+ if ( globalsettingsfile.isEmpty () )
831
+ {
832
+ QString default_globalsettingsfile = QgsApplication::pkgDataPath () + " /qgis_global_settings.ini" ;
833
+ if ( QFile::exists ( default_globalsettingsfile ) )
834
+ {
835
+ globalsettingsfile = default_globalsettingsfile;
836
+ }
837
+ }
838
+ if ( !globalsettingsfile.isEmpty () )
839
+ {
840
+ if ( ! QgsSettings::setGlobalSettingsPath ( globalsettingsfile ) )
841
+ {
842
+ QgsMessageLog::logMessage ( QString ( " Invalid globalsettingsfile path: %1" ).arg ( globalsettingsfile ), QStringLiteral ( " QGIS" ) );
843
+ }
844
+ else
845
+ {
846
+ QgsMessageLog::logMessage ( QString ( " Successfully loaded globalsettingsfile path: %1" ).arg ( globalsettingsfile ), QStringLiteral ( " QGIS" ) );
847
+ }
848
+ }
849
+
851
850
#ifdef Q_OS_MAC
852
851
// Set hidpi icons; use SVG icons, as PNGs will be relatively too small
853
852
QCoreApplication::setAttribute ( Qt::AA_UseHighDpiPixmaps );
0 commit comments