forked from qt-creator/qt-creator
Analyzer: Remove IAnalyzerTool::canRun
That's taken care of the run control factories directly now Change-Id: I1cd7470e78a93459bee878f5e32594e7cf339a91 Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
This commit is contained in:
@@ -119,10 +119,6 @@ public:
|
||||
virtual AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0) = 0;
|
||||
|
||||
/// Returns true if the tool can be run
|
||||
virtual bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
ProjectExplorer::RunMode mode) const = 0;
|
||||
|
||||
virtual void startTool(StartMode mode) = 0;
|
||||
|
||||
/// Called when tools gets selected.
|
||||
|
@@ -66,12 +66,9 @@ QmlProfilerRunControlFactory::QmlProfilerRunControlFactory(QObject *parent) :
|
||||
|
||||
bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const
|
||||
{
|
||||
if (mode != QmlProfilerRunMode)
|
||||
return false;
|
||||
IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode);
|
||||
if (tool)
|
||||
return tool->canRun(runConfiguration, mode);
|
||||
return false;
|
||||
return mode == QmlProfilerRunMode
|
||||
&& (qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration)
|
||||
|| qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration));
|
||||
}
|
||||
|
||||
static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration *runConfiguration)
|
||||
|
@@ -266,14 +266,6 @@ AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParamet
|
||||
return engine;
|
||||
}
|
||||
|
||||
bool QmlProfilerTool::canRun(RunConfiguration *runConfiguration, RunMode mode) const
|
||||
{
|
||||
if (qobject_cast<QmlProjectRunConfiguration *>(runConfiguration)
|
||||
|| qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration))
|
||||
return mode == runMode();
|
||||
return false;
|
||||
}
|
||||
|
||||
static QString sysroot(RunConfiguration *runConfig)
|
||||
{
|
||||
QTC_ASSERT(runConfig, return QString());
|
||||
|
@@ -59,9 +59,6 @@ public:
|
||||
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
|
||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
ProjectExplorer::RunMode mode) const;
|
||||
|
||||
QWidget *createWidgets();
|
||||
void startTool(Analyzer::StartMode mode);
|
||||
|
||||
|
@@ -524,11 +524,6 @@ RunMode CallgrindTool::runMode() const
|
||||
return CallgrindRunMode;
|
||||
}
|
||||
|
||||
bool CallgrindTool::canRun(RunConfiguration *, RunMode mode) const
|
||||
{
|
||||
return mode == CallgrindRunMode;
|
||||
}
|
||||
|
||||
QString CallgrindTool::displayName() const
|
||||
{
|
||||
return tr("Valgrind Function Profiler");
|
||||
|
@@ -50,7 +50,6 @@ public:
|
||||
QString displayName() const;
|
||||
QString description() const;
|
||||
ToolMode toolMode() const;
|
||||
bool canRun(ProjectExplorer::RunConfiguration *, ProjectExplorer::RunMode mode) const;
|
||||
|
||||
void extensionsInitialized();
|
||||
|
||||
|
@@ -286,11 +286,6 @@ RunMode MemcheckTool::runMode() const
|
||||
return MemcheckRunMode;
|
||||
}
|
||||
|
||||
bool MemcheckTool::canRun(RunConfiguration *, RunMode mode) const
|
||||
{
|
||||
return mode == MemcheckRunMode;
|
||||
}
|
||||
|
||||
QString MemcheckTool::displayName() const
|
||||
{
|
||||
return tr("Valgrind Memory Analyzer");
|
||||
|
@@ -88,7 +88,6 @@ public:
|
||||
ProjectExplorer::RunMode runMode() const;
|
||||
QString displayName() const;
|
||||
QString description() const;
|
||||
bool canRun(ProjectExplorer::RunConfiguration *, ProjectExplorer::RunMode mode) const;
|
||||
|
||||
// Create the valgrind settings (for all valgrind tools)
|
||||
Analyzer::AbstractAnalyzerSubConfig *createGlobalSettings();
|
||||
|
@@ -61,12 +61,8 @@ ValgrindRunControlFactory::ValgrindRunControlFactory(QObject *parent) :
|
||||
|
||||
bool ValgrindRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const
|
||||
{
|
||||
if (mode != CallgrindRunMode && mode != MemcheckRunMode)
|
||||
return false;
|
||||
IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode);
|
||||
if (tool)
|
||||
return tool->canRun(runConfiguration, mode);
|
||||
return false;
|
||||
Q_UNUSED(runConfiguration);
|
||||
return mode == CallgrindRunMode || mode == MemcheckRunMode;
|
||||
}
|
||||
|
||||
static AnalyzerStartParameters createValgrindStartParameters(RunConfiguration *runConfiguration)
|
||||
|
Reference in New Issue
Block a user