Skip to content

Commit

Permalink
Just save the current config every time the config file is switched
Browse files Browse the repository at this point in the history
also undo hrydgard#7473 because it would now introduce redundant writes.
  • Loading branch information
Bigpet committed Feb 14, 2015
1 parent ad345f9 commit ba96b7b
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@ bool Config::hasGameConfig(const std::string &pGameId)

void Config::changeGameSpecific(const std::string &pGameId)
{
Save();
gameId_ = pGameId;
bGameSpecific = !pGameId.empty();
}
Expand Down
1 change: 0 additions & 1 deletion Core/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ void CPU_Init() {

if (coreParameter.updateRecent) {
g_Config.AddRecent(filename);
g_Config.Save();
}

coreState = coreParameter.startPaused ? CORE_STEPPING : CORE_RUNNING;
Expand Down
1 change: 0 additions & 1 deletion UI/GameInfoCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion UI/GameScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ void GameSettingsScreen::CreateViews() {

if (bEditThenRestore)
{
g_Config.changeGameSpecific(gameID_);
g_Config.loadGameConfig(gameID_);
}

Expand Down
2 changes: 1 addition & 1 deletion UI/PauseScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit ba96b7b

Please sign in to comment.