]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/XGUI/XGUI_DataModel.cpp
Salome HOME
Fix bug with deletion of sub-nodes
[modules/shaper.git] / src / XGUI / XGUI_DataModel.cpp
index 92a4bc67ce6d7e5293dfb66e5781bcb1c580b14b..95c80678b3bbe3b9597dd6ba0a167b2152b086f7 100644 (file)
@@ -100,7 +100,14 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
     for (aIt = aMsgGroups.cbegin(); aIt != aMsgGroups.cend(); aIt++) {
       aList.append(myRoot->objectsDeleted(aIt->first, aIt->second.c_str()));
     }
+    // Remove obsolete nodes
+    QTreeNodesList aRemaining;
     foreach(ModuleBase_ITreeNode* aNode, aList) {
+      if (myRoot->hasSubNode(aNode))
+        aRemaining.append(aNode);
+    }
+    // Update remaining nodes
+    foreach(ModuleBase_ITreeNode* aNode, aRemaining) {
       if (aNode->parent())
         aNode->parent()->update();
     }