Fix a regression that caused the library switch entries at the bottom of the library menu to not work when there are many libraries. Fixes #1490096 [mismatched library returned upon selection](https://bugs.launchpad.net/calibre/+bug/1490096)

This commit is contained in:
Kovid Goyal 2015-08-29 11:48:43 +05:30
parent 1654895ee0
commit f1cd5d7194

View File

@ -326,7 +326,6 @@ class ChooseLibraryAction(InterfaceAction):
for ac in self.switch_actions:
ac.setVisible(False)
self.quick_menu.clear()
self.qs_locations = [i[1] for i in locations]
self.rename_menu.clear()
self.delete_menu.clear()
quick_actions, rename_actions, delete_actions = [], [], []
@ -357,6 +356,7 @@ class ChooseLibraryAction(InterfaceAction):
ac.setStatusTip(_('Switch to: %s') % loc)
ac.setVisible(True)
qs_actions.append(ac)
self.qs_locations = [i[1] for i in locations_by_frequency]
self.quick_menu_action.setVisible(bool(locations))
self.rename_menu_action.setVisible(bool(locations))