Handle the caching in the DocSearch class

This commit is contained in:
Veronica Berglyd Olsen
2024-03-25 22:31:37 +01:00
parent 8a12b03a1f
commit bdc1f0a5d4
5 changed files with 16 additions and 47 deletions
-20
View File
@@ -135,8 +135,6 @@ class GuiProjectSearch(QWidget):
self.setLayout(self.outerBox)
self.updateTheme()
SHARED.slowClockTick.connect(self._cacheTimeout)
logger.debug("Ready: GuiProjectSearch")
return
@@ -205,17 +203,6 @@ class GuiProjectSearch(QWidget):
super().keyPressEvent(event)
return
##
# Public Slots
##
@pyqtSlot(str)
def clearSearchCache(self, tHandle: str) -> None:
"""Process document content change."""
if not self._blocked:
self._search.clearTextCache(tHandle)
return
##
# Private Slots
##
@@ -284,13 +271,6 @@ class GuiProjectSearch(QWidget):
CONFIG.searchProjRegEx = state
return
@pyqtSlot()
def _cacheTimeout(self) -> None:
"""Clear the cache after a period of inactivity."""
if not self._blocked and time() - self._time > CACHE_TIMEOUT:
self._search.clearTextCache(None)
return
##
# Internal Functions
##