Commit e27f6884 authored by con's avatar con
Browse files

Fix setting the mode keyboard shortcuts.

Broke with 61e468a8.
parent cf6d8d63
...@@ -147,11 +147,16 @@ void ModeManager::objectAdded(QObject *obj) ...@@ -147,11 +147,16 @@ void ModeManager::objectAdded(QObject *obj)
m_modeShortcuts.insert(index, cmd); m_modeShortcuts.insert(index, cmd);
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip())); connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip()));
for (int i = 0; i < m_modeShortcuts.size(); ++i) { for (int i = 0; i < m_modeShortcuts.size(); ++i) {
Command *currentCmd = m_modeShortcuts.at(i);
bool currentlyHasDefaultSequence = (currentCmd->keySequence()
== currentCmd->defaultKeySequence());
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
m_modeShortcuts.at(i)->setDefaultKeySequence(QKeySequence(QString("Meta+%1").arg(i+1))); currentCmd->setDefaultKeySequence(QKeySequence(QString("Meta+%1").arg(i+1)));
#else #else
m_modeShortcuts.at(i)->setDefaultKeySequence(QKeySequence(QString("Ctrl+%1").arg(i+1))); currentCmd->setDefaultKeySequence(QKeySequence(QString("Ctrl+%1").arg(i+1)));
#endif #endif
if (currentlyHasDefaultSequence)
currentCmd->setKeySequence(currentCmd->defaultKeySequence());
} }
m_signalMapper->setMapping(shortcut, mode->uniqueModeName()); m_signalMapper->setMapping(shortcut, mode->uniqueModeName());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment