mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-25 02:05:43 +08:00
#32 use remove/add to replace hotkey
possible workaround for "edited hotkey" not working
This commit is contained in:
committed by
Mat Sutcliffe
parent
7981815ddf
commit
637bae5bb6
@@ -131,9 +131,13 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CSettingsHotkeyComponent::updateHotkeyInSettings(const CActionHotkey &oldValue, const CActionHotkey &newValue)
|
void CSettingsHotkeyComponent::updateHotkeyInSettings(const CActionHotkey &oldValue, const CActionHotkey &newValue)
|
||||||
{
|
{
|
||||||
CActionHotkeyList actionHotkeyList(m_actionHotkeys.getThreadLocal());
|
//! \todo KB 2020-06 since there are many users reporting issues with replacing hotkey we use remove/add
|
||||||
actionHotkeyList.replace(oldValue, newValue);
|
this->removeHotkeyFromSettings(oldValue);
|
||||||
m_actionHotkeys.set(actionHotkeyList);
|
this->addHotkeyToSettings(newValue);
|
||||||
|
|
||||||
|
// CActionHotkeyList actionHotkeyList(m_actionHotkeys.getThreadLocal());
|
||||||
|
// actionHotkeyList.replace(oldValue, newValue);
|
||||||
|
// m_actionHotkeys.set(actionHotkeyList);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettingsHotkeyComponent::removeHotkeyFromSettings(const CActionHotkey &actionHotkey)
|
void CSettingsHotkeyComponent::removeHotkeyFromSettings(const CActionHotkey &actionHotkey)
|
||||||
|
|||||||
@@ -196,14 +196,14 @@ namespace BlackMisc
|
|||||||
|
|
||||||
void CIdentifier::updateToCurrentMachine()
|
void CIdentifier::updateToCurrentMachine()
|
||||||
{
|
{
|
||||||
m_machineIdBase64 = cachedMachineUniqueId().toBase64();
|
m_machineIdBase64 = cachedMachineUniqueId().toBase64();
|
||||||
m_machineName = cachedLocalHostName();
|
m_machineName = cachedLocalHostName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIdentifier::updateToCurrentProcess()
|
void CIdentifier::updateToCurrentProcess()
|
||||||
{
|
{
|
||||||
m_processName = QCoreApplication::applicationName();
|
m_processName = QCoreApplication::applicationName();
|
||||||
m_processId = QCoreApplication::applicationPid();
|
m_processId = QCoreApplication::applicationPid();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CIdentifier::convertToQString(bool i18n) const
|
QString CIdentifier::convertToQString(bool i18n) const
|
||||||
|
|||||||
@@ -66,8 +66,11 @@ namespace BlackMisc
|
|||||||
const CIdentifier comparison("comparison for local machine");
|
const CIdentifier comparison("comparison for local machine");
|
||||||
for (CActionHotkey &actionHotkey : *this)
|
for (CActionHotkey &actionHotkey : *this)
|
||||||
{
|
{
|
||||||
const bool sameMachine = actionHotkey.getIdentifier().hasSameMachineNameOrId(comparison);
|
// to avoid issue we always update
|
||||||
if (sameMachine) { actionHotkey.updateToCurrentMachine(); }
|
actionHotkey.updateToCurrentMachine();
|
||||||
|
|
||||||
|
// const bool sameMachine = actionHotkey.getIdentifier().hasSameMachineNameOrId(comparison);
|
||||||
|
// if (sameMachine) { actionHotkey.updateToCurrentMachine(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
Reference in New Issue
Block a user