From a129fe341ae1605ecf691eac1dfce6313974a6de Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 19 Nov 2018 14:54:28 +0300 Subject: [PATCH] Fix Groups folder on loading of a Python script with Groups --- src/PartSet/PartSet_TreeNodes.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/PartSet/PartSet_TreeNodes.cpp b/src/PartSet/PartSet_TreeNodes.cpp index aa2394aaa..4e2787487 100644 --- a/src/PartSet/PartSet_TreeNodes.cpp +++ b/src/PartSet/PartSet_TreeNodes.cpp @@ -859,16 +859,18 @@ void PartSet_PartRootNode::update() bool aHasFields = myFieldsFolder->childrenCount() > 0; bool aHasGroups = myGroupsFolder->childrenCount() > 0; - if (aHasFields && (!myChildren.contains(myFieldsFolder))) { - myChildren.insert(3, myFieldsFolder); - } - else if (myChildren.contains(myFieldsFolder)) { + if (aHasFields) { + if (!myChildren.contains(myFieldsFolder)) { + myChildren.insert(3, myFieldsFolder); + } + } else if (myChildren.contains(myFieldsFolder)) { myChildren.removeAll(myFieldsFolder); } - if (aHasGroups && (!myChildren.contains(myGroupsFolder))) { - myChildren.insert(aHasFields ? 4 : 3, myGroupsFolder); - } - else if (myChildren.contains(myGroupsFolder)) { + if (aHasGroups) { + if (!myChildren.contains(myGroupsFolder)) { + myChildren.insert(aHasFields ? 4 : 3, myGroupsFolder); + } + } else if (myChildren.contains(myGroupsFolder)) { myChildren.removeAll(myGroupsFolder); } -- 2.39.2