From: vsv Date: Fri, 4 Sep 2015 16:35:28 +0000 (+0300) Subject: Take into account folders which can not be shown empty when history updated X-Git-Tag: V_1.4.0_beta4~110 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1da30c3b28cc0fe8f1f8c9ee09a2e26fec0634c2;p=modules%2Fshaper.git Take into account folders which can not be shown empty when history updated --- diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index bc407998b..76fc27da0 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -192,8 +192,9 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& theMess } // Check that some folders could disappear QStringList aNotEmptyFolders = listOfShowNotEmptyFolders(false); + int aSize = aDoc->size(aGroup); foreach (QString aNotEmptyFolder, aNotEmptyFolders) { - if ((aNotEmptyFolder.toStdString() == aGroup) && (aDoc->size(aGroup) == 1)) + if ((aNotEmptyFolder.toStdString() == aGroup) && (aSize == 0)) // Appears first object in folder which can not be shown empty removeRow(myXMLReader.subFolderId(aGroup), aDocRoot); } diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 9a28b3292..c43ca86fa 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -141,8 +141,6 @@ void XGUI_DataTree::onDoubleClick(const QModelIndex& theIndex) DocumentPtr aDoc = aMgr->activeDocument(); - QModelIndex aOldIndex = aModel->lastHistoryIndex(); - std::string aOpName = tr("History change").toStdString(); if (aObj.get()) { if (aObj->document() != aDoc) @@ -165,13 +163,10 @@ void XGUI_DataTree::onDoubleClick(const QModelIndex& theIndex) } QModelIndex aNewIndex = aModel->lastHistoryIndex(); QModelIndex aParent = theIndex.parent(); - int aStartRow = std::min(aOldIndex.row(), aNewIndex.row()); - int aEndRow = std::max(aOldIndex.row(), aNewIndex.row()); - for (int i = aStartRow; i <= aEndRow; i++) { + int aSize = aModel->rowCount(aParent); + for (int i = 0; i < aSize; i++) { update(aModel->index(i, 0, aParent)); } - update(aOldIndex); - update(aNewIndex); } //********************************************************************