Skip to content

Commit

Permalink
[pcsx2]: use a local implementation of GetUserLocalDataDir. Follow th…
Browse files Browse the repository at this point in the history
…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 committed Jun 28, 2010
1 parent 1c7fc3e commit 0a012ae
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
25 changes: 25 additions & 0 deletions pcsx2/gui/AppConfig.cpp
Expand Up @@ -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 )
Expand Down
1 change: 1 addition & 0 deletions pcsx2/gui/AppConfig.h
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions pcsx2/gui/AppInit.cpp
Expand Up @@ -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() ) );
Expand Down Expand Up @@ -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() );
Expand Down
3 changes: 2 additions & 1 deletion plugins/zzogl-pg/opengl/CMakeLists.txt
Expand Up @@ -103,7 +103,8 @@ set(zzoglHeaders
x86.h
zerogs.h
zerogsmath.h
zpipe.h)
zpipe.h
ZZoglCRTC.h)

# zzogl S sources
set(zzoglSSources
Expand Down

0 comments on commit 0a012ae

Please sign in to comment.