Add test coverage of duplicate function in project tree

This commit is contained in:
Veronica Berglyd Olsen
2023-07-20 21:00:11 +02:00
parent b3c744d22e
commit 188536d0f6
2 changed files with 67 additions and 16 deletions
+1 -2
View File
@@ -1687,14 +1687,13 @@ class GuiProjectTree(QTreeWidget):
docDup = DocDuplicator(self.theProject)
dupCount = 0
for dHandle, nHandle in docDup.duplicate(itemTree):
print(dHandle, nHandle)
self.theProject.index.reIndexHandle(dHandle)
self.revealNewTreeItem(dHandle, nHandle=nHandle, wordCount=True)
self._alertTreeChange(dHandle, flush=False)
dupCount += 1
if dupCount != nItems:
self.mainGui.makeAlert(self.tr("Could not duplicate all items."), nwAlert.ERROR)
self.mainGui.makeAlert(self.tr("Could not duplicate all items."), nwAlert.WARN)
self.saveTreeOrder()