From 57c53632a6f3c813e22ab79f6c12d979904f2b9a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 29 Jan 2021 13:18:28 +1000 Subject: [PATCH] Revert "Make sidebar search matching work with full_name instead of name" This reverts commit 6850e0f78ef949ae03d944d2db18a33006cfe0dc. Using the full name caused issues with highlighting: https://github.com/ankitects/anki/pull/951#issuecomment-769516003 Let's revert this for now and see if demand presents itself. --- qt/aqt/sidebar.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qt/aqt/sidebar.py b/qt/aqt/sidebar.py index 0e6656230..f5336ce8b 100644 --- a/qt/aqt/sidebar.py +++ b/qt/aqt/sidebar.py @@ -140,7 +140,7 @@ class SidebarModel(QAbstractItemModel): if not index.isValid(): return QVariant() - if role not in (Qt.DisplayRole, Qt.DecorationRole, Qt.ToolTipRole, Qt.EditRole): + if role not in (Qt.DisplayRole, Qt.DecorationRole, Qt.ToolTipRole): return QVariant() item: SidebarItem = index.internalPointer() @@ -149,8 +149,6 @@ class SidebarModel(QAbstractItemModel): return QVariant(item.name) elif role == Qt.ToolTipRole: return QVariant(item.tooltip) - elif role == Qt.EditRole: - return QVariant(item.full_name) else: return QVariant(theme_manager.icon_from_resources(item.icon)) @@ -277,7 +275,6 @@ class SidebarTreeView(QTreeView): filter_model.setSourceModel(self.model()) filter_model.setFilterCaseSensitivity(False) # type: ignore filter_model.setRecursiveFilteringEnabled(True) - filter_model.setFilterRole(Qt.EditRole) self.setModel(filter_model) else: filter_model = self.model()