Skip to content

Commit

Permalink
[processing] Also filter using algorithm short descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 16, 2018
1 parent 5edcc64 commit b98f8f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions python/plugins/processing/gui/ProcessingToolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ def _filterItem(self, item, text):
elif isinstance(item, TreeAlgorithmItem):
# hide if every part of text is not contained somewhere in either the item text or item user role
item_text = [item.text(0).lower(), item.data(0, ProcessingToolbox.NAME_ROLE).lower()]
item_text.append(item.alg.id())
item_text.extend(item.data(0, ProcessingToolbox.TAG_ROLE))
item_text.append(item.alg.id().lower())
if item.alg.shortDescription():
item_text.append(item.alg.shortDescription().lower())
item_text.extend([t.lower() for t in item.data(0, ProcessingToolbox.TAG_ROLE)])

hide = bool(text) and not all(
any(part in t for t in item_text)
Expand Down
6 changes: 4 additions & 2 deletions python/plugins/processing/modeler/ModelerDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,10 @@ def _filterItem(self, item, text):
# hide if every part of text is not contained somewhere in either the item text or item user role
item_text = [item.text(0).lower(), item.data(0, ModelerDialog.NAME_ROLE).lower()]
if isinstance(item, TreeAlgorithmItem):
item_text.append(item.alg.id())
item_text.extend(item.data(0, ModelerDialog.TAG_ROLE))
item_text.append(item.alg.id().lower())
if item.alg.shortDescription():
item_text.append(item.alg.shortDescription().lower())
item_text.extend([t.lower() for t in item.data(0, ModelerDialog.TAG_ROLE)])

hide = bool(text) and not all(
any(part in t for t in item_text)
Expand Down

0 comments on commit b98f8f1

Please sign in to comment.