Skip to content
Permalink
Browse files

processing search: also search in group items and fix return value

  • Loading branch information
3nids committed Feb 5, 2018
1 parent 058d59b commit 3b17d5a784440588aaa04305d5c553e6385a5bbc
Showing with 4 additions and 5 deletions.
  1. +4 −5 python/plugins/processing/gui/ConfigDialog.py
@@ -138,7 +138,7 @@ def textChanged(self, text=None):
text = str(text.lower())
else:
text = str(self.searchBox.text().lower())
self._filterItem(self.model.invisibleRootItem(), text)
found = self._filterItem(self.model.invisibleRootItem(), text)

self.auto_adjust_columns = False
if text:
@@ -150,18 +150,17 @@ def textChanged(self, text=None):
self.auto_adjust_columns = True

if text:
return True
return found
else:
self.tree.collapseAll()
return False

def _filterItem(self, item, text):
if item.hasChildren():
show = False
show = isinstance(item, QStandardItem) and bool(text) and (text in item.text().lower())
for i in range(item.rowCount()):
child = item.child(i)
showChild = self._filterItem(child, text)
show = (showChild or show)
show = self._filterItem(child, text) or show
self.tree.setRowHidden(item.row(), item.index().parent(), not show)
return show

0 comments on commit 3b17d5a

Please sign in to comment.
You can’t perform that action at this time.