mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Savestate browser: delete the screenshot and name file along with the state
Deleting a savestate from the savedata screen goes through GameInfo::Delete, not SaveState::DeleteSlot, and it only knew about the .jpg - so the slot's .name.txt was left behind with nothing to belong to. Rather than teach the UI the naming scheme a third time, SaveState now answers what sits beside a state. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
1 parent
55f53d4523
commit
6600d1c05f
3 files changed
+26
-3
No files matched your search
@@ -170,9 +170,11 @@ bool GameInfo::Delete() {
|
||||
const Path &ppstPath = filePath_;
|
||||
INFO_LOG(Log::System, "Deleting file %s", ppstPath.c_str());
|
||||
MoveFileToTrashOrDelete(ppstPath);
|
||||
Path screenshotPath;
|
||||
if (filePath_.WithReplacedExtension(".ppst", ".jpg", &screenshotPath) && File::Exists(screenshotPath)) {
|
||||
MoveFileToTrashOrDelete(screenshotPath);
|
||||
// The screenshot and the slot's custom name are no use without the state itself.
|
||||
for (const Path &companion : SaveState::GetCompanionFilePaths(ppstPath)) {
|
||||
if (File::Exists(companion)) {
|
||||
MoveFileToTrashOrDelete(companion);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user