From bce23c69e144c6d0f065d6c9137f0d5b8c8aa820 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 22 Jun 2020 19:22:26 +0200 Subject: [PATCH] Also remove word count when a file is permamently deleted --- nw/gui/projtree.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index 01f53390..968cfc9b 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -394,7 +394,8 @@ class GuiProjectTree(QTreeWidget): if doPermanent: logger.debug("Permanently deleting file with handle %s" % tHandle) - tIndex = trItemP.indexOfChild(trItemS) + self.propagateCount(tHandle, 0) + tIndex = trItemP.indexOfChild(trItemS) trItemC = trItemP.takeChild(tIndex) if self.theParent.docEditor.theHandle == tHandle: @@ -523,7 +524,7 @@ class GuiProjectTree(QTreeWidget): relevant values in the project and on the status bar. This call is a fast way of getting this number, and depends on the propagateCount function being called when it should to maintain - the correct count. + the correct count. Orphan folder is not included in the total. """ nWords = 0 for n in range(self.topLevelItemCount()):