Skip to content
Permalink
Browse files

[pcsx2]: use a local implementation of GetUserLocalDataDir. Follow th…

…e 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
  • Loading branch information...
gregory.hainaut
gregory.hainaut committed Jun 28, 2010
1 parent 1c7fc3e commit 0a012aec255a1d5a41f071bba45ff5e25d032521
Showing with 30 additions and 3 deletions.
  1. +25 −0 pcsx2/gui/AppConfig.cpp
  2. +1 −0 pcsx2/gui/AppConfig.h
  3. +2 −2 pcsx2/gui/AppInit.cpp
  4. +2 −1 plugins/zzogl-pg/opengl/CMakeLists.txt
@@ -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 )
@@ -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();
@@ -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() );
@@ -103,7 +103,8 @@ set(zzoglHeaders
x86.h
zerogs.h
zerogsmath.h
zpipe.h)
zpipe.h
ZZoglCRTC.h)

# zzogl S sources
set(zzoglSSources

0 comments on commit 0a012ae

Please sign in to comment.
You can’t perform that action at this time.