From bd7bba7fae46aa02481a1144ad4e170053f6dd00 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 28 Nov 2014 23:35:34 +0530 Subject: [PATCH] ... --- src/calibre/gui2/keyboard.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/keyboard.py b/src/calibre/gui2/keyboard.py index 427a454ca9..5c0a60301e 100644 --- a/src/calibre/gui2/keyboard.py +++ b/src/calibre/gui2/keyboard.py @@ -54,11 +54,6 @@ def finalize(shortcuts, custom_keys_map={}): # {{{ ''' seen, keys_map = {}, {} for unique_name, shortcut in shortcuts.iteritems(): - ac = shortcut['action'] - if ac is None or sip.isdeleted(ac): - if ac is not None and DEBUG: - prints('Shortcut %r has a deleted action' % unique_name) - continue custom_keys = custom_keys_map.get(unique_name, None) if custom_keys is None: candidates = shortcut['default_keys'] @@ -81,6 +76,11 @@ def finalize(shortcuts, custom_keys_map={}): # {{{ keys = tuple(keys) keys_map[unique_name] = keys + ac = shortcut['action'] + if ac is None or sip.isdeleted(ac): + if ac is not None and DEBUG: + prints('Shortcut %r has a deleted action' % unique_name) + continue ac.setShortcuts(list(keys)) return keys_map