From: vsv Date: Tue, 16 Oct 2018 12:45:46 +0000 (+0300) Subject: Issue #2690: Optimize deletion of tree update X-Git-Tag: V9_2_0a2~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4b14105bd502f8e06d50cff67a4775647983500c;p=modules%2Fshaper.git Issue #2690: Optimize deletion of tree update --- diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index 4ead852d1..ee7f93457 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -87,15 +87,15 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& theMess std::dynamic_pointer_cast(theMessage); const std::list, std::string>>& aMsgGroups = aUpdMsg->groups(); + QTreeNodesList aList; std::list, std::string>>::const_iterator aIt; - bool isRebuildTree = false; for (aIt = aMsgGroups.cbegin(); aIt != aMsgGroups.cend(); aIt++) { - if (aIt->second == ModelAPI_Folder::group()) - isRebuildTree = true; - QTreeNodesList aList = myRoot->objectsDeleted(aIt->first, aIt->second.c_str()); + aList.append(myRoot->objectsDeleted(aIt->first, aIt->second.c_str())); + } + foreach(ModuleBase_ITreeNode* aNode, aList) { + if (aNode->parent()) + aNode->parent()->update(); } - if (isRebuildTree) - myRoot->update(); rebuildDataTree(); } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) {