summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2011-11-11 12:16:20 +0100
committerhjk <qthjk@ovi.com>2011-11-15 18:25:19 +0100
commit8e236db9f50b649a35902033550ea7dc692cbe99 (patch)
tree6f9582cd85850839b9b1855a38a96d44096c61cb /src/plugins
parentead46746469d1ec095896b617e99edb8f7f13a32 (diff)
downloadqt-creator-8e236db9f50b649a35902033550ea7dc692cbe99.tar.gz
mostly core and analyzer: more id-fication
Change-Id: Ic794fdc6a582f4a03d84b6220c59111044c753b9 Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/analyzerbase/analyzermanager.cpp25
-rw-r--r--src/plugins/analyzerbase/analyzermanager.h5
-rw-r--r--src/plugins/analyzerbase/analyzerruncontrol.cpp2
-rw-r--r--src/plugins/analyzerbase/analyzerstartparameters.h3
-rw-r--r--src/plugins/analyzerbase/ianalyzertool.cpp14
-rw-r--r--src/plugins/analyzerbase/ianalyzertool.h12
-rw-r--r--src/plugins/coreplugin/actionmanager/actioncontainer.cpp61
-rw-r--r--src/plugins/coreplugin/actionmanager/actioncontainer.h19
-rw-r--r--src/plugins/coreplugin/actionmanager/actioncontainer_p.h31
-rw-r--r--src/plugins/coreplugin/actionmanager/actionmanager.cpp80
-rw-r--r--src/plugins/coreplugin/actionmanager/actionmanager_p.h27
-rw-r--r--src/plugins/coreplugin/actionmanager/command.cpp13
-rw-r--r--src/plugins/coreplugin/actionmanager/command.h6
-rw-r--r--src/plugins/coreplugin/actionmanager/command_p.h14
-rw-r--r--src/plugins/coreplugin/actionmanager/commandsfile.cpp2
-rw-r--r--src/plugins/coreplugin/dialogs/shortcutsettings.cpp6
-rw-r--r--src/plugins/designer/formeditorw.cpp4
-rw-r--r--src/plugins/fakevim/fakevimplugin.cpp2
-rw-r--r--src/plugins/macros/actionmacrohandler.cpp2
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.cpp6
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.h2
-rw-r--r--src/plugins/valgrind/callgrindtool.cpp2
-rw-r--r--src/plugins/valgrind/callgrindtool.h2
-rw-r--r--src/plugins/valgrind/memchecktool.cpp2
-rw-r--r--src/plugins/valgrind/memchecktool.h2
-rw-r--r--src/plugins/valgrind/valgrindplugin.cpp4
28 files changed, 151 insertions, 201 deletions
diff --git a/src/plugins/analyzerbase/analyzermanager.cpp b/src/plugins/analyzerbase/analyzermanager.cpp
index 9b40ed6170..1e8d323849 100644
--- a/src/plugins/analyzerbase/analyzermanager.cpp
+++ b/src/plugins/analyzerbase/analyzermanager.cpp
@@ -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;
}
diff --git a/src/plugins/analyzerbase/analyzermanager.h b/src/plugins/analyzerbase/analyzermanager.h
index 680fca3096..18dc956605 100644
--- a/src/plugins/analyzerbase/analyzermanager.h
+++ b/src/plugins/analyzerbase/analyzermanager.h
@@ -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,
diff --git a/src/plugins/analyzerbase/analyzerruncontrol.cpp b/src/plugins/analyzerbase/analyzerruncontrol.cpp
index 7dc5836b58..d2ab127485 100644
--- a/src/plugins/analyzerbase/analyzerruncontrol.cpp
+++ b/src/plugins/analyzerbase/analyzerruncontrol.cpp
@@ -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);
diff --git a/src/plugins/analyzerbase/analyzerstartparameters.h b/src/plugins/analyzerbase/analyzerstartparameters.h
index c398dba172..ff0cc60a1d 100644
--- a/src/plugins/analyzerbase/analyzerstartparameters.h
+++ b/src/plugins/analyzerbase/analyzerstartparameters.h
@@ -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;
diff --git a/src/plugins/analyzerbase/ianalyzertool.cpp b/src/plugins/analyzerbase/ianalyzertool.cpp
index 21117f41dc..96ecd64426 100644
--- a/src/plugins/analyzerbase/ianalyzertool.cpp
+++ b/src/plugins/analyzerbase/ianalyzertool.cpp
@@ -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)
diff --git a/src/plugins/analyzerbase/ianalyzertool.h b/src/plugins/analyzerbase/ianalyzertool.h
index b5e50d8dce..ed2954373f 100644
--- a/src/plugins/analyzerbase/ianalyzertool.h
+++ b/src/plugins/analyzerbase/ianalyzertool.h
@@ -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.
diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp
index add0cc5b0d..58e1425ef5 100644
--- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp
+++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp
@@ -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);
diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.h b/src/plugins/coreplugin/actionmanager/actioncontainer.h
index 4ea4186b92..bc665e160b 100644
--- a/src/plugins/coreplugin/actionmanager/actioncontainer.h
+++ b/src/plugins/coreplugin/actionmanager/actioncontainer.h
@@ -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
diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h
index 231a790ca2..d46a72f4ed 100644
--- a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h
+++ b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h
@@ -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;
diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
index bc57ea6ca1..cc4de91a0d 100644
--- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp
+++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
@@ -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
{
- const int uid = id.uniqueIdentifier();
- const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
+ const IdCmdMap::const_iterator it = m_idCmdMap.constFind(id);
if (it == m_idCmdMap.constEnd()) {
if (warnAboutFindFailures)
qWarning() << "ActionManagerPrivate::command(): failed to find :"
- << id.name() << '/' << uid;
+ << id.name();
return 0;
}
return it.value();
@@ -495,36 +489,11 @@ Command *ActionManagerPrivate::command(const Id &id) const
ActionContainer *ActionManagerPrivate::actionContainer(const Id &id) const
{
- 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()) {
if (warnAboutFindFailures)
qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :"
- << id.name() << '/' << uid;
- return 0;
- }
- return it.value();
-}
-
-Command *ActionManagerPrivate::command(int uid) const
-{
- const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
- if (it == m_idCmdMap.constEnd()) {
- if (warnAboutFindFailures)
- qWarning() << "ActionManagerPrivate::command(): failed to find :"
- << Id::fromUniqueIdentifier(uid).toString() << '/' << uid;
- return 0;
- }
- return it.value();
-}
-
-ActionContainer *ActionManagerPrivate::actionContainer(int uid) const
-{
- const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
- if (it == m_idContainerMap.constEnd()) {
- if (warnAboutFindFailures)
- qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :"
- << Id::fromUniqueIdentifier(uid).toString() << uid;
+ << id.name();
return 0;
}
return it.value();
@@ -540,9 +509,8 @@ void ActionManagerPrivate::initialize()
const int shortcuts = settings->beginReadArray(QLatin1String(settingsGroup));
for (int i = 0; i < shortcuts; ++i) {
settings->setArrayIndex(i);
- const QString sid = settings->value(QLatin1String(idKey)).toString();
const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString());
- const int id = Id(sid).uniqueIdentifier();
+ const Id id = Id(settings->value(QLatin1String(idKey)).toString());
Command *cmd = command(id);
if (cmd)
@@ -558,13 +526,12 @@ void ActionManagerPrivate::saveSettings(QSettings *settings)
const IdCmdMap::const_iterator cmdcend = m_idCmdMap.constEnd();
for (IdCmdMap::const_iterator j = m_idCmdMap.constBegin(); j != cmdcend; ++j) {
- const int id = j.key();
+ const Id id = j.key();
CommandPrivate *cmd = j.value();
QKeySequence key = cmd->keySequence();
if (key != cmd->defaultKeySequence()) {
- const QString sid = Id::fromUniqueIdentifier(id).toString();
settings->setArrayIndex(count);
- settings->setValue(QLatin1String(idKey), sid);
+ settings->setValue(QLatin1String(idKey), id.toString());
settings->setValue(QLatin1String(sequenceKey), key.toString());
count++;
}
@@ -576,8 +543,7 @@ void ActionManagerPrivate::saveSettings(QSettings *settings)
void ActionManagerPrivate::unregisterShortcut(const Core::Id &id)
{
Shortcut *sc = 0;
- const int uid = id.uniqueIdentifier();
- CommandPrivate *c = m_idCmdMap.value(uid, 0);
+ CommandPrivate *c = m_idCmdMap.value(id, 0);
QTC_ASSERT(c, return);
sc = qobject_cast<Shortcut *>(c);
if (!sc) {
@@ -586,7 +552,7 @@ void ActionManagerPrivate::unregisterShortcut(const Core::Id &id)
return;
}
delete sc->shortcut();
- m_idCmdMap.remove(uid);
+ m_idCmdMap.remove(id);
delete sc;
emit commandListChanged();
}
diff --git a/src/plugins/coreplugin/actionmanager/actionmanager_p.h b/src/plugins/coreplugin/actionmanager/actionmanager_p.h
index dbaf595578..9063997e40 100644
--- a/src/plugins/coreplugin/actionmanager/actionmanager_p.h
+++ b/src/plugins/coreplugin/actionmanager/actionmanager_p.h
@@ -34,8 +34,7 @@
#define ACTIONMANAGERPRIVATE_H
#include <coreplugin/actionmanager/actionmanager.h>
-#include "command_p.h"
-
+#include <coreplugin/actionmanager/command_p.h>
#include <coreplugin/icontext.h>
#include <QtCore/QMap>
@@ -63,31 +62,27 @@ public:
explicit ActionManagerPrivate(MainWindow *mainWnd);
~ActionManagerPrivate();
- void setContext(const Context &context);
static ActionManagerPrivate *instance();
- void saveSettings(QSettings *settings);
-
- QList<Command *> commands() const;
+ void initialize();
+ void setContext(const Context &context);
bool hasContext(int context) const;
- Command *command(int uid) const;
- ActionContainer *actionContainer(int uid) const;
+ void saveSettings(QSettings *settings);
- void initialize();
+ QList<Command *> commands() const;
- //ActionManager Interface
+ Command *command(const Id &id) const;
+ ActionContainer *actionContainer(const Id &id) const;
ActionContainer *createMenu(const Id &id);
ActionContainer *createMenuBar(const Id &id);
Command *registerAction(QAction *action, const Id &id,
- const Context &context, bool scriptable=false);
+ const Context &context, bool scriptable = false);
Command *registerShortcut(QShortcut *shortcut, const Id &id,
- const Context &context, bool scriptable=false);
+ const Context &context, bool scriptable = false);
- Core::Command *command(const Id &id) const;
- Core::ActionContainer *actionContainer(const Id &id) const;
void unregisterAction(QAction *action, const Id &id);
void unregisterShortcut(const Id &id);
@@ -106,10 +101,10 @@ private:
static ActionManagerPrivate *m_instance;
- typedef QHash<int, CommandPrivate *> IdCmdMap;
+ typedef QHash<Core::Id, CommandPrivate *> IdCmdMap;
IdCmdMap m_idCmdMap;
- typedef QHash<int, ActionContainerPrivate *> IdContainerMap;
+ typedef QHash<Core::Id, ActionContainerPrivate *> IdContainerMap;
IdContainerMap m_idContainerMap;
// typedef QMap<int, int> GlobalGroupMap;
diff --git a/src/plugins/coreplugin/actionmanager/command.cpp b/src/plugins/coreplugin/actionmanager/command.cpp
index f03475182f..6138612ac7 100644
--- a/src/plugins/coreplugin/actionmanager/command.cpp
+++ b/src/plugins/coreplugin/actionmanager/command.cpp
@@ -208,6 +208,7 @@
\internal
*/
+using namespace Core;
using namespace Core::Internal;
/*!
@@ -215,7 +216,7 @@ using namespace Core::Internal;
\internal
*/
-CommandPrivate::CommandPrivate(int id)
+CommandPrivate::CommandPrivate(Id id)
: m_attributes(0), m_id(id), m_isKeyInitialized(false)
{
}
@@ -248,7 +249,7 @@ QString CommandPrivate::defaultText() const
return m_defaultText;
}
-int CommandPrivate::id() const
+Id CommandPrivate::id() const
{
return m_id;
}
@@ -295,11 +296,9 @@ QString CommandPrivate::stringWithAppendedShortcut(const QString &str) const
\internal
*/
-Shortcut::Shortcut(int id)
+Shortcut::Shortcut(Id id)
: CommandPrivate(id), m_shortcut(0), m_scriptable(false)
-{
-
-}
+{}
void Shortcut::setShortcut(QShortcut *shortcut)
{
@@ -387,7 +386,7 @@ void Shortcut::setScriptable(bool value)
\class Action
\internal
*/
-Action::Action(int id)
+Action::Action(Id id)
: CommandPrivate(id),
m_action(new Utils::ProxyAction(this)),
m_active(false),
diff --git a/src/plugins/coreplugin/actionmanager/command.h b/src/plugins/coreplugin/actionmanager/command.h
index 58f131ac7f..9e2c25962a 100644
--- a/src/plugins/coreplugin/actionmanager/command.h
+++ b/src/plugins/coreplugin/actionmanager/command.h
@@ -34,6 +34,7 @@
#define COMMAND_H
#include <coreplugin/core_global.h>
+#include <coreplugin/id.h>
#include <QtCore/QObject>
@@ -66,7 +67,7 @@ public:
virtual void setDefaultText(const QString &text) = 0;
virtual QString defaultText() const = 0;
- virtual int id() const = 0;
+ virtual Id id() const = 0;
virtual QAction *action() const = 0;
virtual QShortcut *shortcut() const = 0;
@@ -78,10 +79,7 @@ public:
virtual bool isActive() const = 0;
- virtual ~Command() {}
-
virtual void setKeySequence(const QKeySequence &key) = 0;
-
virtual QString stringWithAppendedShortcut(const QString &str) const = 0;
virtual bool isScriptable() const = 0;
diff --git a/src/plugins/coreplugin/actionmanager/command_p.h b/src/plugins/coreplugin/actionmanager/command_p.h
index b3a499c59c..8c11093f4d 100644
--- a/src/plugins/coreplugin/actionmanager/command_p.h
+++ b/src/plugins/coreplugin/actionmanager/command_p.h
@@ -35,9 +35,11 @@
#include "command.h"
-#include <utils/proxyaction.h>
+#include <coreplugin/id.h>
#include <coreplugin/icontext.h>
+#include <utils/proxyaction.h>
+
#include <QtCore/QList>
#include <QtCore/QMultiMap>
#include <QtCore/QPointer>
@@ -51,7 +53,7 @@ class CommandPrivate : public Core::Command
{
Q_OBJECT
public:
- CommandPrivate(int id);
+ CommandPrivate(Id id);
virtual ~CommandPrivate() {}
void setDefaultKeySequence(const QKeySequence &key);
@@ -62,7 +64,7 @@ public:
void setDefaultText(const QString &text);
QString defaultText() const;
- int id() const;
+ Id id() const;
QAction *action() const;
QShortcut *shortcut() const;
@@ -80,7 +82,7 @@ public:
protected:
Context m_context;
CommandAttributes m_attributes;
- int m_id;
+ Id m_id;
QKeySequence m_defaultKey;
QString m_defaultText;
bool m_isKeyInitialized;
@@ -90,7 +92,7 @@ class Shortcut : public CommandPrivate
{
Q_OBJECT
public:
- Shortcut(int id);
+ Shortcut(Id id);
void setKeySequence(const QKeySequence &key);
QKeySequence keySequence() const;
@@ -121,7 +123,7 @@ class Action : public CommandPrivate
{
Q_OBJECT
public:
- Action(int id);
+ Action(Id id);
void setKeySequence(const QKeySequence &key);
QKeySequence keySequence() const;
diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.cpp b/src/plugins/coreplugin/actionmanager/commandsfile.cpp
index bb37ed9362..5de50138ff 100644
--- a/src/plugins/coreplugin/actionmanager/commandsfile.cpp
+++ b/src/plugins/coreplugin/actionmanager/commandsfile.cpp
@@ -148,7 +148,7 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
QDateTime::currentDateTime().toString(Qt::ISODate)));
w.writeStartElement(ctx.mappingElement);
foreach (const ShortcutItem *item, items) {
- const Id id = Id::fromUniqueIdentifier(item->m_cmd->id());
+ const Id id = item->m_cmd->id();
if (item->m_key.isEmpty()) {
w.writeEmptyElement(ctx.shortCutElement);
w.writeAttribute(ctx.idAttribute, id.toString());
diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp
index f7d6610618..be517c6628 100644
--- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp
+++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp
@@ -227,7 +227,7 @@ void ShortcutSettings::importAction()
QMap<QString, QKeySequence> mapping = cf.importCommands();
foreach (ShortcutItem *item, m_scitems) {
- QString sid = Id::fromUniqueIdentifier(item->m_cmd->id()).toString();
+ QString sid = item->m_cmd->id().toString();
if (mapping.contains(sid)) {
item->m_key = mapping.value(sid);
item->m_item->setText(2, item->m_key);
@@ -307,10 +307,10 @@ void ShortcutSettings::initialize()
s->m_cmd = c;
s->m_item = item;
- const QString identifier = Id::fromUniqueIdentifier(c->id()).toString();
+ const QString identifier = c->id().toString();
int pos = identifier.indexOf(QLatin1Char('.'));
const QString section = identifier.left(pos);
- const QString subId = identifier.mid(pos+1);
+ const QString subId = identifier.mid(pos + 1);
if (!sections.contains(section)) {
QTreeWidgetItem *categoryItem = new QTreeWidgetItem(commandList(), QStringList() << section);
QFont f = categoryItem->font(0);
diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp
index ad52eef0b0..f11fef7551 100644
--- a/src/plugins/designer/formeditorw.cpp
+++ b/src/plugins/designer/formeditorw.cpp
@@ -132,12 +132,12 @@ static inline QIcon designerIcon(const QString &iconName)
}
// Create a menu separator
-static inline QAction *createSeparator(QObject *parent,
+static QAction *createSeparator(QObject *parent,
Core::ActionManager *am,
const Core::Context &context,
Core::ActionContainer *container,
const Core::Id &id,
- const QString &group = QString())
+ const Core::Id &group = Core::Id())
{
QAction *actSeparator = new QAction(parent);
actSeparator->setSeparator(true);
diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp
index 25cbd9765c..fc714fe962 100644
--- a/src/plugins/fakevim/fakevimplugin.cpp
+++ b/src/plugins/fakevim/fakevimplugin.cpp
@@ -390,7 +390,7 @@ void FakeVimExCommandsPage::initialize()
continue;
QTreeWidgetItem *item = new QTreeWidgetItem;
- const QString name = Id::fromUniqueIdentifier(c->id()).toString();
+ const QString name = c->id().toString();
const int pos = name.indexOf(QLatin1Char('.'));
const QString section = name.left(pos);
const QString subId = name.mid(pos + 1);
diff --git a/src/plugins/macros/actionmacrohandler.cpp b/src/plugins/macros/actionmacrohandler.cpp
index b0d630e1e5..8253527b55 100644
--- a/src/plugins/macros/actionmacrohandler.cpp
+++ b/src/plugins/macros/actionmacrohandler.cpp
@@ -73,7 +73,7 @@ ActionMacroHandler::ActionMacroHandler():
QList<Core::Command *> commands = am->commands();
foreach (Core::Command *command, commands) {
if (command->isScriptable()) {
- QString id = Core::Id::fromUniqueIdentifier(command->id()).toString();
+ QString id = command->id().toString();
registerCommand(id);
}
}
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 3de34a2047..9f30d58c3a 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -870,7 +870,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_projectTreeCollapseAllAction = new QAction(tr("Collapse All"), this);
cmd = am->registerAction(d->m_projectTreeCollapseAllAction, Constants::PROJECTTREE_COLLAPSE_ALL,
projecTreeContext);
- const QString treeGroup = QLatin1String(Constants::G_PROJECT_TREE);
+ const Core::Id treeGroup = Constants::G_PROJECT_TREE;
mfileContextMenu->addAction(treeSpacer, treeGroup);
mfileContextMenu->addAction(cmd, treeGroup);
msubProjectContextMenu->addAction(treeSpacer, treeGroup);
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp
index 8ccdf1a199..d9b43c4cc0 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp
@@ -126,7 +126,7 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat
QTC_ASSERT(false, return 0);
}
- IAnalyzerTool *tool = AnalyzerManager::toolFromId(mode.toLatin1());
+ IAnalyzerTool *tool = AnalyzerManager::toolFromId(Core::Id(mode));
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
return rc;
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index ca7a87260e..a676fd1a83 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -150,7 +150,7 @@ QmlProfilerTool::~QmlProfilerTool()
delete d;
}
-QByteArray QmlProfilerTool::id() const
+Core::Id QmlProfilerTool::id() const
{
return "QmlProfiler";
}
@@ -566,7 +566,7 @@ static void startRemoteTool(IAnalyzerTool *tool, StartMode mode)
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, 0);
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
- ProjectExplorerPlugin::instance()->startRunControl(rc, tool->id());
+ ProjectExplorerPlugin::instance()->startRunControl(rc, tool->id().toString());
}
void QmlProfilerTool::tryToConnect()
@@ -657,7 +657,7 @@ void QmlProfilerTool::startTool(StartMode mode)
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
// ### not sure if we're supposed to check if the RunConFiguration isEnabled
Project *pro = pe->startupProject();
- pe->runProject(pro, id());
+ pe->runProject(pro, id().toString());
} else if (mode == StartRemote) {
startRemoteTool(this, mode);
}
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.h b/src/plugins/qmlprofiler/qmlprofilertool.h
index 25c889ba4a..9c90f7f22a 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.h
+++ b/src/plugins/qmlprofiler/qmlprofilertool.h
@@ -51,7 +51,7 @@ public:
explicit QmlProfilerTool(QObject *parent);
~QmlProfilerTool();
- QByteArray id() const;
+ Core::Id id() const;
QString displayName() const;
QString description() const;
ToolMode toolMode() const;
diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp
index 1f33904825..8f12f24df5 100644
--- a/src/plugins/valgrind/callgrindtool.cpp
+++ b/src/plugins/valgrind/callgrindtool.cpp
@@ -513,7 +513,7 @@ CallgrindTool::~CallgrindTool()
delete d;
}
-QByteArray CallgrindTool::id() const
+Core::Id CallgrindTool::id() const
{
return "Callgrind";
}
diff --git a/src/plugins/valgrind/callgrindtool.h b/src/plugins/valgrind/callgrindtool.h
index 95b8b08aad..e6219e8cae 100644
--- a/src/plugins/valgrind/callgrindtool.h
+++ b/src/plugins/valgrind/callgrindtool.h
@@ -48,7 +48,7 @@ public:
CallgrindTool(QObject *parent);
~CallgrindTool();
- QByteArray id() const;
+ Core::Id id() const;
QString displayName() const;
QString description() const;
ToolMode toolMode() const;
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
index bd5c849b51..0bbc6e6521 100644
--- a/src/plugins/valgrind/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -285,7 +285,7 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
m_errorProxyModel->setFilterExternalIssues(memcheckSettings->filterExternalIssues());
}
-QByteArray MemcheckTool::id() const
+Core::Id MemcheckTool::id() const
{
return "Memcheck";
}
diff --git a/src/plugins/valgrind/memchecktool.h b/src/plugins/valgrind/memchecktool.h
index 10689ccbec..5a1dc3fc60 100644
--- a/src/plugins/valgrind/memchecktool.h
+++ b/src/plugins/valgrind/memchecktool.h
@@ -93,7 +93,7 @@ class MemcheckTool : public Analyzer::IAnalyzerTool
public:
MemcheckTool(QObject *parent);
- QByteArray id() const;
+ Core::Id id() const;
QString displayName() const;
QString description() const;
diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp
index b20e555322..f551ff86d6 100644
--- a/src/plugins/valgrind/valgrindplugin.cpp
+++ b/src/plugins/valgrind/valgrindplugin.cpp
@@ -128,7 +128,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
sp.startMode = StartRemote;
}
- IAnalyzerTool *tool = AnalyzerManager::toolFromId(mode.toLatin1());
+ IAnalyzerTool *tool = AnalyzerManager::toolFromId(Core::Id(mode));
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
return rc;
@@ -185,7 +185,7 @@ static void startRemoteTool(IAnalyzerTool *tool, StartMode mode)
//m_currentRunControl = rc;
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
- ProjectExplorerPlugin::instance()->startRunControl(rc, tool->id());
+ ProjectExplorerPlugin::instance()->startRunControl(rc, tool->id().toString());
}
void ValgrindPlugin::startValgrindTool(IAnalyzerTool *tool, StartMode mode)