From ae478aad41d95e28dd261a26b2a5311664a32fed Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 23 Jan 2016 23:41:04 -0800 Subject: [PATCH] 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; }