From e1580bb8ba972e55acf2f69505082cfc98d47c20 Mon Sep 17 00:00:00 2001 From: The Dax Date: Mon, 30 Sep 2013 15:11:42 -0400 Subject: [PATCH] When a game is deleted via GameScreen, remove it from the recent ISOs list, if applicable. --- UI/GameInfoCache.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index a17ea03f32..b2dd54758d 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -40,10 +40,16 @@ bool GameInfo::DeleteGame() { switch (fileType) { case FILETYPE_PSP_ISO: case FILETYPE_PSP_ISO_NP: - // Just delete the one file (TODO: handle two-disk games as well somehow). - deleteFile(fileInfo.fullName.c_str()); - return true; - + { + // Just delete the one file (TODO: handle two-disk games as well somehow). + const char *fileToRemove = fileInfo.fullName.c_str(); + deleteFile(fileToRemove); + auto i = std::find(g_Config.recentIsos.begin(), g_Config.recentIsos.end(), fileToRemove); + if (i != g_Config.recentIsos.end()) { + g_Config.recentIsos.erase(i); + } + return true; + } case FILETYPE_PSP_PBP_DIRECTORY: // Recursively deleting directories not yet supported return false;