forked from qt-creator/qt-creator
Analyzer: Merge IAnalyzerEngine and AnalyzerRunControl
Change-Id: I74edaef59600a44924d2692c1ebc7f98d8581115 Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include "androidmanager.h"
|
||||
|
||||
#include <analyzerbase/ianalyzertool.h>
|
||||
#include <analyzerbase/ianalyzerengine.h>
|
||||
#include <analyzerbase/analyzermanager.h>
|
||||
#include <analyzerbase/analyzerruncontrol.h>
|
||||
#include <analyzerbase/analyzerstartparameters.h>
|
||||
@@ -63,6 +62,7 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
|
||||
|
||||
AnalyzerStartParameters params;
|
||||
params.toolId = tool->id();
|
||||
params.runMode = runMode;
|
||||
Target *target = runConfig->target();
|
||||
params.displayName = AndroidManager::packageName(target);
|
||||
params.sysroot = SysRootKitInformation::sysRoot(target->kit()).toString();
|
||||
@@ -76,23 +76,21 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
|
||||
params.startMode = StartQmlRemote;
|
||||
}
|
||||
|
||||
AnalyzerRunControl * const analyzerRunControl = new AnalyzerRunControl(tool, params, runConfig);
|
||||
new AndroidAnalyzeSupport(runConfig, analyzerRunControl);
|
||||
AnalyzerRunControl *analyzerRunControl = tool->createRunControl(params, runConfig);
|
||||
(void) new AndroidAnalyzeSupport(runConfig, analyzerRunControl);
|
||||
return analyzerRunControl;
|
||||
}
|
||||
|
||||
AndroidAnalyzeSupport::AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig,
|
||||
AnalyzerRunControl *runControl)
|
||||
: AndroidRunSupport(runConfig, runControl),
|
||||
m_engine(0),
|
||||
m_runControl(0),
|
||||
m_qmlPort(0)
|
||||
{
|
||||
if (runControl) {
|
||||
m_engine = runControl->engine();
|
||||
if (m_engine) {
|
||||
connect(m_engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
|
||||
m_runner, SLOT(start()));
|
||||
}
|
||||
m_runControl = runControl;
|
||||
connect(m_runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)),
|
||||
m_runner, SLOT(start()));
|
||||
}
|
||||
connect(&m_outputParser, SIGNAL(waitingForConnectionOnPort(quint16)),
|
||||
SLOT(remoteIsRunning()));
|
||||
@@ -115,8 +113,8 @@ void AndroidAnalyzeSupport::handleRemoteProcessStarted(int qmlPort)
|
||||
void AndroidAnalyzeSupport::handleRemoteOutput(const QByteArray &output)
|
||||
{
|
||||
const QString msg = QString::fromUtf8(output);
|
||||
if (m_engine)
|
||||
m_engine->logApplicationMessage(msg, Utils::StdOutFormatSameLine);
|
||||
if (m_runControl)
|
||||
m_runControl->logApplicationMessage(msg, Utils::StdOutFormatSameLine);
|
||||
else
|
||||
AndroidRunSupport::handleRemoteOutput(output);
|
||||
m_outputParser.processOutput(msg);
|
||||
@@ -124,16 +122,16 @@ void AndroidAnalyzeSupport::handleRemoteOutput(const QByteArray &output)
|
||||
|
||||
void AndroidAnalyzeSupport::handleRemoteErrorOutput(const QByteArray &output)
|
||||
{
|
||||
if (m_engine)
|
||||
m_engine->logApplicationMessage(QString::fromUtf8(output), Utils::StdErrFormatSameLine);
|
||||
if (m_runControl)
|
||||
m_runControl->logApplicationMessage(QString::fromUtf8(output), Utils::StdErrFormatSameLine);
|
||||
else
|
||||
AndroidRunSupport::handleRemoteErrorOutput(output);
|
||||
}
|
||||
|
||||
void AndroidAnalyzeSupport::remoteIsRunning()
|
||||
{
|
||||
if (m_engine)
|
||||
m_engine->notifyRemoteSetupDone(m_qmlPort);
|
||||
if (m_runControl)
|
||||
m_runControl->notifyRemoteSetupDone(m_qmlPort);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user