Skip to content

Commit b98f8f1

Browse files
committedMay 16, 2018
[processing] Also filter using algorithm short descriptions
1 parent 5edcc64 commit b98f8f1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
 

‎python/plugins/processing/gui/ProcessingToolbox.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ def _filterItem(self, item, text):
160160
elif isinstance(item, TreeAlgorithmItem):
161161
# hide if every part of text is not contained somewhere in either the item text or item user role
162162
item_text = [item.text(0).lower(), item.data(0, ProcessingToolbox.NAME_ROLE).lower()]
163-
item_text.append(item.alg.id())
164-
item_text.extend(item.data(0, ProcessingToolbox.TAG_ROLE))
163+
item_text.append(item.alg.id().lower())
164+
if item.alg.shortDescription():
165+
item_text.append(item.alg.shortDescription().lower())
166+
item_text.extend([t.lower() for t in item.data(0, ProcessingToolbox.TAG_ROLE)])
165167

166168
hide = bool(text) and not all(
167169
any(part in t for t in item_text)

‎python/plugins/processing/modeler/ModelerDialog.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,10 @@ def _filterItem(self, item, text):
606606
# hide if every part of text is not contained somewhere in either the item text or item user role
607607
item_text = [item.text(0).lower(), item.data(0, ModelerDialog.NAME_ROLE).lower()]
608608
if isinstance(item, TreeAlgorithmItem):
609-
item_text.append(item.alg.id())
610-
item_text.extend(item.data(0, ModelerDialog.TAG_ROLE))
609+
item_text.append(item.alg.id().lower())
610+
if item.alg.shortDescription():
611+
item_text.append(item.alg.shortDescription().lower())
612+
item_text.extend([t.lower() for t in item.data(0, ModelerDialog.TAG_ROLE)])
611613

612614
hide = bool(text) and not all(
613615
any(part in t for t in item_text)

0 commit comments

Comments
 (0)
Please sign in to comment.