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:
con
2010-10-08 13:18:35 +02:00
parent 6371d2835d
commit 0078bb0802
4 changed files with 18 additions and 22 deletions

View File

@@ -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;
}