From e5cbf7d34048f5b76dca6056acc5ef5a1253ec1e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Mar 2023 09:19:07 +0530 Subject: [PATCH] Fix #2008427 [another ampersand escape bug](https://bugs.launchpad.net/calibre/+bug/2008427) --- src/calibre/gui2/tag_browser/view.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index 2e0d22a4a0..7e21e755f3 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -1008,11 +1008,12 @@ class TagsView(QTreeView): # {{{ if tag is None: cm = self.context_menu cm.addSeparator() - sm = cm.addAction(_('Change {} category icon').format(category), + acategory = category.replace('&', '&&') + sm = cm.addAction(_('Change {} category icon').format(acategory), partial(self.context_menu_handler, action='set_icon', key=key, category=category)) sm.setIcon(QIcon.ic('icon_choose.png')) - sm = cm.addAction(_('Restore {} category default icon').format(category), + sm = cm.addAction(_('Restore {} category default icon').format(acategory), partial(self.context_menu_handler, action='clear_icon', key=key, category=category)) sm.setIcon(QIcon.ic('edit-clear.png'))