Salome HOME
Optimization of folders update in a data tree
authorvsv <vsv@opencascade.com>
Thu, 22 Nov 2018 06:53:02 +0000 (09:53 +0300)
committervsv <vsv@opencascade.com>
Thu, 22 Nov 2018 06:53:25 +0000 (09:53 +0300)
src/XGUI/XGUI_DataModel.cpp

index fc6096e862140910fc8c58a3aeb3323c5c4b3d7c..a574c035332be147695d3b3f949daf78e229125a 100644 (file)
@@ -143,10 +143,17 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
       foreach(ObjectPtr aObj, aCreated) {
         ModuleBase_ITreeNode* aNode = myRoot->subNode(aObj);
         if (aNode) {
-          if (aNode->parent())
-            aNode = aNode->parent();
-          if (!aParents.contains(aNode))
-            aParents.insert(aNode);
+          if (aNode->parent()) {
+            if (aNode->parent() == myRoot) {
+              aParents.clear();
+              aParents.insert(myRoot);
+              break;
+            }
+            else {
+              aNode = aNode->parent();
+            }
+          }
+          aParents.insert(aNode);
         }
       }
       foreach(ModuleBase_ITreeNode* aNode, aParents) {