From 5c69bccfcf7a4d95b0116782dcb461cf8f86664d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 11 Feb 2021 10:55:02 +1000 Subject: [PATCH] switch some existing code to use SearchTerm(negated=...) --- qt/aqt/customstudy.py | 2 +- qt/aqt/sidebar.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/qt/aqt/customstudy.py b/qt/aqt/customstudy.py index e4bc605dc..8f85c7ddf 100644 --- a/qt/aqt/customstudy.py +++ b/qt/aqt/customstudy.py @@ -197,7 +197,7 @@ class CustomStudy(QDialog): dyn["resched"] = True elif type == TYPE_REVIEW: terms = self.mw.col.build_search_string( - SearchTerm(card_state=SearchTerm.CARD_STATE_NEW), negate=True + SearchTerm(negated=SearchTerm(card_state=SearchTerm.CARD_STATE_NEW)) ) ord = DYN_RANDOM dyn["resched"] = True diff --git a/qt/aqt/sidebar.py b/qt/aqt/sidebar.py index e934ce79f..f29e14def 100644 --- a/qt/aqt/sidebar.py +++ b/qt/aqt/sidebar.py @@ -812,9 +812,7 @@ class SidebarTreeView(QTreeView): collapse_key=Config.Bool.COLLAPSE_TAGS, type=SidebarItemType.TAG_ROOT, ) - root.on_click = self._filter_func( - self.col.build_search_string(SearchTerm(tag="none"), negate=True) - ) + root.on_click = self._filter_func(SearchTerm(negated=SearchTerm(tag="none"))) root.add_simple( name=tr(TR.BROWSING_SIDEBAR_UNTAGGED), icon=icon,