From fcf3d839b6acc518d634c112c7a3e837a5d0cef2 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 3 Feb 2016 22:50:02 +0100 Subject: [PATCH] Fix shortcut handling with KDE Frameworks KDE Frameworks slightly altered the way it handles default shortcuts for actions; the property name was changed to support lists of shortcuts. This issue lead to default shortcuts not being active for Quassel built against KDE Frameworks. --- src/uisupport/action.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/uisupport/action.cpp b/src/uisupport/action.cpp index c222dc19..216cac84 100644 --- a/src/uisupport/action.cpp +++ b/src/uisupport/action.cpp @@ -98,11 +98,12 @@ void Action::setShortcutConfigurable(bool b) QKeySequence Action::shortcut(ShortcutTypes type) const { Q_ASSERT(type); - if (type == DefaultShortcut) - return property("defaultShortcut").value(); + if (type == DefaultShortcut) { + auto sequence = property("defaultShortcuts").value>(); + return sequence.isEmpty() ? QKeySequence() : sequence.first(); + } - if (shortcuts().count()) return shortcuts().value(0); - return QKeySequence(); + return shortcuts().isEmpty() ? QKeySequence() : shortcuts().first(); } @@ -117,7 +118,7 @@ void Action::setShortcut(const QKeySequence &key, ShortcutTypes type) Q_ASSERT(type); if (type & DefaultShortcut) - setProperty("defaultShortcut", key); + setProperty("defaultShortcuts", QVariant::fromValue(QList() << key)); if (type & ActiveShortcut) QAction::setShortcut(key); -- 2.20.1