From: vsv Date: Tue, 20 Feb 2018 13:16:10 +0000 (+0300) Subject: Issue #2441: Rebuild data tree on folder remove. X-Git-Tag: V_3.0.0~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b1671adb205ee7efc4ab1e4cf68251da52272fd9;p=modules%2Fshaper.git Issue #2441: Rebuild data tree on folder remove. --- diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index b4ee3b011..df96b1826 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -221,10 +221,12 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& 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& 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());