Function for getKeyStrings() and replace without key (just adding)

This commit is contained in:
Klaus Basan
2019-02-17 22:43:32 +01:00
committed by Mat Sutcliffe
parent 94b53cef6c
commit 21acef505c
4 changed files with 23 additions and 3 deletions

View File

@@ -42,8 +42,11 @@ namespace BlackMisc
void CHotkeyCombination::replaceKey(CKeyboardKey oldKey, CKeyboardKey newKey)
{
Q_ASSERT(!oldKey.isUnknown());
m_keyboardKeys.remove(oldKey);
if (oldKey.hasKey())
{
Q_ASSERT(!oldKey.isUnknown());
m_keyboardKeys.remove(oldKey);
}
if (!newKey.isUnknown()) { m_keyboardKeys.push_back(newKey); }
m_keyboardKeys.sortBy(&CKeyboardKey::getKey);
}