Handle the caching in the DocSearch class
This commit is contained in:
@@ -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
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user