Commit 8e236db9 authored by hjk's avatar hjk Committed by hjk
Browse files

mostly core and analyzer: more id-fication



Change-Id: Ic794fdc6a582f4a03d84b6220c59111044c753b9
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent ead46746
......@@ -580,7 +580,7 @@ void AnalyzerManagerPrivate::startLocalTool(IAnalyzerTool *tool, StartMode)
}
m_isRunning = true;
pe->runProject(pro, tool->id());
pe->runProject(pro, tool->id().toString());
updateRunActions();
}
......@@ -615,8 +615,7 @@ QAction *AnalyzerManagerPrivate::actionFromToolAndMode(IAnalyzerTool *tool, Star
void AnalyzerManagerPrivate::selectSavedTool()
{
const QSettings *settings = Core::ICore::instance()->settings();
const QByteArray lastActiveAction =
settings->value(QLatin1String(LAST_ACTIVE_TOOL), QString()).toByteArray();
const Core::Id lastActiveAction(settings->value(QLatin1String(LAST_ACTIVE_TOOL)).toString());
foreach (QAction *action, m_actions) {
IAnalyzerTool *tool = m_toolFromAction.value(action);
StartMode mode = m_modeFromAction.value(action);
......@@ -700,8 +699,8 @@ void AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool, const StartModes &mode
ActionManager *am = Core::ICore::instance()->actionManager();
foreach (StartMode mode, modes) {
QString actionName = tool->actionName(mode);
QString menuGroup = tool->menuGroup(mode);
Core::Id actionId(QString::fromLatin1(tool->actionId(mode)));
Id menuGroup = tool->menuGroup(mode);
Id actionId = tool->actionId(mode);
QAction *action = new QAction(actionName, 0);
Core::Command *command = am->registerAction(action, actionId,
Core::Context(Core::Constants::C_GLOBAL));
......@@ -742,7 +741,7 @@ void AnalyzerManagerPrivate::loadToolSettings(IAnalyzerTool *tool)
{
QTC_ASSERT(m_mainWindow, return);
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id());
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id().toString());
if (settings->value("ToolSettingsSaved", false).toBool())
m_mainWindow->restoreSettings(settings);
else
......@@ -757,11 +756,11 @@ void AnalyzerManagerPrivate::saveToolSettings(IAnalyzerTool *tool, StartMode mod
QTC_ASSERT(m_mainWindow, return);
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id());
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id().toString());
m_mainWindow->saveSettings(settings);
settings->setValue("ToolSettingsSaved", true);
settings->endGroup();
settings->setValue(QLatin1String(LAST_ACTIVE_TOOL), tool->actionId(mode));
settings->setValue(QLatin1String(LAST_ACTIVE_TOOL), tool->actionId(mode).toString());
}
void AnalyzerManagerPrivate::updateRunActions()
......@@ -770,7 +769,7 @@ void AnalyzerManagerPrivate::updateRunActions()
Project *project = pe->startupProject();
bool startEnabled = !m_isRunning
&& m_currentTool && pe->canRun(project, m_currentTool->id());
&& m_currentTool && pe->canRun(project, m_currentTool->id().toString());
QString disabledReason;
if (m_isRunning)
......@@ -778,7 +777,7 @@ void AnalyzerManagerPrivate::updateRunActions()
else if (!m_currentTool)
disabledReason = tr("No analyzer tool selected.");
else
disabledReason = pe->cannotRunReason(project, m_currentTool->id());
disabledReason = pe->cannotRunReason(project, m_currentTool->id().toString());
m_startAction->setEnabled(startEnabled);
m_startAction->setToolTip(disabledReason);
......@@ -921,12 +920,12 @@ void AnalyzerManager::handleToolFinished()
m_instance->d->handleToolFinished();
}
IAnalyzerTool *AnalyzerManager::toolFromId(const QByteArray &id)
IAnalyzerTool *AnalyzerManager::toolFromId(const Core::Id &id)
{
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
if (id.startsWith(tool->id()))
if (id.name().startsWith(tool->id().name()))
return tool;
QTC_ASSERT(false, qDebug() << "NO ANAYLYZER TOOL FOUND FOR ID" << id);
QTC_ASSERT(false, qDebug() << "NO ANAYLYZER TOOL FOUND FOR ID" << id.name());
return 0;
}
......
......@@ -37,6 +37,7 @@
#include "analyzerbase_global.h"
#include "analyzerconstants.h"
#include <coreplugin/id.h>
#include <QtCore/QObject>
......@@ -71,8 +72,8 @@ public:
// Register a tool and initialize it.
static void addTool(IAnalyzerTool *tool, const StartModes &mode);
static IAnalyzerTool *toolFromId(const QByteArray &id);
static StartMode modeFromId(const QByteArray &id);
static IAnalyzerTool *toolFromId(const Core::Id &id);
static StartMode modeFromId(const Core::Id &id);
// Dockwidgets are registered to the main window.
static QDockWidget *createDockWidget(IAnalyzerTool *tool, const QString &title,
......
......@@ -80,7 +80,7 @@ AnalyzerRunControl::Private::Private()
AnalyzerRunControl::AnalyzerRunControl(IAnalyzerTool *tool,
const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
: RunControl(runConfiguration, tool->id()),
: RunControl(runConfiguration, tool->id().toString()),
d(new Private)
{
d->m_engine = tool->createEngine(sp, runConfiguration);
......
......@@ -38,6 +38,7 @@
#include <QtCore/QMetaType>
#include <coreplugin/id.h>
#include <utils/ssh/sshconnection.h>
#include <utils/environment.h>
......@@ -56,7 +57,7 @@ public:
StartMode startMode;
Utils::SshConnectionParameters connParams;
QByteArray toolId;
Core::Id toolId;
QString debuggee;
QString debuggeeArgs;
QString analyzerCmdPrefix;
......
......@@ -41,25 +41,25 @@ IAnalyzerTool::IAnalyzerTool(QObject *parent)
: QObject(parent)
{}
QByteArray IAnalyzerTool::defaultMenuGroup(StartMode mode)
Core::Id IAnalyzerTool::defaultMenuGroup(StartMode mode)
{
if (mode == StartRemote)
return Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS;
return Analyzer::Constants::G_ANALYZER_TOOLS;
}
QByteArray IAnalyzerTool::defaultActionId(const IAnalyzerTool *tool, StartMode mode)
Core::Id IAnalyzerTool::defaultActionId(const IAnalyzerTool *tool, StartMode mode)
{
QByteArray id = tool->id();
Core::Id id = tool->id();
switch (mode) {
case Analyzer::StartLocal:
return "Analyzer." + id + ".Local";
return Core::Id(("Analyzer." + id.name() + ".Local").data());
case Analyzer::StartRemote:
return "Analyzer." + id + ".Remote";
return Core::Id(("Analyzer." + id.name() + ".Remote").data());
case Analyzer::StartQml:
return "Analyzer." + id + ".Qml";
return Core::Id(("Analyzer." + id.name() + ".Qml").data());
}
return QByteArray();
return Core::Id();
}
QString IAnalyzerTool::defaultActionName(const IAnalyzerTool *tool, StartMode mode)
......
......@@ -38,6 +38,8 @@
#include "analyzerbase_global.h"
#include "analyzerconstants.h"
#include <coreplugin/id.h>
#include <QtCore/QObject>
namespace ProjectExplorer {
......@@ -72,16 +74,16 @@ public:
explicit IAnalyzerTool(QObject *parent = 0);
/// Returns a unique ID for this tool.
virtual QByteArray id() const = 0;
virtual Core::Id id() const = 0;
/// Returns a short user readable display name for this tool.
virtual QString displayName() const = 0;
/// Returns a user readable description name for this tool.
virtual QString description() const = 0;
/// Returns an id for the start action.
virtual QByteArray actionId(StartMode mode) const
virtual Core::Id actionId(StartMode mode) const
{ return defaultActionId(this, mode); }
/// Returns the menu group the start action should go to.
virtual QByteArray menuGroup(StartMode mode) const
virtual Core::Id menuGroup(StartMode mode) const
{ return defaultMenuGroup(mode); }
/// Returns a short user readable action name for this tool.
virtual QString actionName(StartMode mode) const
......@@ -102,8 +104,8 @@ public:
virtual ToolMode toolMode() const = 0;
/// Convenience implementation.
static QByteArray defaultMenuGroup(StartMode mode);
static QByteArray defaultActionId(const IAnalyzerTool *tool, StartMode mode);
static Core::Id defaultMenuGroup(StartMode mode);
static Core::Id defaultActionId(const IAnalyzerTool *tool, StartMode mode);
static QString defaultActionName(const IAnalyzerTool *tool, StartMode mode);
/// This gets called after all analyzation tools where initialized.
......
......@@ -121,7 +121,7 @@ using namespace Core::Internal;
*/
/*!
\fn QAction *ActionContainer::insertLocation(const QString &group) const
\fn QAction *ActionContainer::insertLocation(const Core::Id &group) const
Returns an action representing the \a group,
that could be used with \c{QWidget::insertAction}.
*/
......@@ -136,7 +136,7 @@ using namespace Core::Internal;
*/
/*!
\fn void ActionContainer::addAction(Core::Command *action, const QString &group)
\fn void ActionContainer::addAction(Core::Command *action, const Core::Id &group)
Add the \a action as a menu item to this action container. The action is added as the
last item of the specified \a group.
\sa appendGroup()
......@@ -144,7 +144,7 @@ using namespace Core::Internal;
*/
/*!
\fn void ActionContainer::addMenu(Core::ActionContainer *menu, const QString &group)
\fn void ActionContainer::addMenu(Core::ActionContainer *menu, const Core::Id &group)
Add the \a menu as a submenu to this action container. The menu is added as the
last item of the specified \a group.
\sa appendGroup()
......@@ -163,12 +163,12 @@ using namespace Core::Internal;
\internal
*/
ActionContainerPrivate::ActionContainerPrivate(int id)
ActionContainerPrivate::ActionContainerPrivate(Id id)
: m_onAllDisabledBehavior(Disable), m_id(id), m_updateRequested(false)
{
appendGroup(QLatin1String(Constants::G_DEFAULT_ONE));
appendGroup(QLatin1String(Constants::G_DEFAULT_TWO));
appendGroup(QLatin1String(Constants::G_DEFAULT_THREE));
appendGroup(Constants::G_DEFAULT_ONE);
appendGroup(Constants::G_DEFAULT_TWO);
appendGroup(Constants::G_DEFAULT_THREE);
scheduleUpdate();
}
......@@ -182,12 +182,12 @@ ActionContainer::OnAllDisabledBehavior ActionContainerPrivate::onAllDisabledBeha
return m_onAllDisabledBehavior;
}
void ActionContainerPrivate::appendGroup(const QString &groupId)
void ActionContainerPrivate::appendGroup(const Id &groupId)
{
m_groups.append(Group(groupId));
}
QList<Group>::const_iterator ActionContainerPrivate::findGroup(const QString &groupId) const
QList<Group>::const_iterator ActionContainerPrivate::findGroup(const Id &groupId) const
{
QList<Group>::const_iterator it = m_groups.constBegin();
while (it != m_groups.constEnd()) {
......@@ -199,7 +199,7 @@ QList<Group>::const_iterator ActionContainerPrivate::findGroup(const QString &gr
}
QAction *ActionContainerPrivate::insertLocation(const QString &groupId) const
QAction *ActionContainerPrivate::insertLocation(const Id &groupId) const
{
QList<Group>::const_iterator it = findGroup(groupId);
QTC_ASSERT(it != m_groups.constEnd(), return 0);
......@@ -227,20 +227,15 @@ QAction *ActionContainerPrivate::insertLocation(QList<Group>::const_iterator gro
return 0;
}
void ActionContainerPrivate::addAction(Command *command, const QString &groupId)
void ActionContainerPrivate::addAction(Command *command, const Id &groupId)
{
if (!canAddAction(command))
return;
QString actualGroupId;
if (groupId.isEmpty())
actualGroupId = QLatin1String(Constants::G_DEFAULT_TWO);
else
actualGroupId = groupId;
const Id actualGroupId = groupId.isValid() ? groupId : Id(Constants::G_DEFAULT_TWO);
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
QTC_ASSERT(groupIt != m_groups.constEnd(), qDebug() << "Can't find group" << groupId
<< "in container" << id(); return);
QTC_ASSERT(groupIt != m_groups.constEnd(), qDebug() << "Can't find group"
<< groupId.name() << "in container" << id().name(); return);
QAction *beforeAction = insertLocation(groupIt);
m_groups[groupIt-m_groups.constBegin()].items.append(command);
......@@ -250,19 +245,14 @@ void ActionContainerPrivate::addAction(Command *command, const QString &groupId)
scheduleUpdate();
}
void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &groupId)
void ActionContainerPrivate::addMenu(ActionContainer *menu, const Id &groupId)
{
ActionContainerPrivate *containerPrivate = static_cast<ActionContainerPrivate *>(menu);
if (!containerPrivate->canBeAddedToMenu())
return;
MenuActionContainer *container = static_cast<MenuActionContainer *>(containerPrivate);
QString actualGroupId;
if (groupId.isEmpty())
actualGroupId = QLatin1String(Constants::G_DEFAULT_TWO);
else
actualGroupId = groupId;
MenuActionContainer *container = static_cast<MenuActionContainer *>(containerPrivate);
const Id actualGroupId = groupId.isValid() ? groupId : Id(Constants::G_DEFAULT_TWO);
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
QTC_ASSERT(groupIt != m_groups.constEnd(), return);
QAction *beforeAction = insertLocation(groupIt);
......@@ -273,19 +263,14 @@ void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &group
scheduleUpdate();
}
void ActionContainerPrivate::addMenu(ActionContainer *before, ActionContainer *menu, const QString &groupId)
void ActionContainerPrivate::addMenu(ActionContainer *before, ActionContainer *menu, const Id &groupId)
{
ActionContainerPrivate *containerPrivate = static_cast<ActionContainerPrivate *>(menu);
if (!containerPrivate->canBeAddedToMenu())
return;
MenuActionContainer *container = static_cast<MenuActionContainer *>(containerPrivate);
QString actualGroupId;
if (groupId.isEmpty())
actualGroupId = QLatin1String(Constants::G_DEFAULT_TWO);
else
actualGroupId = groupId;
MenuActionContainer *container = static_cast<MenuActionContainer *>(containerPrivate);
const Id actualGroupId = groupId.isValid() ? groupId : Id(Constants::G_DEFAULT_TWO);
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
QTC_ASSERT(groupIt != m_groups.constEnd(), return);
QAction *beforeAction = before->menu()->menuAction();
......@@ -328,7 +313,7 @@ void ActionContainerPrivate::itemDestroyed()
}
}
int ActionContainerPrivate::id() const
Id ActionContainerPrivate::id() const
{
return m_id;
}
......@@ -369,7 +354,7 @@ void ActionContainerPrivate::update()
\internal
*/
MenuActionContainer::MenuActionContainer(int id)
MenuActionContainer::MenuActionContainer(Id id)
: ActionContainerPrivate(id), m_menu(0)
{
setOnAllDisabledBehavior(Disable);
......@@ -471,7 +456,7 @@ bool MenuActionContainer::canBeAddedToMenu() const
\internal
*/
MenuBarActionContainer::MenuBarActionContainer(int id)
MenuBarActionContainer::MenuBarActionContainer(Id id)
: ActionContainerPrivate(id), m_menuBar(0)
{
setOnAllDisabledBehavior(Show);
......
......@@ -33,6 +33,8 @@
#ifndef ACTIONCONTAINER_H
#define ACTIONCONTAINER_H
#include "coreplugin/id.h"
#include <QtCore/QObject>
QT_BEGIN_NAMESPACE
......@@ -59,21 +61,20 @@ public:
virtual void setOnAllDisabledBehavior(OnAllDisabledBehavior behavior) = 0;
virtual ActionContainer::OnAllDisabledBehavior onAllDisabledBehavior() const = 0;
virtual int id() const = 0;
virtual Id id() const = 0;
virtual QMenu *menu() const = 0;
virtual QMenuBar *menuBar() const = 0;
virtual QAction *insertLocation(const QString &group) const = 0;
virtual void appendGroup(const QString &group) = 0;
virtual void addAction(Command *action, const QString &group = QString()) = 0;
virtual void addMenu(ActionContainer *menu, const QString &group = QString()) = 0;
virtual void addMenu(ActionContainer *before, ActionContainer *menu, const QString &group = QString()) = 0;
virtual QAction *insertLocation(const Id &group) const = 0;
virtual void appendGroup(const Id &group) = 0;
virtual void addAction(Command *action, const Id &group = Id()) = 0;
virtual void addMenu(ActionContainer *menu, const Id &group = Id()) = 0;
virtual void addMenu(ActionContainer *before, ActionContainer *menu, const Id &group = Id()) = 0;
// clears this menu and submenus from all actions and submenus
// doesn't destroy the submenus and commands, just removes them from their parents
// This clears this menu and submenus from all actions and submenus.
// It does not destroy the submenus and commands, just removes them from their parents.
virtual void clear() = 0;
virtual ~ActionContainer() {}
};
} // namespace Core
......
......@@ -41,9 +41,10 @@
namespace Core {
namespace Internal {
struct Group {
Group(const QString &id) : id(id) {}
QString id;
struct Group
{
Group(const Id &id) : id(id) {}
Id id;
QList<QObject *> items; // Command * or ActionContainer *
};
......@@ -52,20 +53,20 @@ class ActionContainerPrivate : public Core::ActionContainer
Q_OBJECT
public:
ActionContainerPrivate(int id);
virtual ~ActionContainerPrivate() {}
ActionContainerPrivate(Id id);
~ActionContainerPrivate() {}
void setOnAllDisabledBehavior(OnAllDisabledBehavior behavior);
ActionContainer::OnAllDisabledBehavior onAllDisabledBehavior() const;
QAction *insertLocation(const QString &group) const;
void appendGroup(const QString &id);
void addAction(Command *action, const QString &group = QString());
void addMenu(ActionContainer *menu, const QString &group = QString());
void addMenu(ActionContainer *before, ActionContainer *menu, const QString &group = QString());
QAction *insertLocation(const Id &groupId) const;
void appendGroup(const Id &id);
void addAction(Command *action, const Id &group = Id());
void addMenu(ActionContainer *menu, const Id &group = Id());
void addMenu(ActionContainer *before, ActionContainer *menu, const Id &group = Id());
virtual void clear();
int id() const;
Id id() const;
QMenu *menu() const;
QMenuBar *menuBar() const;
......@@ -92,18 +93,18 @@ private slots:
void itemDestroyed();
private:
QList<Group>::const_iterator findGroup(const QString &groupId) const;
QList<Group>::const_iterator findGroup(const Id &groupId) const;
QAction *insertLocation(QList<Group>::const_iterator group) const;
OnAllDisabledBehavior m_onAllDisabledBehavior;
int m_id;
Id m_id;
bool m_updateRequested;
};
class MenuActionContainer : public ActionContainerPrivate
{
public:
MenuActionContainer(int id);
explicit MenuActionContainer(Id id);
void setMenu(QMenu *menu);
QMenu *menu() const;
......@@ -125,7 +126,7 @@ private:
class MenuBarActionContainer : public ActionContainerPrivate
{
public:
MenuBarActionContainer(int id);
explicit MenuBarActionContainer(Id id);
void setMenuBar(QMenuBar *menuBar);
QMenuBar *menuBar() const;
......
......@@ -306,18 +306,17 @@ bool ActionManagerPrivate::hasContext(const Context &context) const
ActionContainer *ActionManagerPrivate::createMenu(const Id &id)
{
const int uid = id.uniqueIdentifier();
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(id);
if (it != m_idContainerMap.constEnd())
return it.value();
QMenu *m = new QMenu(m_mainWnd);
m->setObjectName(id.name());
MenuActionContainer *mc = new MenuActionContainer(uid);
MenuActionContainer *mc = new MenuActionContainer(id);
mc->setMenu(m);
m_idContainerMap.insert(uid, mc);
m_idContainerMap.insert(id, mc);
connect(mc, SIGNAL(destroyed()), this, SLOT(containerDestroyed()));
return mc;
......@@ -325,18 +324,17 @@ ActionContainer *ActionManagerPrivate::createMenu(const Id &id)
ActionContainer *ActionManagerPrivate::createMenuBar(const Id &id)
{
const int uid = id.uniqueIdentifier();
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(id);
if (it != m_idContainerMap.constEnd())
return it.value();
QMenuBar *mb = new QMenuBar; // No parent (System menu bar on Mac OS X)
mb->setObjectName(id.toString());
MenuBarActionContainer *mbc = new MenuBarActionContainer(uid);
MenuBarActionContainer *mbc = new MenuBarActionContainer(id);
mbc->setMenuBar(mb);
m_idContainerMap.insert(uid, mbc);
m_idContainerMap.insert(id, mbc);
connect(mbc, SIGNAL(destroyed()), this, SLOT(containerDestroyed()));
return mbc;
......@@ -392,8 +390,7 @@ Command *ActionManagerPrivate::registerAction(QAction *action, const Id &id, con
Action *ActionManagerPrivate::overridableAction(const Id &id)
{
Action *a = 0;
const int uid = id.uniqueIdentifier();
if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
if (CommandPrivate *c = m_idCmdMap.value(id, 0)) {
a = qobject_cast<Action *>(c);
if (!a) {
qWarning() << "registerAction: id" << id.name()
......@@ -401,8 +398,8 @@ Action *ActionManagerPrivate::overridableAction(const Id &id)
return 0;
}
} else {
a = new Action(uid);
m_idCmdMap.insert(uid, a);
a = new Action(id);
m_idCmdMap.insert(id, a);
m_mainWnd->addAction(a->action());
a->action()->setObjectName(id.toString());
a->action()->setShortcutContext(Qt::ApplicationShortcut);
......@@ -418,8 +415,7 @@ Action *ActionManagerPrivate::overridableAction(const Id &id)
void ActionManagerPrivate::unregisterAction(QAction *action, const Id &id)
{
Action *a = 0;
const int uid = id.uniqueIdentifier();
CommandPrivate *c = m_idCmdMap.value(uid, 0);
CommandPrivate *c = m_idCmdMap.value(id, 0);
QTC_ASSERT(c, return);
a = qobject_cast<Action *>(c);
if (!a) {
......@@ -433,7 +429,7 @@ void ActionManagerPrivate::unregisterAction(QAction *action, const Id &id)
// ActionContainers listen to the commands' destroyed signals
m_mainWnd->removeAction(a->action());
delete a->action();
m_idCmdMap.remove(uid);
m_idCmdMap.remove(id);
delete a;
}
emit commandListChanged();
......@@ -442,8 +438,7 @@ void ActionManagerPrivate::unregisterAction(QAction *action, const Id &id)
Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const Id &id, const Context &context, bool scriptable)
{
Shortcut *sc = 0;
const int uid = id.uniqueIdentifier();
if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
if (CommandPrivate *c = m_idCmdMap.value(id, 0)) {
sc = qobject_cast<Shortcut *>(c);
if (!sc) {
qWarning() << "registerShortcut: id" << id.name()
......@@ -451,8 +446,8 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const Id &i
return c;
}
} else {
sc = new Shortcut(uid);
m_idCmdMap.insert(uid, sc);
sc = new Shortcut(id);
m_idCmdMap.insert(id, sc);
}
if (sc->shortcut()) {
......@@ -482,12 +477,11 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const Id &i
Command *ActionManagerPrivate::command(const Id &id) const
{