From 2856dad280c746eb5c900cf2dbbd1eec1d16b48f Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 31 Aug 2018 14:58:50 +0200 Subject: [PATCH] Fix hotkey settings not loaded during app start CInputManager is listening for hotkey settings changes, but it never loaded the current state during construction and kept an empty setting. ref T318 --- src/blackcore/inputmanager.cpp | 3 ++- src/blackcore/inputmanager.h | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/blackcore/inputmanager.cpp b/src/blackcore/inputmanager.cpp index fafabfac5..9dad48583 100644 --- a/src/blackcore/inputmanager.cpp +++ b/src/blackcore/inputmanager.cpp @@ -31,6 +31,7 @@ namespace BlackCore { connect(m_keyboard.get(), &IKeyboard::keyCombinationChanged, this, &CInputManager::ps_processKeyCombinationChanged, Qt::QueuedConnection); connect(m_joystick.get(), &IJoystick::buttonCombinationChanged, this, &CInputManager::ps_processButtonCombinationChanged, Qt::QueuedConnection); + reloadHotkeySettings(); } CInputManager *CInputManager::instance() @@ -69,7 +70,7 @@ namespace BlackCore } } - void CInputManager::onChangedHotkeySettings() + void CInputManager::reloadHotkeySettings() { m_configuredActions.clear(); for (const CActionHotkey &actionHotkey : m_actionHotkeys.getThreadLocal()) diff --git a/src/blackcore/inputmanager.h b/src/blackcore/inputmanager.h index 04647d2a2..9d9813a6c 100644 --- a/src/blackcore/inputmanager.h +++ b/src/blackcore/inputmanager.h @@ -122,8 +122,8 @@ namespace BlackCore std::function m_function; }; - //! Change hotkey settings - void onChangedHotkeySettings(); + //! Reload hotkey settings + void reloadHotkeySettings(); //! Bind action int bindImpl(const QString &action, QObject *receiver, std::function function); @@ -143,7 +143,7 @@ namespace BlackCore BlackMisc::Input::CHotkeyCombination m_lastCombination; BlackMisc::Input::CHotkeyCombination m_capturedCombination; - BlackMisc::CSetting m_actionHotkeys { this, &CInputManager::onChangedHotkeySettings }; + BlackMisc::CSetting m_actionHotkeys { this, &CInputManager::reloadHotkeySettings }; }; } // ns