Fixed an issue where game media files would get deleted when the recents collection was trimmed.

This commit is contained in:
Leon Styhre 2020-07-24 22:15:53 +02:00
parent 6a4fea547d
commit c4d634670d

View file

@ -136,7 +136,7 @@ void BasicGameListView::launch(FileData* game)
void BasicGameListView::remove(FileData *game, bool deleteFile) void BasicGameListView::remove(FileData *game, bool deleteFile)
{ {
// Actually delete the file on the filesystem. // Actually delete the file on the filesystem.
if (deleteFile) if (deleteFile) {
Utils::FileSystem::removeFile(game->getPath()); Utils::FileSystem::removeFile(game->getPath());
// Remove all game media files as well. // Remove all game media files as well.
@ -160,6 +160,7 @@ void BasicGameListView::remove(FileData *game, bool deleteFile)
if (Utils::FileSystem::exists(game->getThumbnailPath())) if (Utils::FileSystem::exists(game->getThumbnailPath()))
Utils::FileSystem::removeFile(game->getThumbnailPath()); Utils::FileSystem::removeFile(game->getThumbnailPath());
}
FileData* parent = game->getParent(); FileData* parent = game->getParent();
// Select next element in list, or previous if none. // Select next element in list, or previous if none.