Merge pull request #7476 from Bigpet/confsave

Just save the current config every time the config file is switched
This commit is contained in:
Henrik Rydgård 2015-02-14 23:04:35 +01:00
commit 77693633d7
6 changed files with 2 additions and 5 deletions

View File

@ -1104,6 +1104,7 @@ bool Config::hasGameConfig(const std::string &pGameId)
void Config::changeGameSpecific(const std::string &pGameId)
{
Save();
gameId_ = pGameId;
bGameSpecific = !pGameId.empty();
}

View File

@ -230,7 +230,6 @@ void CPU_Init() {
if (coreParameter.updateRecent) {
g_Config.AddRecent(filename);
g_Config.Save();
}
coreState = coreParameter.startPaused ? CORE_STEPPING : CORE_RUNNING;

View File

@ -59,7 +59,6 @@ bool GameInfo::DeleteGame() {
auto i = std::find(g_Config.recentIsos.begin(), g_Config.recentIsos.end(), fileToRemove);
if (i != g_Config.recentIsos.end()) {
g_Config.recentIsos.erase(i);
g_Config.Save();
}
return true;
}

View File

@ -301,7 +301,6 @@ UI::EventReturn GameScreen::OnRemoveFromRecent(UI::EventParams &e) {
if (!strcmp((*it).c_str(), gamePath_.c_str())) {
#endif
g_Config.recentIsos.erase(it);
g_Config.Save();
screenManager()->switchScreen(new MainScreen());
return UI::EVENT_DONE;
}

View File

@ -76,7 +76,6 @@ void GameSettingsScreen::CreateViews() {
if (bEditThenRestore)
{
g_Config.changeGameSpecific(gameID_);
g_Config.loadGameConfig(gameID_);
}

View File

@ -395,8 +395,8 @@ void GamePauseScreen::CallbackDeleteConfig(bool yes)
{
if (yes) {
GameInfo *info = g_gameInfoCache.GetInfo(NULL, gamePath_, 0);
g_Config.deleteGameConfig(info->id);
g_Config.unloadGameConfig();
g_Config.deleteGameConfig(info->id);
screenManager()->RecreateAllViews();
}
}