Use backend filter for search prompt

This commit is contained in:
RumovZ 2021-01-28 13:26:52 +01:00
parent 77765d4896
commit 99cb68513c

View File

@ -612,6 +612,7 @@ class Browser(QMainWindow):
qconnect(self.form.searchEdit.lineEdit().returnPressed, self.onSearchActivated) qconnect(self.form.searchEdit.lineEdit().returnPressed, self.onSearchActivated)
self.form.searchEdit.setCompleter(None) self.form.searchEdit.setCompleter(None)
self._searchPrompt = tr(TR.BROWSING_TYPE_HERE_TO_SEARCH) self._searchPrompt = tr(TR.BROWSING_TYPE_HERE_TO_SEARCH)
self._searchPromptFilter = self.col.search_string(name=NamedFilter.CURRENT_DECK)
self.form.searchEdit.addItems( self.form.searchEdit.addItems(
[self._searchPrompt] + self.mw.pm.profile["searchHistory"] [self._searchPrompt] + self.mw.pm.profile["searchHistory"]
) )
@ -629,7 +630,7 @@ class Browser(QMainWindow):
prompt = self.form.searchEdit.lineEdit().text() prompt = self.form.searchEdit.lineEdit().text()
# convert guide text before we save history # convert guide text before we save history
txt = "deck:current " if prompt == self._searchPrompt else prompt txt = self._searchPromptFilter if prompt == self._searchPrompt else prompt
self.update_history(txt) self.update_history(txt)
# keep track of search string so that we reuse identical search when # keep track of search string so that we reuse identical search when