QmlDesigner: Fix Component Library category collapsed state

Set category collapsed state only after checking the status of category
and not during it.

Fixes: QDS-4227
Change-Id: I4771a8641174ac2f0413b3ff2380dd8dbb77742f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miina Puuronen
2021-04-23 15:42:55 +03:00
parent a4d1beca2d
commit ca3b8f3b32

View File

@@ -375,11 +375,11 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
if (!categorySection) { if (!categorySection) {
categorySection = new ItemLibraryCategory(catName, importSection); categorySection = new ItemLibraryCategory(catName, importSection);
importSection->addCategory(categorySection); importSection->addCategory(categorySection);
}
if (importSection->sectionType() == ItemLibraryImport::SectionType::Default if (importSection->sectionType() == ItemLibraryImport::SectionType::Default
&& !importSection->hasSingleCategory()) { && !importSection->hasSingleCategory()) {
categorySection->setExpanded(loadExpandedState(categorySection->categoryName())); categorySection->setExpanded(loadExpandedState(categorySection->categoryName()));
} }
}
// create item // create item
auto item = new ItemLibraryItem(entry, isUsable, categorySection); auto item = new ItemLibraryItem(entry, isUsable, categorySection);