]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix Groups folder on loading of a Python script with Groups
authorvsv <vsv@opencascade.com>
Mon, 19 Nov 2018 11:54:28 +0000 (14:54 +0300)
committervsv <vsv@opencascade.com>
Mon, 19 Nov 2018 11:54:53 +0000 (14:54 +0300)
src/PartSet/PartSet_TreeNodes.cpp

index aa2394aaa7024e1b457228c1aad65c4dacf49c55..4e27874870454cd5d92b41e53db1e59c6dcc5ac1 100644 (file)
@@ -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);
   }