diff --git a/src/calibre/gui2/actions/__init__.py b/src/calibre/gui2/actions/__init__.py index e783fe75a2..809e80a834 100644 --- a/src/calibre/gui2/actions/__init__.py +++ b/src/calibre/gui2/actions/__init__.py @@ -353,10 +353,12 @@ class InterfaceAction(QObject): ''' Called when displaying the context menu in the Tag browser. ``index`` is the QModelIndex that points to the Tag browser item that was right clicked. - Test it for validitiy with index.valid() and get the underlying TagTreeItem - object with index.data(Qt.ItemDataRole.UserRole) + Test it for validity with index.valid() and get the underlying TagTreeItem + object with index.data(Qt.ItemDataRole.UserRole). This method must yield one + or more action objects that will be added to the context menu. ''' - pass + if False: + yield QAction() def shutting_down(self): ''' diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index c469b43605..df7e2e9906 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -1004,8 +1004,7 @@ class TagsView(QTreeView): # {{{ first = True for ac in get_gui().iactions.values(): try: - context_action = ac.tag_browser_context_action(index) - if context_action is not None: + for context_action in ac.tag_browser_context_action(index): if first: self.context_menu.addSeparator() first = False