Merge pull request #387 from PCSX2/XDG_HOME_CONFIG-use-PCSX2-issue-381

pcsx2: use PCSX2 uppercase for XDG_HOME_CONFIG default value
This commit is contained in:
Gregory Hainaut 2014-12-09 09:11:10 +01:00
commit 4991f9412d
1 changed files with 3 additions and 2 deletions

View File

@ -370,17 +370,18 @@ public:
// Note: GetUserLocalDataDir() on linux return $HOME/.pcsx2 unfortunately it does not follow the XDG standard // Note: GetUserLocalDataDir() on linux return $HOME/.pcsx2 unfortunately it does not follow the XDG standard
// So we re-implement it, to follow the standard. // So we re-implement it, to follow the standard.
wxDirName user_local_dir; wxDirName user_local_dir;
wxDirName default_config_dir = (wxDirName)Path::Combine( L".config", pxGetAppName() );
wxString xdg_home_value; wxString xdg_home_value;
if( wxGetEnv(L"XDG_CONFIG_HOME", &xdg_home_value) ) { if( wxGetEnv(L"XDG_CONFIG_HOME", &xdg_home_value) ) {
if ( xdg_home_value.IsEmpty() ) { if ( xdg_home_value.IsEmpty() ) {
// variable exist but it is empty. So use the default value // variable exist but it is empty. So use the default value
user_local_dir = (wxDirName)Path::Combine( GetUserConfigDir() , wxDirName( L".config/pcsx2" )); user_local_dir = (wxDirName)Path::Combine( GetUserConfigDir() , default_config_dir);
} else { } else {
user_local_dir = (wxDirName)Path::Combine( xdg_home_value, pxGetAppName()); user_local_dir = (wxDirName)Path::Combine( xdg_home_value, pxGetAppName());
} }
} else { } else {
// variable do not exist // variable do not exist
user_local_dir = (wxDirName)Path::Combine( GetUserConfigDir() , wxDirName( L".config/pcsx2" )); user_local_dir = (wxDirName)Path::Combine( GetUserConfigDir() , default_config_dir);
} }
cache_dir = user_local_dir.ToString(); cache_dir = user_local_dir.ToString();