[rigo] search bar: also search through descriptions
This commit is contained in:
+15
-2
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user