From 7374d0513e1822e3ceb79545985864cba66028d7 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 15 Jun 2020 16:39:31 +0200 Subject: [PATCH] Some minor changes for code consistency --- nw/gui/doceditor.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index bd491a4f..f3b70649 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -1203,14 +1203,14 @@ class GuiDocEditor(QTextEdit): # =============================================================================================== # # The Off GUI Thread Word Counter -# Runs the word counter in the background for the doCEditor +# Runs the word counter in the background for the DocEditor # =============================================================================================== # class BackgroundWordCounter(QThread): - def __init__(self, theParent): - QThread.__init__(self, theParent) - self.theParent = theParent + def __init__(self, docEditor): + QThread.__init__(self, docEditor) + self.docEditor = docEditor self.charCount = 0 self.wordCount = 0 self.paraCount = 0 @@ -1220,13 +1220,11 @@ class BackgroundWordCounter(QThread): """Overloaded run function for the word counter, forwarding the call to the function that does the actual counting. """ - theText = self.theParent.getText() + theText = self.docEditor.getText() cC, wC, pC = countWords(theText) - self.charCount = cC self.wordCount = wC self.paraCount = pC - return ## END Class BackgroundWordCounter