From 55eebb5fd2a50f930c939ec85fb7b73026839d77 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Thu, 20 Aug 2015 20:28:47 +0100 Subject: [PATCH] Fix cheats path and folder creation For the install version on Linux, PCSX2 now searches for cheats in $HOME instead of /usr. For the install version on Windows, PCSX2 now searches for cheats in Documents/PCSX2 instead of the cheats directory where PCSX2 is installed. Also make a few small consistency changes. --- pcsx2/gui/AppConfig.cpp | 17 +++++++++++++++-- pcsx2/gui/AppMain.cpp | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 3e057dad15..41bc778c90 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -72,6 +72,18 @@ namespace PathDefs return retval; } + const wxDirName& Bios() + { + static const wxDirName retval(L"bios"); + return retval; + } + + const wxDirName& Cheats() + { + static const wxDirName retval(L"cheats"); + return retval; + } + const wxDirName& CheatsWS() { static const wxDirName retval(L"cheats_ws"); @@ -184,12 +196,12 @@ namespace PathDefs wxDirName GetBios() { - return GetDocuments() + wxDirName( L"bios" ); + return GetDocuments() + Base::Bios();; } wxDirName GetCheats() { - return AppRoot() + wxDirName( L"cheats" ); + return GetDocuments() + Base::Cheats(); } wxDirName GetCheatsWS() @@ -722,6 +734,7 @@ AppConfig::FolderOptions::FolderOptions() , MemoryCards ( PathDefs::GetMemoryCards() ) , Langs ( PathDefs::GetLangs() ) , Logs ( PathDefs::GetLogs() ) + , Cheats ( PathDefs::GetCheats() ) , CheatsWS ( PathDefs::GetCheatsWS() ) , RunIso( PathDefs::GetDocuments() ) // raw default is always the Documents folder. diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index af297b914f..d49b1560aa 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -834,6 +834,7 @@ void AppApplySettings( const AppConfig* oldconf ) g_Conf->Folders.MemoryCards.Mkdir(); g_Conf->Folders.Savestates.Mkdir(); g_Conf->Folders.Snapshots.Mkdir(); + g_Conf->Folders.Cheats.Mkdir(); g_Conf->Folders.CheatsWS.Mkdir(); g_Conf->EmuOptions.BiosFilename = g_Conf->FullpathToBios();