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:
@@ -377,8 +377,6 @@ Command *ActionManagerPrivate::registerOverridableAction(QAction *action, const
|
||||
#endif
|
||||
a->setAction(baseAction);
|
||||
m_mainWnd->addAction(baseAction);
|
||||
a->setKeySequence(a->keySequence());
|
||||
a->setDefaultKeySequence(QKeySequence());
|
||||
} else if (checkUnique) {
|
||||
qWarning() << "registerOverridableAction: id" << id << "is already registered.";
|
||||
}
|
||||
@@ -417,9 +415,6 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const Id &i
|
||||
else
|
||||
sc->setContext(context);
|
||||
|
||||
sc->setKeySequence(shortcut->key());
|
||||
sc->setDefaultKeySequence(QKeySequence());
|
||||
|
||||
return sc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user