Skip to content

Commit 6d5f8c3

Browse files
committed
reimplemented title matching
1 parent 80ff6a9 commit 6d5f8c3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Orange/canvas/document/quickmenu.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,19 +325,17 @@ def filterFunc(self):
325325
def filterAcceptsRow(self, row, parent=QModelIndex()):
326326
flat_model = self.sourceModel()
327327
index = flat_model.index(row, self.filterKeyColumn(), parent)
328-
keywords = flat_model.data(index, role=QtWidgetRegistry.WIDGET_DESC_ROLE).keywords
328+
description = flat_model.data(index, role=QtWidgetRegistry.WIDGET_DESC_ROLE)
329+
name = description.name
330+
keywords = description.keywords
329331

330-
# match keywords
332+
# match name and keywords
331333
accepted = False
332-
for keyword in keywords:
334+
for keyword in [name] + keywords:
333335
if self.filterRegExp().indexIn(keyword) > -1:
334336
accepted = True
335337
break
336338

337-
# if does not match keywords, match title
338-
if not accepted:
339-
accepted = QSortFilterProxyModel.filterAcceptsRow(self, row, parent)
340-
341339
# if matches query, apply filter function (compatibility with paired widget)
342340
if accepted and self.__filterFunc is not None:
343341
model = self.sourceModel()

0 commit comments

Comments
 (0)