mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Remove the ability to have multiple search paths for config.
This commit is contained in:
parent
72915f88c8
commit
239838b6c3
@ -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;
|
||||
}
|
||||
|
@ -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<Path> searchPath_;
|
||||
Path defaultPath_;
|
||||
Path searchPath_;
|
||||
};
|
||||
|
||||
std::map<std::string, std::pair<std::string, int>> GetLangValuesMapping();
|
||||
|
@ -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)
|
||||
|
@ -103,8 +103,7 @@ PPSSPP_UWPMain::PPSSPP_UWPMain(App ^app, const std::shared_ptr<DX::DeviceResourc
|
||||
|
||||
// Load config up here, because those changes below would be overwritten
|
||||
// if it's not loaded here first.
|
||||
g_Config.AddSearchPath(GetSysDirectory(DIRECTORY_SYSTEM));
|
||||
g_Config.SetDefaultPath(GetSysDirectory(DIRECTORY_SYSTEM));
|
||||
g_Config.SetSearchPath(GetSysDirectory(DIRECTORY_SYSTEM));
|
||||
g_Config.Load();
|
||||
|
||||
bool debugLogLevel = false;
|
||||
|
@ -583,8 +583,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
|
||||
// Load config up here, because those changes below would be overwritten
|
||||
// if it's not loaded here first.
|
||||
g_Config.AddSearchPath(GetSysDirectory(DIRECTORY_SYSTEM));
|
||||
g_Config.SetDefaultPath(GetSysDirectory(DIRECTORY_SYSTEM));
|
||||
g_Config.SetSearchPath(GetSysDirectory(DIRECTORY_SYSTEM));
|
||||
g_Config.Load(configFilename.c_str(), controlsConfigFilename.c_str());
|
||||
|
||||
bool debugLogLevel = false;
|
||||
|
Loading…
Reference in New Issue
Block a user