ActionManager: Require a valid context for shortcuts

All callers provide one, and the fall-back construction from 0
has not been appropriate for a while.

Change-Id: I8bc5d094b70aac251fff1a7d34f1fad876cbdee2
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
hjk
2013-01-28 11:59:54 +01:00
parent 167316d7da
commit 6d31f0b870

View File

@@ -258,6 +258,7 @@ Command *ActionManager::registerAction(QAction *action, const Id &id, const Cont
*/
Command *ActionManager::registerShortcut(QShortcut *shortcut, const Id &id, const Context &context, bool scriptable)
{
QTC_CHECK(!context.isEmpty());
Shortcut *sc = 0;
if (CommandPrivate *c = m_instance->d->m_idCmdMap.value(id, 0)) {
sc = qobject_cast<Shortcut *>(c);
@@ -282,11 +283,7 @@ Command *ActionManager::registerShortcut(QShortcut *shortcut, const Id &id, cons
shortcut->setParent(ICore::mainWindow());
sc->setShortcut(shortcut);
sc->setScriptable(scriptable);
if (context.isEmpty())
sc->setContext(Context(0));
else
sc->setContext(context);
sc->setContext(context);
emit m_instance->commandListChanged();
emit m_instance->commandAdded(id.toString());