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++) {
|
it != mAutoCollectionSystemsData.cend(); it++) {
|
||||||
if ((*it).second.system == sysData) {
|
if ((*it).second.system == sysData) {
|
||||||
LOG(LogDebug) << "CollectionSystemsManager::repopulateCollection(): "
|
LOG(LogDebug) << "CollectionSystemsManager::repopulateCollection(): "
|
||||||
"Repopulating auto collection '" << it->first << "'.";
|
"Repopulating auto collection \"" << it->first << "\"";
|
||||||
|
|
||||||
CollectionSystemData* autoSystem = &mAutoCollectionSystemsData[it->first];
|
CollectionSystemData* autoSystem = &mAutoCollectionSystemsData[it->first];
|
||||||
std::vector<FileData*> systemEntries =
|
std::vector<FileData*> systemEntries =
|
||||||
|
@ -970,13 +970,15 @@ void CollectionSystemsManager::repopulateCollection(SystemData* sysData)
|
||||||
if (systemEntries.empty())
|
if (systemEntries.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Delete all children from the system and remove them from the index too.
|
// Delete all children from the system.
|
||||||
for (FileData* entry : systemEntries) {
|
for (FileData* entry : systemEntries) {
|
||||||
autoSystem->system->getIndex()->removeFromIndex(entry);
|
|
||||||
autoSystem->system->getRootFolder()->removeChild(entry);
|
autoSystem->system->getRootFolder()->removeChild(entry);
|
||||||
delete entry;
|
delete entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset the filters so that they get rebuilt correctly when populating the collection.
|
||||||
|
autoSystem->system->getIndex()->resetIndex();
|
||||||
|
|
||||||
autoSystem->isPopulated = false;
|
autoSystem->isPopulated = false;
|
||||||
populateAutoCollection(autoSystem);
|
populateAutoCollection(autoSystem);
|
||||||
|
|
||||||
|
@ -1097,8 +1099,8 @@ void CollectionSystemsManager::populateAutoCollection(CollectionSystemData* sysD
|
||||||
include = include && (*gameIt)->metadata.get("playcount") > "0";
|
include = include && (*gameIt)->metadata.get("playcount") > "0";
|
||||||
break;
|
break;
|
||||||
case AUTO_FAVORITES:
|
case AUTO_FAVORITES:
|
||||||
// We may still want to add files we don't
|
// We may still want to add files we don't want in auto collections
|
||||||
// want in auto collections in "favorites"
|
// to "favorites".
|
||||||
include = (*gameIt)->metadata.get("favorite") == "true";
|
include = (*gameIt)->metadata.get("favorite") == "true";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue