From: vsv Date: Thu, 22 Nov 2018 06:53:02 +0000 (+0300) Subject: Optimization of folders update in a data tree X-Git-Tag: End2018~154 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=577232d8f9496ffc862329c42ffbc9d09e742be8;p=modules%2Fshaper.git Optimization of folders update in a data tree --- diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index fc6096e86..a574c0353 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -143,10 +143,17 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& theMess foreach(ObjectPtr aObj, aCreated) { ModuleBase_ITreeNode* aNode = myRoot->subNode(aObj); if (aNode) { - if (aNode->parent()) - aNode = aNode->parent(); - if (!aParents.contains(aNode)) - aParents.insert(aNode); + if (aNode->parent()) { + if (aNode->parent() == myRoot) { + aParents.clear(); + aParents.insert(myRoot); + break; + } + else { + aNode = aNode->parent(); + } + } + aParents.insert(aNode); } } foreach(ModuleBase_ITreeNode* aNode, aParents) {