switch some existing code to use SearchTerm(negated=...)

This commit is contained in:
Damien Elmes 2021-02-11 10:55:02 +10:00
parent 397cff9194
commit 5c69bccfcf
2 changed files with 2 additions and 4 deletions

View File

@ -197,7 +197,7 @@ class CustomStudy(QDialog):
dyn["resched"] = True dyn["resched"] = True
elif type == TYPE_REVIEW: elif type == TYPE_REVIEW:
terms = self.mw.col.build_search_string( 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 ord = DYN_RANDOM
dyn["resched"] = True dyn["resched"] = True

View File

@ -812,9 +812,7 @@ class SidebarTreeView(QTreeView):
collapse_key=Config.Bool.COLLAPSE_TAGS, collapse_key=Config.Bool.COLLAPSE_TAGS,
type=SidebarItemType.TAG_ROOT, type=SidebarItemType.TAG_ROOT,
) )
root.on_click = self._filter_func( root.on_click = self._filter_func(SearchTerm(negated=SearchTerm(tag="none")))
self.col.build_search_string(SearchTerm(tag="none"), negate=True)
)
root.add_simple( root.add_simple(
name=tr(TR.BROWSING_SIDEBAR_UNTAGGED), name=tr(TR.BROWSING_SIDEBAR_UNTAGGED),
icon=icon, icon=icon,