From: vsv Date: Mon, 19 Nov 2018 11:54:28 +0000 (+0300) Subject: Fix Groups folder on loading of a Python script with Groups X-Git-Tag: End2018~167 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a129fe341ae1605ecf691eac1dfce6313974a6de;p=modules%2Fshaper.git Fix Groups folder on loading of a Python script with Groups --- 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); }