From 90f5d7fad4dfbb6f64fcf890e5622ba55336be7e Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 27 Sep 2020 11:19:55 +0200 Subject: [PATCH] Fixed additional issue with folder updates and gamelist sorting. --- es-app/src/guis/GuiMetaDataEd.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index ca9615d73..281eeba45 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -359,22 +359,19 @@ void GuiMetaDataEd::save() // Enter game in index. mScraperParams.system->getIndex()->addToIndex(mScraperParams.game); + // If it's a folder that has been updated, we need to manually sort the gamelist + // as CollectionSystemManager ignores folders. + if (mScraperParams.game->getType() == FOLDER) + mScraperParams.system->sortSystem(false); + if (mSavedCallback) mSavedCallback(); // Update respective Collection Entries. CollectionSystemManager::get()->refreshCollectionSystems(mScraperParams.game); - // If it's a folder that has been updated, we need to manually sort and reload the - // gamelist as CollectionSystemManager ignores folders. - if (mScraperParams.game->getType() == FOLDER) { - FileData* systemRoot = mScraperParams.system->getRootFolder(); - systemRoot->sort(systemRoot->getSortTypeFromString(systemRoot->getSortTypeString()), - Settings::getInstance()->getBool("FavoritesFirst")); - ViewController::get()->reloadGameListView(mScraperParams.system); - } - mScraperParams.system->onMetaDataSavePoint(); + // Make sure that the cached background is updated to reflect any possible visible // changes to the gamelist (e.g. the game name). mWindow->invalidateCachedBackground();