mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed an issue where repopulating collections did not update the filter indices correctly.
This commit is contained in:
parent
222c75a65b
commit
2e5b1b5187
|
@ -957,7 +957,7 @@ void CollectionSystemsManager::repopulateCollection(SystemData* sysData)
|
|||
it != mAutoCollectionSystemsData.cend(); it++) {
|
||||
if ((*it).second.system == sysData) {
|
||||
LOG(LogDebug) << "CollectionSystemsManager::repopulateCollection(): "
|
||||
"Repopulating auto collection '" << it->first << "'.";
|
||||
"Repopulating auto collection \"" << it->first << "\"";
|
||||
|
||||
CollectionSystemData* autoSystem = &mAutoCollectionSystemsData[it->first];
|
||||
std::vector<FileData*> systemEntries =
|
||||
|
@ -970,13 +970,15 @@ void CollectionSystemsManager::repopulateCollection(SystemData* sysData)
|
|||
if (systemEntries.empty())
|
||||
return;
|
||||
|
||||
// Delete all children from the system and remove them from the index too.
|
||||
// Delete all children from the system.
|
||||
for (FileData* entry : systemEntries) {
|
||||
autoSystem->system->getIndex()->removeFromIndex(entry);
|
||||
autoSystem->system->getRootFolder()->removeChild(entry);
|
||||
delete entry;
|
||||
}
|
||||
|
||||
// Reset the filters so that they get rebuilt correctly when populating the collection.
|
||||
autoSystem->system->getIndex()->resetIndex();
|
||||
|
||||
autoSystem->isPopulated = false;
|
||||
populateAutoCollection(autoSystem);
|
||||
|
||||
|
@ -1097,8 +1099,8 @@ void CollectionSystemsManager::populateAutoCollection(CollectionSystemData* sysD
|
|||
include = include && (*gameIt)->metadata.get("playcount") > "0";
|
||||
break;
|
||||
case AUTO_FAVORITES:
|
||||
// We may still want to add files we don't
|
||||
// want in auto collections in "favorites"
|
||||
// We may still want to add files we don't want in auto collections
|
||||
// to "favorites".
|
||||
include = (*gameIt)->metadata.get("favorite") == "true";
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue