From c4d634670da51d051246f590d599c2865c42624e Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 24 Jul 2020 22:15:53 +0200 Subject: [PATCH] Fixed an issue where game media files would get deleted when the recents collection was trimmed. --- .../src/views/gamelist/BasicGameListView.cpp | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/es-app/src/views/gamelist/BasicGameListView.cpp b/es-app/src/views/gamelist/BasicGameListView.cpp index fabaff727..bca093bbf 100644 --- a/es-app/src/views/gamelist/BasicGameListView.cpp +++ b/es-app/src/views/gamelist/BasicGameListView.cpp @@ -136,30 +136,31 @@ void BasicGameListView::launch(FileData* game) void BasicGameListView::remove(FileData *game, bool deleteFile) { // Actually delete the file on the filesystem. - if (deleteFile) + if (deleteFile) { Utils::FileSystem::removeFile(game->getPath()); - // Remove all game media files as well. - if (Utils::FileSystem::exists(game->getVideoPath())) - Utils::FileSystem::removeFile(game->getVideoPath()); + // Remove all game media files as well. + if (Utils::FileSystem::exists(game->getVideoPath())) + Utils::FileSystem::removeFile(game->getVideoPath()); - if (Utils::FileSystem::exists(game->getMiximagePath())) - Utils::FileSystem::removeFile(game->getMiximagePath()); + if (Utils::FileSystem::exists(game->getMiximagePath())) + Utils::FileSystem::removeFile(game->getMiximagePath()); - if (Utils::FileSystem::exists(game->getScreenshotPath())) - Utils::FileSystem::removeFile(game->getScreenshotPath()); + if (Utils::FileSystem::exists(game->getScreenshotPath())) + Utils::FileSystem::removeFile(game->getScreenshotPath()); - if (Utils::FileSystem::exists(game->getCoverPath())) - Utils::FileSystem::removeFile(game->getCoverPath()); + if (Utils::FileSystem::exists(game->getCoverPath())) + Utils::FileSystem::removeFile(game->getCoverPath()); - if (Utils::FileSystem::exists(game->getMarqueePath())) - Utils::FileSystem::removeFile(game->getMarqueePath()); + if (Utils::FileSystem::exists(game->getMarqueePath())) + Utils::FileSystem::removeFile(game->getMarqueePath()); - if (Utils::FileSystem::exists(game->get3DBoxPath())) - Utils::FileSystem::removeFile(game->get3DBoxPath()); + if (Utils::FileSystem::exists(game->get3DBoxPath())) + Utils::FileSystem::removeFile(game->get3DBoxPath()); - if (Utils::FileSystem::exists(game->getThumbnailPath())) - Utils::FileSystem::removeFile(game->getThumbnailPath()); + if (Utils::FileSystem::exists(game->getThumbnailPath())) + Utils::FileSystem::removeFile(game->getThumbnailPath()); + } FileData* parent = game->getParent(); // Select next element in list, or previous if none.