diff --git a/Core/Config.cpp b/Core/Config.cpp index fbb22d8228..74be99d75e 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1577,12 +1577,8 @@ void Config::CleanRecent() { recentIsos = cleanedRecent; } -void Config::SetDefaultPath(const Path &defaultPath) { - defaultPath_ = defaultPath; -} - -void Config::AddSearchPath(const Path &path) { - searchPath_.push_back(path); +void Config::SetSearchPath(const Path &searchPath) { + searchPath_ = searchPath; } const Path Config::FindConfigFile(const std::string &baseFilename) { @@ -1596,21 +1592,16 @@ const Path Config::FindConfigFile(const std::string &baseFilename) { } #endif - for (size_t i = 0; i < searchPath_.size(); ++i) { - Path filename = searchPath_[i] / baseFilename; - if (File::Exists(filename)) { - return filename; - } + Path filename = searchPath_ / baseFilename; + if (File::Exists(filename)) { + return filename; } - const Path filename = defaultPath_ / baseFilename; - if (!File::Exists(filename)) { - // Make sure at least the directory it's supposed to be in exists. - Path path = filename.NavigateUp(); - // This check is just to avoid logging. - if (!File::Exists(path)) { - File::CreateFullPath(path); - } + // Make sure at least the directory it's supposed to be in exists. + Path path = filename.NavigateUp(); + // This check is just to avoid logging. + if (!File::Exists(path)) { + File::CreateFullPath(path); } return filename; } diff --git a/Core/Config.h b/Core/Config.h index 49211f29db..79323eefca 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -505,10 +505,7 @@ public: Path getGameConfigFile(const std::string &gameId); bool hasGameConfig(const std::string &game_id); - // Used when the file is not found in the search path. Trailing slash. - void SetDefaultPath(const Path &defaultPath); - // Use a trailing slash. - void AddSearchPath(const Path &path); + void SetSearchPath(const Path &path); const Path FindConfigFile(const std::string &baseFilename); // Utility functions for "recent" management @@ -536,8 +533,7 @@ private: std::string gameIdTitle_; Path iniFilename_; Path controllerIniFilename_; - std::vector searchPath_; - Path defaultPath_; + Path searchPath_; }; std::map> GetLangValuesMapping(); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 065482d4a2..e1edded499 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -539,14 +539,13 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch LogManager::Init(&g_Config.bEnableLogging); #if !PPSSPP_PLATFORM(WINDOWS) - g_Config.AddSearchPath(Path(user_data_path)); - g_Config.AddSearchPath(GetSysDirectory(DIRECTORY_SYSTEM)); - g_Config.SetDefaultPath(GetSysDirectory(DIRECTORY_SYSTEM)); + g_Config.SetSearchPath(GetSysDirectory(DIRECTORY_SYSTEM)); // Note that if we don't have storage permission here, loading the config will // fail and it will be set to the default. Later, we load again when we get permission. g_Config.Load(); #endif + LogManager *logman = LogManager::GetInstance(); #if PPSSPP_PLATFORM(ANDROID) diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index a4a8852192..29afda806e 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -103,8 +103,7 @@ PPSSPP_UWPMain::PPSSPP_UWPMain(App ^app, const std::shared_ptr