Even less file I/O in menu screens, by caching "hasConfig" flag for game info. See #7807

This commit is contained in:
Henrik Rydgard 2015-09-10 17:17:26 +02:00
parent dc4fb4ca76
commit 05c625ed06
5 changed files with 12 additions and 3 deletions

View file

@ -408,6 +408,7 @@ void GamePauseScreen::CallbackDeleteConfig(bool yes)
GameInfo *info = g_gameInfoCache.GetInfo(NULL, gamePath_, 0);
g_Config.unloadGameConfig();
g_Config.deleteGameConfig(info->id);
info->hasConfig = false;
screenManager()->RecreateAllViews();
}
}
@ -418,6 +419,10 @@ UI::EventReturn GamePauseScreen::OnCreateConfig(UI::EventParams &e)
g_Config.createGameConfig(gameId);
g_Config.changeGameSpecific(gameId);
g_Config.saveGameConfig(gameId);
GameInfo *info = g_gameInfoCache.GetInfo(NULL, gamePath_, 0);
if (info) {
info->hasConfig = true;
}
screenManager()->topScreen()->RecreateViews();
return UI::EVENT_DONE;