Refresh global search when toggling settings, if there is a search

This commit is contained in:
Veronica Berglyd Olsen
2024-06-16 15:27:46 +02:00
parent 7c33c949cb
commit ee46fdb5b1
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -208,6 +208,12 @@ class GuiProjectSearch(QWidget):
self.searchResult.clear()
return
def refreshCurrentSearch(self) -> None:
"""Refresh the search if there is one."""
if self.searchResult.topLevelItemCount() > 0:
self._processSearch()
return
##
# Events
##
@@ -298,18 +304,21 @@ class GuiProjectSearch(QWidget):
def _toggleCase(self, state: bool) -> None:
"""Enable/disable case sensitive mode."""
CONFIG.searchProjCase = state
self.refreshCurrentSearch()
return
@pyqtSlot(bool)
def _toggleWord(self, state: bool) -> None:
"""Enable/disable whole word search mode."""
CONFIG.searchProjWord = state
self.refreshCurrentSearch()
return
@pyqtSlot(bool)
def _toggleRegEx(self, state: bool) -> None:
"""Enable/disable regular expression search mode."""
CONFIG.searchProjRegEx = state
self.refreshCurrentSearch()
return
##