forked from qt-creator/qt-creator
Avoid use of QKeySequence::isEmpty in checks in command implementations.
isEmpty is the wrong thing to check when setting the default shortcut. In addition, registering commands should not set their shortcut automatically (that should be defined solely by the default shortcut and reading the settings, which is done later).
This commit is contained in:
@@ -198,6 +198,9 @@ void ModeManager::objectAdded(QObject *obj)
|
||||
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip()));
|
||||
for (int i = 0; i < d->m_modeShortcuts.size(); ++i) {
|
||||
Command *currentCmd = d->m_modeShortcuts.at(i);
|
||||
// we need this hack with currentlyHasDefaultSequence
|
||||
// because we call setDefaultShortcut multiple times on the same cmd
|
||||
// and still expect the current shortcut to change with it
|
||||
bool currentlyHasDefaultSequence = (currentCmd->keySequence()
|
||||
== currentCmd->defaultKeySequence());
|
||||
#ifdef Q_WS_MAC
|
||||
|
||||
Reference in New Issue
Block a user