Optimise a few details and add some tests

This commit is contained in:
Veronica Berglyd Olsen
2024-11-26 17:07:02 +01:00
parent c091e0b9bb
commit 43d95462e0
4 changed files with 54 additions and 16 deletions
+4 -2
View File
@@ -1279,11 +1279,13 @@ class GuiDocEditor(QPlainTextEdit):
"""Process the word counter's finished signal."""
if self._docHandle and self._nwItem:
logger.debug("Updating word count")
needsRefresh = wCount != self._nwItem.wordCount
self._nwItem.setCharCount(cCount)
self._nwItem.setWordCount(wCount)
self._nwItem.setParaCount(pCount)
self._nwItem.notifyToRefresh()
self.docFooter.updateWordCount(wCount, False)
if needsRefresh:
self._nwItem.notifyToRefresh()
self.docFooter.updateWordCount(wCount, False)
return
@pyqtSlot()