From b1671adb205ee7efc4ab1e4cf68251da52272fd9 Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 20 Feb 2018 16:16:10 +0300 Subject: [PATCH] Issue #2441: Rebuild data tree on folder remove. --- src/XGUI/XGUI_DataModel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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()); -- 2.39.2