mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Use XDG Directory Specification for Linux. See: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Means that everyone will have to manually move their existing config's. Fixes #4623
This commit is contained in:
parent
aa37a06999
commit
132fe47c7d
@ -243,7 +243,16 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co
|
||||
isMessagePending = false;
|
||||
|
||||
std::string user_data_path = savegame_directory;
|
||||
#ifdef Q_OS_LINUX
|
||||
char* config = getenv("XDG_CONFIG_HOME");
|
||||
if (!config) {
|
||||
config = getenv("HOME");
|
||||
strcat(config, "/.config");
|
||||
}
|
||||
std::string memcard_path = std::string(config) + "/ppsspp/";
|
||||
#else
|
||||
std::string memcard_path = QDir::homePath().toStdString() + "/.ppsspp/";
|
||||
#endif
|
||||
|
||||
VFSRegister("", new DirectoryAssetReader("assets/"));
|
||||
VFSRegister("", new DirectoryAssetReader(user_data_path.c_str()));
|
||||
@ -251,7 +260,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co
|
||||
|
||||
g_Config.AddSearchPath(user_data_path);
|
||||
g_Config.AddSearchPath(memcard_path + "PSP/SYSTEM/");
|
||||
g_Config.SetDefaultPath(g_Config.memCardDirectory + "PSP/SYSTEM/");
|
||||
g_Config.SetDefaultPath(memcard_path + "PSP/SYSTEM/");
|
||||
g_Config.Load();
|
||||
i18nrepo.LoadIni(g_Config.sLanguageIni);
|
||||
|
||||
@ -305,7 +314,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co
|
||||
g_Config.currentDirectory = QDir::homePath().toStdString();
|
||||
}
|
||||
|
||||
g_Config.memCardDirectory = QDir::homePath().toStdString() + "/.ppsspp/";
|
||||
g_Config.memCardDirectory = memcard_path;
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
std::string program_path = QCoreApplication::applicationDirPath().toStdString();
|
||||
|
@ -249,13 +249,11 @@ void NativeInit(int argc, const char *argv[],
|
||||
// We want this to be FIRST.
|
||||
#ifdef USING_QT_UI
|
||||
VFSRegister("", new AssetsAssetReader());
|
||||
#else
|
||||
#if defined(BLACKBERRY) || defined(IOS)
|
||||
#elif defined(BLACKBERRY) || defined(IOS)
|
||||
// Packed assets are included in app
|
||||
VFSRegister("", new DirectoryAssetReader(external_directory));
|
||||
#else
|
||||
VFSRegister("", new DirectoryAssetReader("assets/"));
|
||||
#endif
|
||||
#endif
|
||||
VFSRegister("", new DirectoryAssetReader(savegame_directory));
|
||||
|
||||
@ -272,7 +270,12 @@ void NativeInit(int argc, const char *argv[],
|
||||
g_Config.memCardDirectory = user_data_path;
|
||||
g_Config.flash0Directory = std::string(external_directory) + "/flash0/";
|
||||
#elif !defined(_WIN32)
|
||||
g_Config.memCardDirectory = std::string(getenv("HOME")) + "/.ppsspp/";
|
||||
char* config = getenv("XDG_CONFIG_HOME");
|
||||
if (!config) {
|
||||
config = getenv("HOME");
|
||||
strcat(config, "/.config");
|
||||
}
|
||||
g_Config.memCardDirectory = std::string(config) + "/ppsspp/";
|
||||
std::string program_path = File::GetExeDirectory();
|
||||
if (program_path.empty())
|
||||
g_Config.flash0Directory = g_Config.memCardDirectory + "/flash0/";
|
||||
|
Loading…
Reference in New Issue
Block a user