diff --git a/qt/aqt/browser/browser.py b/qt/aqt/browser/browser.py index ffbfc9b1b..a50d4642f 100644 --- a/qt/aqt/browser/browser.py +++ b/qt/aqt/browser/browser.py @@ -281,7 +281,7 @@ class Browser(QMainWindow): # search triggered by user @ensure_editor_saved def onSearchActivated(self) -> None: - text = self.form.searchEdit.lineEdit().text() + text = self.current_search() try: normed = self.col.build_search_string(text) except Exception as err: @@ -580,7 +580,7 @@ where id in %s""" ChangeModel(self, nids) def createFilteredDeck(self) -> None: - search = self.form.searchEdit.lineEdit().text() + search = self.current_search() if self.mw.col.schedVer() != 1 and KeyboardModifiersPressed().alt: aqt.dialogs.open("FilteredDeckConfigDialog", self.mw, search_2=search) else: diff --git a/qt/aqt/browser/sidebar/tree.py b/qt/aqt/browser/sidebar/tree.py index 15f6b5af7..daba51389 100644 --- a/qt/aqt/browser/sidebar/tree.py +++ b/qt/aqt/browser/sidebar/tree.py @@ -933,9 +933,7 @@ class SidebarTreeView(QTreeView): def _get_current_search(self) -> Optional[str]: try: - return self.col.build_search_string( - self.browser.form.searchEdit.lineEdit().text() - ) + return self.col.build_search_string(self.browser.current_search()) except Exception as e: showWarning(str(e)) return None