diff --git a/common/settings/settings_manager.cpp b/common/settings/settings_manager.cpp index 31736dc9d3..2ccf1d485e 100644 --- a/common/settings/settings_manager.cpp +++ b/common/settings/settings_manager.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -603,34 +604,19 @@ wxString SETTINGS_MANAGER::calculateUserSettingsPath( bool aIncludeVer, bool aUs wxFileName cfgpath; // http://docs.wxwidgets.org/3.0/classwx_standard_paths.html#a7c7cf595d94d29147360d031647476b0 - cfgpath.AssignDir( wxStandardPaths::Get().GetUserConfigDir() ); - - // GetUserConfigDir() does not default to ~/.config which is the current standard - // configuration file location on Linux. This has been fixed in later versions of wxWidgets. -#if !defined( __WXMSW__ ) && !defined( __WXMAC__ ) - wxArrayString dirs = cfgpath.GetDirs(); - - if( dirs.Last() != ".config" ) - cfgpath.AppendDir( ".config" ); -#endif wxString envstr; - - // This shouldn't cause any issues on Windows or MacOS. - if( wxGetEnv( wxT( "XDG_CONFIG_HOME" ), &envstr ) && !envstr.IsEmpty() ) - { - // Override the assignment above with XDG_CONFIG_HOME - cfgpath.AssignDir( envstr ); - } - - cfgpath.AppendDir( TO_STR( KICAD_CONFIG_DIR ) ); - - // Use KICAD_CONFIG_HOME to allow the user to force a specific configuration path. if( aUseEnv && wxGetEnv( wxT( "KICAD_CONFIG_HOME" ), &envstr ) && !envstr.IsEmpty() ) { // Override the assignment above with KICAD_CONFIG_HOME cfgpath.AssignDir( envstr ); } + else + { + cfgpath.AssignDir( KIPLATFORM::ENV::GetUserConfigDir() ); + + cfgpath.AppendDir( TO_STR( KICAD_CONFIG_DIR ) ); + } if( aIncludeVer ) cfgpath.AppendDir( GetSettingsVersion() );