From 830c53e3cc07480ec6572d170499eddd42aa93d4 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 2 Jan 2021 15:14:13 +0100 Subject: [PATCH] Further improvement to adding or removing collections. --- es-app/src/guis/GuiCollectionSystemsOptions.cpp | 1 - es-app/src/guis/GuiSettings.cpp | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/es-app/src/guis/GuiCollectionSystemsOptions.cpp b/es-app/src/guis/GuiCollectionSystemsOptions.cpp index ebd4edda5..b120ff6cc 100644 --- a/es-app/src/guis/GuiCollectionSystemsOptions.cpp +++ b/es-app/src/guis/GuiCollectionSystemsOptions.cpp @@ -257,7 +257,6 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions( collectionsConfigEntry); setNeedsSaving(); setNeedsGoToStart(); - setNeedsGoToSystem(SystemData::sSystemVector.front()); } CollectionSystemsManager::get()->deleteCustomCollection(name); return true; diff --git a/es-app/src/guis/GuiSettings.cpp b/es-app/src/guis/GuiSettings.cpp index caba5800b..1bb6234a2 100644 --- a/es-app/src/guis/GuiSettings.cpp +++ b/es-app/src/guis/GuiSettings.cpp @@ -84,12 +84,17 @@ void GuiSettings::save() ViewController::get()->goToSystem(mGoToSystem, false); if (mNeedsGoToGroupedCollections) { + bool groupedSystemExists = false; for (SystemData* system : SystemData::sSystemVector) { if (system->getThemeFolder() == "custom-collections") { ViewController::get()->goToSystem(system, false); + groupedSystemExists = true; continue; } } + if (!groupedSystemExists) + // No grouped custom collection system exists, so go to the first system instead. + ViewController::get()->goToSystem(SystemData::sSystemVector.front(), false); } if (mNeedsCollectionsUpdate) {