Move the thread pool to the shared object instance
This commit is contained in:
@@ -1139,7 +1139,7 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
|
||||
if time() - self._lastEdit < 5 * self.wcInterval:
|
||||
logger.debug("Running word counter")
|
||||
self.mainGui.threadPool.start(self.wCounterDoc)
|
||||
SHARED.runInThreadPool(self.wCounterDoc)
|
||||
|
||||
return
|
||||
|
||||
@@ -1192,7 +1192,7 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
logger.debug("Selection word counter is busy")
|
||||
return
|
||||
|
||||
self.mainGui.threadPool.start(self.wCounterSel)
|
||||
SHARED.runInThreadPool(self.wCounterSel)
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -51,10 +51,19 @@ class GuiTextDocument(QTextDocument):
|
||||
logger.debug("Delete: GuiTextDocument")
|
||||
return
|
||||
|
||||
##
|
||||
# Properties
|
||||
##
|
||||
|
||||
@property
|
||||
def syntaxHighlighter(self) -> GuiDocHighlighter:
|
||||
"""Return the document's syntax highlighter object."""
|
||||
return self._syntax
|
||||
|
||||
##
|
||||
# Metods
|
||||
##
|
||||
|
||||
def setTextContent(self, text: str, tHandle: str) -> None:
|
||||
"""Set the text content of the document."""
|
||||
self._syntax.setHandle(tHandle)
|
||||
|
||||
Reference in New Issue
Block a user