[rigo] search bar: also search through descriptions

This commit is contained in:
Fabio Erculiani
2012-03-02 08:36:50 +01:00
parent 81738b8d3a
commit 0a91618f46
+15 -2
View File
@@ -125,14 +125,27 @@ class ApplicationsViewController(GObject.Object):
return txt.replace(" ", "-").lower()
matches = []
# exact match
pkg_matches, rc = self._entropy.atom_match(
text, multi_match = True,
multi_repo = True, mask_filter = False)
matches.extend(pkg_matches)
# atom searching (name and desc)
search_matches = self._entropy.atom_search(
_prepare_for_search(text),
repositories = self._entropy.repositories())
text,
repositories = self._entropy.repositories(),
description = True)
matches.extend([x for x in search_matches if x not in matches])
if not search_matches:
search_matches = self._entropy.atom_search(
_prepare_for_search(text),
repositories = self._entropy.repositories())
matches.extend([x for x in search_matches if x not in matches])
# we have to decide if to show the treeview in
# the UI thread, to avoid races (and also because we
# have to...)