Skip to content

Commit 3b17d5a

Browse files
committed
processing search: also search in group items and fix return value
1 parent 058d59b commit 3b17d5a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

python/plugins/processing/gui/ConfigDialog.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def textChanged(self, text=None):
138138
text = str(text.lower())
139139
else:
140140
text = str(self.searchBox.text().lower())
141-
self._filterItem(self.model.invisibleRootItem(), text)
141+
found = self._filterItem(self.model.invisibleRootItem(), text)
142142

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

152152
if text:
153-
return True
153+
return found
154154
else:
155155
self.tree.collapseAll()
156156
return False
157157

158158
def _filterItem(self, item, text):
159159
if item.hasChildren():
160-
show = False
160+
show = isinstance(item, QStandardItem) and bool(text) and (text in item.text().lower())
161161
for i in range(item.rowCount()):
162162
child = item.child(i)
163-
showChild = self._filterItem(child, text)
164-
show = (showChild or show)
163+
show = self._filterItem(child, text) or show
165164
self.tree.setRowHidden(item.row(), item.index().parent(), not show)
166165
return show
167166

0 commit comments

Comments
 (0)