[processing] Also filter using algorithm short descriptions

This commit is contained in:
Nyall Dawson 2018-05-17 06:08:58 +10:00
parent 5edcc64f72
commit b98f8f1d37
2 changed files with 8 additions and 4 deletions

View File

@ -160,8 +160,10 @@ class ProcessingToolbox(QgsDockWidget, WIDGET):
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)

View File

@ -606,8 +606,10 @@ class ModelerDialog(BASE, WIDGET):
# 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)