From ae478aad41d95e28dd261a26b2a5311664a32fed Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 23 Jan 2016 23:41:04 -0800 Subject: [PATCH 1/2] UI: Delete screenshots with savestate files. Fixes #8494. --- UI/GameInfoCache.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 0e98c0cf5c..2656f500df 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -82,18 +82,28 @@ bool GameInfo::Delete() { return true; } case FILETYPE_PSP_ELF: - case FILETYPE_PPSSPP_SAVESTATE: case FILETYPE_UNKNOWN_BIN: case FILETYPE_UNKNOWN_ELF: case FILETYPE_ARCHIVE_RAR: case FILETYPE_ARCHIVE_ZIP: case FILETYPE_ARCHIVE_7Z: { - const char *fileToRemove = filePath_.c_str(); + const std::string &fileToRemove = filePath_; File::Delete(fileToRemove); return true; } + case FILETYPE_PPSSPP_SAVESTATE: + { + const std::string &ppstPath = filePath_; + File::Delete(ppstPath); + const std::string screenshotPath = ReplaceAll(filePath_, ".ppst", ".jpg"); + if (File::Exists(screenshotPath)) { + File::Delete(screenshotPath); + } + return true; + } + default: return false; } From d7f3cf0fca781c4464bc3fc0709f1558df10ff81 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 23 Jan 2016 23:53:31 -0800 Subject: [PATCH 2/2] UI: Refresh pause screen after exiting settings. This will update if any of the savestates were deleted. --- UI/PauseScreen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index b624ab5718..a47aa0ecbc 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -359,6 +359,9 @@ void GamePauseScreen::dialogFinished(const Screen *dialog, DialogResult dr) { SaveState::LoadSlot(gamePath_, slot, SaveState::Callback(), 0); finishNextFrame_ = true; + } else { + // There may have been changes to our savestates, so let's recreate. + RecreateViews(); } }