]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2441: Rebuild data tree on folder remove.
authorvsv <vsv@opencascade.com>
Tue, 20 Feb 2018 13:16:10 +0000 (16:16 +0300)
committervsv <vsv@opencascade.com>
Tue, 20 Feb 2018 13:16:10 +0000 (16:16 +0300)
src/XGUI/XGUI_DataModel.cpp

index b4ee3b011269487627067cdc6dbefabf2ac6ac97..df96b18263b03743221bc073649ff0897d12a64a 100644 (file)
@@ -221,10 +221,12 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
       std::string aGroup = (*aIt);
       if (aDoc == aRootDoc) {  // If root objects
         int aRow = aRootDoc->size(aGroup, true);
-        if ((aGroup == aRootType) || (aGroup == ModelAPI_Folder::group())) {
+        if (aGroup == aRootType) {
           // Process root folder
           removeRow(aRow + aNbFolders);
           rebuildBranch(aNbFolders, aRow);
+        } else if (aGroup == ModelAPI_Folder::group()) {
+          rebuildDataTree();
         } else {
           // Process root sub-folder
           int aFolderId = myXMLReader->rootFolderId(aGroup);
@@ -251,10 +253,12 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
         if (aDocRoot.isValid()) {
           int aRow = aDoc->size(aGroup, true);
           int aNbSubFolders = foldersCount(aDoc.get());
-          if ((aGroup == aSubType) || (aGroup == ModelAPI_Folder::group())) {
+          if (aGroup == aSubType) {
             // List of objects under document root
             removeRow(aRow + aNbSubFolders, aDocRoot);
             rebuildBranch(aNbSubFolders, aRow, aDocRoot);
+          } if (aGroup == ModelAPI_Folder::group()) {
+            rebuildDataTree();
           } else {
             // List of objects under a folder
             int aFolderId = folderId(aGroup, aDoc.get());