From 183a3ca2ec5b81771cddec104baf37540661ac96 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 6 Jan 2014 13:10:25 +0100 Subject: Cocoa: fix gnu emacs style shortcut for action in menu The regression was introduced in bdebec4e2ef79f1771d2dcc22f9a919eb4487567. Cocoa QPA plugin only could handle the shortcut with one key sequence, not the multiple key sequences. We just let Qt to handle those cases. Task-number: QTBUG-33627 Change-Id: I3898308d9f4ecda8bd716d8b286f05f9f311774a Reviewed-by: Gabriel de Dietrich --- src/widgets/kernel/qshortcut.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index f7f7cf1039..dcf6aed591 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -279,13 +279,12 @@ static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidge // (and reaches this point), then the menu item itself has been disabled. // This occurs at the QPA level on Mac, were we disable all the Cocoa menus // when showing a modal window. - Q_UNUSED(menu); - continue; -#else + if (a->shortcut().count() <= 1) + continue; +#endif QAction *a = menu->menuAction(); if (correctActionContext(context, a, active_window)) return true; -#endif } else #endif if (correctWidgetContext(context, w, active_window)) -- cgit v1.2.3