Commit db2dc342 authored by hjk's avatar hjk

Analyzer: Simplify IAnalyzerEngine interface

Change-Id: Id5eac0145e04b809bf535087d3bb9a04124c2e87
Reviewed-by: default avatarAurindam Jana <aurindam.jana@digia.com>
Reviewed-by: default avatarChristiaan Janssen <christiaan.janssen@digia.com>
parent 35473d9f
......@@ -32,19 +32,11 @@
namespace Analyzer {
IAnalyzerEngine::IAnalyzerEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
IAnalyzerEngine::IAnalyzerEngine(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
{
m_runConfig = runConfiguration;
m_sp = sp;
m_tool = tool;
}
IAnalyzerEngine::IAnalyzerEngine(IAnalyzerTool *tool,
ProjectExplorer::RunConfiguration *runConfiguration)
{
m_runConfig = runConfiguration;
m_tool = tool;
}
} // namespace Analyzer
......@@ -46,8 +46,6 @@ class RunConfiguration;
namespace Analyzer {
class IAnalyzerTool;
/**
* An IAnalyzerEngine instance handles the launch of an analyzation tool.
*
......@@ -58,9 +56,7 @@ class ANALYZER_EXPORT IAnalyzerEngine : public QObject
Q_OBJECT
public:
IAnalyzerEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration = 0);
IAnalyzerEngine(IAnalyzerTool *tool,
IAnalyzerEngine(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
/// Start analyzation process.
......@@ -79,8 +75,6 @@ public:
/// The start parameters for this engine.
const AnalyzerStartParameters &startParameters() const { return m_sp; }
/// The tool this engine is associated with.
IAnalyzerTool *tool() const { return m_tool; }
StartMode mode() const { return m_sp.startMode; }
virtual void notifyRemoteSetupDone(quint16) {}
......@@ -104,7 +98,6 @@ signals:
private:
ProjectExplorer::RunConfiguration *m_runConfig;
AnalyzerStartParameters m_sp;
IAnalyzerTool *m_tool;
};
} // namespace Analyzer
......
......@@ -77,10 +77,9 @@ public:
// QmlProfilerEngine
//
QmlProfilerEngine::QmlProfilerEngine(IAnalyzerTool *tool,
const Analyzer::AnalyzerStartParameters &sp,
QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
: IAnalyzerEngine(tool, sp, runConfiguration)
: IAnalyzerEngine(sp, runConfiguration)
, d(new QmlProfilerEnginePrivate(sp))
{
d->m_profilerState = 0;
......
......@@ -30,8 +30,9 @@
#ifndef QMLPROFILERENGINE_H
#define QMLPROFILERENGINE_H
#include <analyzerbase/ianalyzerengine.h>
#include "qmlprofilerstatemanager.h"
#include <analyzerbase/ianalyzerengine.h>
#include <utils/outputformat.h>
namespace QmlProfiler {
......@@ -42,8 +43,7 @@ class QmlProfilerEngine : public Analyzer::IAnalyzerEngine
Q_OBJECT
public:
QmlProfilerEngine(Analyzer::IAnalyzerTool *tool,
const Analyzer::AnalyzerStartParameters &sp,
QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
~QmlProfilerEngine();
......
......@@ -223,7 +223,7 @@ IAnalyzerTool::ToolMode QmlProfilerTool::toolMode() const
IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
{
QmlProfilerEngine *engine = new QmlProfilerEngine(this, sp, runConfiguration);
QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration);
engine->registerProfilerStateManager(d->m_profilerState);
......
......@@ -42,9 +42,9 @@ using namespace Analyzer;
using namespace Valgrind;
using namespace Valgrind::Internal;
CallgrindEngine::CallgrindEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
CallgrindEngine::CallgrindEngine(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
: ValgrindEngine(tool, sp, runConfiguration)
: ValgrindEngine(sp, runConfiguration)
, m_markAsPaused(false)
{
connect(&m_runner, SIGNAL(finished()), this, SLOT(slotFinished()));
......
......@@ -43,7 +43,7 @@ class CallgrindEngine : public Valgrind::Internal::ValgrindEngine
Q_OBJECT
public:
CallgrindEngine(Analyzer::IAnalyzerTool *tool, const Analyzer::AnalyzerStartParameters &sp,
CallgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
bool start();
......
......@@ -572,7 +572,7 @@ IAnalyzerEngine *CallgrindTool::createEngine(const AnalyzerStartParameters &sp,
IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
{
CallgrindEngine *engine = new CallgrindEngine(q, sp, runConfiguration);
CallgrindEngine *engine = new CallgrindEngine(sp, runConfiguration);
connect(engine, SIGNAL(parserDataReady(CallgrindEngine*)),
SLOT(takeParserData(CallgrindEngine*)));
......
......@@ -45,9 +45,9 @@ using namespace Valgrind::XmlProtocol;
namespace Valgrind {
namespace Internal {
MemcheckEngine::MemcheckEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
MemcheckEngine::MemcheckEngine(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
: ValgrindEngine(tool, sp, runConfiguration)
: ValgrindEngine(sp, runConfiguration)
{
connect(&m_parser, SIGNAL(error(Valgrind::XmlProtocol::Error)),
SIGNAL(parserError(Valgrind::XmlProtocol::Error)));
......
......@@ -44,7 +44,7 @@ class MemcheckEngine : public ValgrindEngine
Q_OBJECT
public:
MemcheckEngine(Analyzer::IAnalyzerTool *tool, const Analyzer::AnalyzerStartParameters &sp,
MemcheckEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
bool start();
......
......@@ -451,7 +451,7 @@ IAnalyzerEngine *MemcheckTool::createEngine(const AnalyzerStartParameters &sp,
m_frameFinder->setFiles(runConfiguration ? runConfiguration->target()
->project()->files(Project::AllFiles) : QStringList());
MemcheckEngine *engine = new MemcheckEngine(this, sp, runConfiguration);
MemcheckEngine *engine = new MemcheckEngine(sp, runConfiguration);
connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
this, SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
......
......@@ -53,9 +53,9 @@ namespace Internal {
const int progressMaximum = 1000000;
ValgrindEngine::ValgrindEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
ValgrindEngine::ValgrindEngine(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
: IAnalyzerEngine(tool, sp, runConfiguration),
: IAnalyzerEngine(sp, runConfiguration),
m_settings(0),
m_progress(new QFutureInterface<void>()),
m_progressWatcher(new QFutureWatcher<void>()),
......
......@@ -48,8 +48,7 @@ class ValgrindEngine : public Analyzer::IAnalyzerEngine
Q_OBJECT
public:
ValgrindEngine(Analyzer::IAnalyzerTool *tool,
const Analyzer::AnalyzerStartParameters &sp,
ValgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
~ValgrindEngine();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment