Some minor changes for code consistency

This commit is contained in:
Veronica K. B. Olsen
2020-06-15 16:39:31 +02:00
parent aad35e2d7b
commit 7374d0513e
+5 -7
View File
@@ -1203,14 +1203,14 @@ class GuiDocEditor(QTextEdit):
# =============================================================================================== # # =============================================================================================== #
# The Off GUI Thread Word Counter # 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): class BackgroundWordCounter(QThread):
def __init__(self, theParent): def __init__(self, docEditor):
QThread.__init__(self, theParent) QThread.__init__(self, docEditor)
self.theParent = theParent self.docEditor = docEditor
self.charCount = 0 self.charCount = 0
self.wordCount = 0 self.wordCount = 0
self.paraCount = 0 self.paraCount = 0
@@ -1220,13 +1220,11 @@ class BackgroundWordCounter(QThread):
"""Overloaded run function for the word counter, forwarding the """Overloaded run function for the word counter, forwarding the
call to the function that does the actual counting. call to the function that does the actual counting.
""" """
theText = self.theParent.getText() theText = self.docEditor.getText()
cC, wC, pC = countWords(theText) cC, wC, pC = countWords(theText)
self.charCount = cC self.charCount = cC
self.wordCount = wC self.wordCount = wC
self.paraCount = pC self.paraCount = pC
return return
## END Class BackgroundWordCounter ## END Class BackgroundWordCounter