Qt: Fix inability to clear default keybindings

This commit is contained in:
Vicki Pfau 2019-12-30 18:19:14 -08:00
parent 01656e6052
commit b9a0e14561
2 changed files with 5 additions and 2 deletions

View File

@ -105,6 +105,7 @@ Other fixes:
- Qt: Fix "restart needed" dialog after first config (fixes mgba.io/i/1601) - 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 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 sprite view using wrong base address (fixes mgba.io/i/1603)
- Qt: Fix inability to clear default keybindings
Misc: Misc:
- GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580) - GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580)
- GBA I/O: Stop logging several harmless invalid register reads - GBA I/O: Stop logging several harmless invalid register reads

View File

@ -72,8 +72,10 @@ void ActionMapper::rebuildMenu(const QString& menu, QMenu* qmenu, QWidget* conte
qaction->setChecked(true); qaction->setChecked(true);
} }
const Shortcut* shortcut = shortcuts.shortcut(actionName); const Shortcut* shortcut = shortcuts.shortcut(actionName);
if (shortcut && shortcut->shortcut() > 0) { if (shortcut) {
if (shortcut->shortcut() > 0) {
qaction->setShortcut(QKeySequence(shortcut->shortcut())); qaction->setShortcut(QKeySequence(shortcut->shortcut()));
}
} else if (!m_defaultShortcuts[actionName].isEmpty()) { } else if (!m_defaultShortcuts[actionName].isEmpty()) {
qaction->setShortcut(m_defaultShortcuts[actionName][0]); qaction->setShortcut(m_defaultShortcuts[actionName][0]);
} }