Drop the setting to change word count interval

This commit is contained in:
Veronica Berglyd Olsen
2024-01-08 19:13:58 +01:00
parent 1482451e87
commit 978a8145a8
2 changed files with 3 additions and 12 deletions
+2 -7
View File
@@ -187,13 +187,12 @@ class GuiDocEditor(QPlainTextEdit):
# Set Up Document Word Counter
self.wcTimerDoc = QTimer()
self.wcTimerDoc.timeout.connect(self._runDocCounter)
self.wcTimerDoc.setInterval(5000)
self.wCounterDoc = BackgroundWordCounter(self)
self.wCounterDoc.setAutoDelete(False)
self.wCounterDoc.signals.countsReady.connect(self._updateDocCounts)
self.wcInterval = CONFIG.wordCountTimer
# Set Up Selection Word Counter
self.wcTimerSel = QTimer()
self.wcTimerSel.timeout.connect(self._runSelCounter)
@@ -359,10 +358,6 @@ class GuiDocEditor(QPlainTextEdit):
# Refresh the tab stops
self.setTabStopDistance(CONFIG.getTabWidth())
# Configure word count timer
self.wcInterval = CONFIG.wordCountTimer
self.wcTimerDoc.setInterval(int(self.wcInterval*1000))
# If we have a document open, we should reload it in case the
# font changed, otherwise we just clear the editor entirely,
# which makes it read only.
@@ -1190,7 +1185,7 @@ class GuiDocEditor(QPlainTextEdit):
logger.debug("Word counter is busy")
return
if time() - self._lastEdit < 5.0 * self.wcInterval:
if time() - self._lastEdit < 25.0:
logger.debug("Running word counter")
SHARED.runInThreadPool(self.wCounterDoc)