forked from qt-creator/qt-creator
Analyzer: Use AnalyzerManager for run control creation
Less code. Change-Id: Ic26d291ada7efd05899623738d89c52b4175716c Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
This commit is contained in:
@@ -867,11 +867,17 @@ void AnalyzerManager::handleToolFinished()
|
||||
m_instance->d->handleToolFinished();
|
||||
}
|
||||
|
||||
IAnalyzerTool *AnalyzerManager::toolFromRunMode(RunMode runMode)
|
||||
AnalyzerRunControl *AnalyzerManager::createRunControl(
|
||||
const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
ProjectExplorer::RunMode runMode,
|
||||
QString *errorMessage)
|
||||
{
|
||||
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
|
||||
if (tool->runMode() == runMode)
|
||||
return tool;
|
||||
return tool->createRunControl(sp, runConfiguration);
|
||||
if (errorMessage)
|
||||
*errorMessage = tr("No analyzer tool selected.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,16 +43,17 @@ class QDockWidget;
|
||||
class QAction;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
class FancyMainWindow;
|
||||
}
|
||||
namespace Utils { class FancyMainWindow; }
|
||||
namespace ProjectExplorer { class RunConfiguration; }
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
typedef QList<StartMode> StartModes;
|
||||
|
||||
class IAnalyzerTool;
|
||||
class AnalyzerRunControl;
|
||||
class AnalyzerManagerPrivate;
|
||||
class AnalyzerStartParameters;
|
||||
|
||||
|
||||
// FIXME: Merge with AnalyzerPlugin.
|
||||
@@ -69,7 +70,6 @@ public:
|
||||
|
||||
// Register a tool and initialize it.
|
||||
static void addTool(IAnalyzerTool *tool, const StartModes &mode);
|
||||
static IAnalyzerTool *toolFromRunMode(ProjectExplorer::RunMode runMode);
|
||||
|
||||
// Dockwidgets are registered to the main window.
|
||||
static QDockWidget *createDockWidget(IAnalyzerTool *tool, const QString &title,
|
||||
@@ -97,6 +97,10 @@ public:
|
||||
static void handleToolFinished();
|
||||
static QAction *stopAction();
|
||||
|
||||
static AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode runMode,
|
||||
QString *errorMessage);
|
||||
|
||||
private:
|
||||
friend class AnalyzerManagerPrivate;
|
||||
AnalyzerManagerPrivate *const d;
|
||||
|
||||
Reference in New Issue
Block a user