Further improvement to adding or removing collections.

This commit is contained in:
Leon Styhre 2021-01-02 15:14:13 +01:00
parent 5565170d93
commit 830c53e3cc
2 changed files with 5 additions and 1 deletions

View file

@ -257,7 +257,6 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
collectionsConfigEntry); collectionsConfigEntry);
setNeedsSaving(); setNeedsSaving();
setNeedsGoToStart(); setNeedsGoToStart();
setNeedsGoToSystem(SystemData::sSystemVector.front());
} }
CollectionSystemsManager::get()->deleteCustomCollection(name); CollectionSystemsManager::get()->deleteCustomCollection(name);
return true; return true;

View file

@ -84,12 +84,17 @@ void GuiSettings::save()
ViewController::get()->goToSystem(mGoToSystem, false); ViewController::get()->goToSystem(mGoToSystem, false);
if (mNeedsGoToGroupedCollections) { if (mNeedsGoToGroupedCollections) {
bool groupedSystemExists = false;
for (SystemData* system : SystemData::sSystemVector) { for (SystemData* system : SystemData::sSystemVector) {
if (system->getThemeFolder() == "custom-collections") { if (system->getThemeFolder() == "custom-collections") {
ViewController::get()->goToSystem(system, false); ViewController::get()->goToSystem(system, false);
groupedSystemExists = true;
continue; 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) { if (mNeedsCollectionsUpdate) {