forked from qt-creator/qt-creator
ProjectExplorer: use enum instead of QString for run mode
Change-Id: Ia906944a489b09afdea59f74afbf759b4caebe37 Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -518,6 +518,11 @@ Core::Id CallgrindTool::id() const
|
||||
return "Callgrind";
|
||||
}
|
||||
|
||||
ProjectExplorer::RunMode CallgrindTool::runMode() const
|
||||
{
|
||||
return ProjectExplorer::CallgrindRunMode;
|
||||
}
|
||||
|
||||
QString CallgrindTool::displayName() const
|
||||
{
|
||||
return tr("Valgrind Function Profiler");
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
~CallgrindTool();
|
||||
|
||||
Core::Id id() const;
|
||||
ProjectExplorer::RunMode runMode() const;
|
||||
QString displayName() const;
|
||||
QString description() const;
|
||||
ToolMode toolMode() const;
|
||||
|
||||
@@ -290,6 +290,11 @@ Core::Id MemcheckTool::id() const
|
||||
return "Memcheck";
|
||||
}
|
||||
|
||||
ProjectExplorer::RunMode MemcheckTool::runMode() const
|
||||
{
|
||||
return ProjectExplorer::MemcheckRunMode;
|
||||
}
|
||||
|
||||
QString MemcheckTool::displayName() const
|
||||
{
|
||||
return tr("Valgrind Memory Analyzer");
|
||||
|
||||
@@ -94,6 +94,7 @@ public:
|
||||
MemcheckTool(QObject *parent);
|
||||
|
||||
Core::Id id() const;
|
||||
ProjectExplorer::RunMode runMode() const;
|
||||
QString displayName() const;
|
||||
QString description() const;
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ static void startRemoteTool(IAnalyzerTool *tool)
|
||||
//m_currentRunControl = rc;
|
||||
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
||||
|
||||
ProjectExplorerPlugin::instance()->startRunControl(rc, tool->id().toString());
|
||||
ProjectExplorerPlugin::instance()->startRunControl(rc, tool->runMode());
|
||||
}
|
||||
|
||||
void ValgrindPlugin::startValgrindTool(IAnalyzerTool *tool, StartMode mode)
|
||||
|
||||
@@ -49,14 +49,13 @@ ValgrindTool::ValgrindTool(QObject *parent) :
|
||||
{
|
||||
}
|
||||
|
||||
bool ValgrindTool::canRun(ProjectExplorer::RunConfiguration *, const QString &) const
|
||||
bool ValgrindTool::canRun(RunConfiguration *, RunMode mode) const
|
||||
{
|
||||
return true;
|
||||
return mode == runMode();
|
||||
}
|
||||
|
||||
Analyzer::AnalyzerStartParameters ValgrindTool::createStartParameters(
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const
|
||||
RunConfiguration *runConfiguration, RunMode mode) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
|
||||
|
||||
@@ -45,11 +45,11 @@ public:
|
||||
explicit ValgrindTool(QObject *parent);
|
||||
|
||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const;
|
||||
ProjectExplorer::RunMode mode) const;
|
||||
|
||||
Analyzer::AnalyzerStartParameters createStartParameters(
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const;
|
||||
ProjectExplorer::RunMode mode) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user