mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Fix virtual library names with ampersands in them not being displayed correctly in the virtual library menu and tab bar
This commit is contained in:
parent
35a95b1d32
commit
22f4baed8e
2 changed files with 3 additions and 3 deletions
|
|
@ -327,7 +327,7 @@ def rebuild(self):
|
|||
virt_libs = (set(virt_libs) - hidden) | {''}
|
||||
order = {x:i for i, x in enumerate(order)}
|
||||
for i, vl in enumerate(sorted(virt_libs, key=lambda x:(order.get(x, 0), sort_key(x)))):
|
||||
self.addTab(vl or _('All books'))
|
||||
self.addTab(vl.replace('&', '&&') or _('All books'))
|
||||
self.setTabData(i, vl)
|
||||
if vl == current_lib:
|
||||
current_idx = i
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ def virtual_library_clicked(self):
|
|||
|
||||
virt_libs = db.prefs.get('virtual_libraries', {})
|
||||
for vl in sorted(virt_libs.keys(), key=sort_key):
|
||||
a = m.addAction(self.checked if vl == current_lib else self.empty, vl)
|
||||
a = m.addAction(self.checked if vl == current_lib else self.empty, vl.replace('&', '&&'))
|
||||
a.triggered.connect(partial(self.apply_virtual_library, library=vl))
|
||||
|
||||
p = QPoint(0, self.virtual_library.height())
|
||||
|
|
@ -462,7 +462,7 @@ def build_virtual_library_list(self, menu, handler):
|
|||
menu.setIcon(self.empty)
|
||||
|
||||
def add_action(name, search):
|
||||
a = menu.addAction(name)
|
||||
a = menu.addAction(name.replace('&', '&&'))
|
||||
a.triggered.connect(partial(handler, name=name))
|
||||
a.setIcon(self.empty)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue