When a game is deleted via GameScreen, remove it from the recent ISOs list, if applicable.

This commit is contained in:
The Dax 2013-09-30 15:11:42 -04:00
parent c86c9fe11e
commit e1580bb8ba

View file

@ -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;