From 0a012aec255a1d5a41f071bba45ff5e25d032521 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Mon, 28 Jun 2010 19:46:54 +0000 Subject: [PATCH] [pcsx2]: use a local implementation of GetUserLocalDataDir. Follow the xdg specification for linux. IMPORTANT NOTE FOR LINUX USER: the "main" pcsx2 configuration is moved from $HOME/.pcsx2 to $XDG_CONFIG_HOME/pcsx2 (or $HOME/.config/pcsx2 if xdg var is not defined). A first time wizard is expected. Just import you previous settings. [cmake]: add a missing h file. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3336 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/AppConfig.cpp | 25 +++++++++++++++++++++++++ pcsx2/gui/AppConfig.h | 1 + pcsx2/gui/AppInit.cpp | 4 ++-- plugins/zzogl-pg/opengl/CMakeLists.txt | 3 ++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 0bbedcd412..ff2f35824d 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -94,6 +94,31 @@ namespace PathDefs return retval; } + // Specifies the main configuration folder. + wxDirName GetUserLocalDataDir() + { +#ifdef __LINUX__ + // Note: GetUserLocalDataDir() on linux return $HOME/.pcsx2 unfortunately it does not follow the XDG standard + // So we re-implement it, to follow the standard. + wxDirName user_local_dir; + wxString xdg_home_value; + if( wxGetEnv(L"XDG_CONFIG_HOME", &xdg_home_value) ) { + if ( xdg_home_value.IsEmpty() ) { + // variable exist but it is empty. So use the default value + user_local_dir = (wxDirName)Path::Combine( wxStandardPaths::Get().GetUserConfigDir() , wxDirName( L".config/pcsx2" )); + } else { + user_local_dir = (wxDirName)Path::Combine( xdg_home_value, pxGetAppName()); + } + } else { + // variable do not exist + user_local_dir = (wxDirName)Path::Combine( wxStandardPaths::Get().GetUserConfigDir() , wxDirName( L".config/pcsx2" )); + } + return user_local_dir; +#else + return wxDirName(wxStandardPaths::Get().GetUserLocalDataDir()); +#endif + } + // Fetches the path location for user-consumable documents -- stuff users are likely to want to // share with other programs: screenshots, memory cards, and savestates. wxDirName GetDocuments( DocsModeType mode ) diff --git a/pcsx2/gui/AppConfig.h b/pcsx2/gui/AppConfig.h index 388ab625cc..13b9acbfee 100644 --- a/pcsx2/gui/AppConfig.h +++ b/pcsx2/gui/AppConfig.h @@ -36,6 +36,7 @@ namespace PathDefs // complete pathnames are returned by these functions // For 99% of all code, you should use these. + extern wxDirName GetUserLocalDataDir(); extern wxDirName GetDocuments(); extern wxDirName GetDocuments( DocsModeType mode ); extern wxDirName GetThemes(); diff --git a/pcsx2/gui/AppInit.cpp b/pcsx2/gui/AppInit.cpp index 57056a3938..13fa658d5f 100644 --- a/pcsx2/gui/AppInit.cpp +++ b/pcsx2/gui/AppInit.cpp @@ -57,7 +57,7 @@ static void CpuCheckSSE2() void Pcsx2App::WipeUserModeSettings() { - wxDirName usrlocaldir( wxStandardPaths::Get().GetUserLocalDataDir() ); + wxDirName usrlocaldir = PathDefs::GetUserLocalDataDir(); if( !usrlocaldir.Exists() ) return; wxString cwd( Path::Normalize( wxGetCwd() ) ); @@ -86,7 +86,7 @@ void Pcsx2App::WipeUserModeSettings() // void Pcsx2App::ReadUserModeSettings() { - wxDirName usrlocaldir( wxStandardPaths::Get().GetUserLocalDataDir() ); + wxDirName usrlocaldir = PathDefs::GetUserLocalDataDir(); if( !usrlocaldir.Exists() ) { Console.WriteLn( L"Creating UserLocalData folder: " + usrlocaldir.ToString() ); diff --git a/plugins/zzogl-pg/opengl/CMakeLists.txt b/plugins/zzogl-pg/opengl/CMakeLists.txt index 257d8728a6..7f9542250b 100644 --- a/plugins/zzogl-pg/opengl/CMakeLists.txt +++ b/plugins/zzogl-pg/opengl/CMakeLists.txt @@ -103,7 +103,8 @@ set(zzoglHeaders x86.h zerogs.h zerogsmath.h - zpipe.h) + zpipe.h + ZZoglCRTC.h) # zzogl S sources set(zzoglSSources