]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for deletion of sub-nodes
authorvsv <vsv@opencascade.com>
Tue, 30 Oct 2018 14:38:17 +0000 (17:38 +0300)
committervsv <vsv@opencascade.com>
Tue, 30 Oct 2018 14:38:17 +0000 (17:38 +0300)
src/XGUI/XGUI_DataModel.cpp

index f2cfa898a12481d8394f1b28ab0803ebe67475e7..92a4bc67ce6d7e5293dfb66e5781bcb1c580b14b 100644 (file)
@@ -135,22 +135,11 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
       foreach(ObjectPtr aObj, aCreated) {
         ModuleBase_ITreeNode* aNode = myRoot->subNode(aObj);
         if (aNode) {
-          int aOldNb = aNode->childrenCount();
           aNode->update();
-          int aNewNb = aNode->childrenCount();
-
+          rebuildDataTree();
           QModelIndex aFirstIdx = getIndex(aNode, 0);
           QModelIndex aLastIdx = getIndex(aNode, 2);
 
-          if (aNewNb > aOldNb) {
-            insertRows(aOldNb - 1, aNewNb - aOldNb, aFirstIdx);
-          }
-          else if (aNewNb < aOldNb) {
-            if (aNewNb)
-              removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
-            else if (aOldNb)
-              removeRows(0, aOldNb, aFirstIdx);
-          }
           dataChanged(aFirstIdx, aLastIdx);
         }
       }