From 88844b3cb51f7ec315c0dc4e01fe5cc85bfa0873 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 31 Jul 2012 10:27:41 +0200 Subject: [PATCH] [Rigo] enable fallback search only when in:installed and Set search are not triggered --- rigo/rigo/ui/gtk3/controllers/applications.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rigo/rigo/ui/gtk3/controllers/applications.py b/rigo/rigo/ui/gtk3/controllers/applications.py index 7188c6c6b..fe126c6f5 100644 --- a/rigo/rigo/ui/gtk3/controllers/applications.py +++ b/rigo/rigo/ui/gtk3/controllers/applications.py @@ -163,9 +163,11 @@ class ApplicationsViewController(GObject.Object): self._entropy.rwsem().reader_acquire() try: matches = [] + use_fallback = True # in:installed [ ...] if search_cmd == ApplicationsViewController.SHOW_INSTALLED_KEY: + use_fallback = False inst_repo = self._entropy.installed_repository() if not search_args: for pkg_id in inst_repo.listAllPackageIds( @@ -176,8 +178,10 @@ class ApplicationsViewController(GObject.Object): for pkg_id in inst_repo.searchPackages( search_arg.lower(), just_id=True): matches.append((pkg_id, inst_repo.repository_id())) + # package set search - elif text.startswith(etpConst['packagesetprefix']): + elif search_cmd.startswith(etpConst['packagesetprefix']): + use_fallback = False sets = self._entropy.Sets() package_deps = sets.expand(text) for package_dep in package_deps: @@ -186,7 +190,8 @@ class ApplicationsViewController(GObject.Object): if pkg_id != -1: matches.append((pkg_id, pkg_repo)) - if not matches: + # fallback search + if not matches and use_fallback: # exact match pkg_matches, rc = self._entropy.atom_match( text, multi_match=True,