}
// 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);
}
DocumentPtr aDoc = aMgr->activeDocument();
- QModelIndex aOldIndex = aModel->lastHistoryIndex();
-
std::string aOpName = tr("History change").toStdString();
if (aObj.get()) {
if (aObj->document() != aDoc)
}
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);
}
//********************************************************************