Fixed an issue where empty grouped collections would be removed upon startup.

This commit is contained in:
Leon Styhre 2021-02-04 19:57:13 +01:00
parent 4f21d1b351
commit c9c5e53066

View file

@ -481,8 +481,10 @@ void FileData::sort(ComparisonFunction& comparator,
// should be filtered already at that earlier point.
if ((*it)->getHidden())
it = mChildren.erase(it);
// Also hide folders where all its entries have been hidden.
else if ((*it)->getType() == FOLDER && (*it)->getChildren().size() == 0)
// Also hide folders where all its entries have been hidden, unless it's a
// grouped custom collection.
else if ((*it)->getType() == FOLDER && (*it)->getChildren().size() == 0 &&
!(*it)->getSystem()->isGroupedCustomCollection())
it = mChildren.erase(it);
else
it++;