From b9a0e14561ae81213585dd63ec273b8fd51da0b3 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 30 Dec 2019 18:19:14 -0800 Subject: [PATCH] Qt: Fix inability to clear default keybindings --- CHANGES | 1 + src/platform/qt/ActionMapper.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 6daaac328..a8121ee70 100644 --- a/CHANGES +++ b/CHANGES @@ -105,6 +105,7 @@ Other fixes: - Qt: Fix "restart needed" dialog after first config (fixes mgba.io/i/1601) - Qt: Fix undesired screen filtering when paused (fixes mgba.io/i/1602) - Qt: Fix sprite view using wrong base address (fixes mgba.io/i/1603) + - Qt: Fix inability to clear default keybindings Misc: - GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580) - GBA I/O: Stop logging several harmless invalid register reads diff --git a/src/platform/qt/ActionMapper.cpp b/src/platform/qt/ActionMapper.cpp index 13c059b4c..bdd2065cc 100644 --- a/src/platform/qt/ActionMapper.cpp +++ b/src/platform/qt/ActionMapper.cpp @@ -72,8 +72,10 @@ void ActionMapper::rebuildMenu(const QString& menu, QMenu* qmenu, QWidget* conte qaction->setChecked(true); } const Shortcut* shortcut = shortcuts.shortcut(actionName); - if (shortcut && shortcut->shortcut() > 0) { - qaction->setShortcut(QKeySequence(shortcut->shortcut())); + if (shortcut) { + if (shortcut->shortcut() > 0) { + qaction->setShortcut(QKeySequence(shortcut->shortcut())); + } } else if (!m_defaultShortcuts[actionName].isEmpty()) { qaction->setShortcut(m_defaultShortcuts[actionName][0]); }