From ca3b8f3b32060355ad4b61a1748640876675a2bc Mon Sep 17 00:00:00 2001 From: Miina Puuronen Date: Fri, 23 Apr 2021 15:42:55 +0300 Subject: [PATCH] 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 --- .../components/itemlibrary/itemlibrarymodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp index 7b75e022177..017579c1a15 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp @@ -375,10 +375,10 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model) if (!categorySection) { categorySection = new ItemLibraryCategory(catName, importSection); importSection->addCategory(categorySection); - if (importSection->sectionType() == ItemLibraryImport::SectionType::Default - && !importSection->hasSingleCategory()) { - categorySection->setExpanded(loadExpandedState(categorySection->categoryName())); - } + } + if (importSection->sectionType() == ItemLibraryImport::SectionType::Default + && !importSection->hasSingleCategory()) { + categorySection->setExpanded(loadExpandedState(categorySection->categoryName())); } // create item