From f1cd5d71946c4b53edbcdeea6c02bb2dec93b5d5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 29 Aug 2015 11:48:43 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/actions/choose_library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/actions/choose_library.py b/src/calibre/gui2/actions/choose_library.py index 8b203a48df..02032b0af6 100644 --- a/src/calibre/gui2/actions/choose_library.py +++ b/src/calibre/gui2/actions/choose_library.py @@ -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))