Commit 9cf063f4 authored by Aurindam Jana's avatar Aurindam Jana
Browse files

AndroidAnalyzeSupport: Notify engine when remote is running



Change-Id: Ia04d7b16d4486be60114c148d118d6c9cb0d583f
Reviewed-by: default avatarChristiaan Janssen <christiaan.janssen@digia.com>
parent ef251dc0
......@@ -84,7 +84,8 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
AndroidAnalyzeSupport::AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig,
AnalyzerRunControl *runControl)
: AndroidRunSupport(runConfig, runControl),
m_engine(0)
m_engine(0),
m_qmlPort(0)
{
if (runControl) {
m_engine = runControl->engine();
......@@ -93,6 +94,8 @@ AndroidAnalyzeSupport::AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig,
m_runner, SLOT(start()));
}
}
connect(&m_outputParser, SIGNAL(waitingForConnectionOnPort(quint16)),
SLOT(remoteIsRunning()));
connect(m_runner, SIGNAL(remoteProcessStarted(int)),
SLOT(handleRemoteProcessStarted(int)));
connect(m_runner, SIGNAL(remoteProcessFinished(QString)),
......@@ -106,16 +109,17 @@ AndroidAnalyzeSupport::AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig,
void AndroidAnalyzeSupport::handleRemoteProcessStarted(int qmlPort)
{
if (m_engine)
m_engine->notifyRemoteSetupDone(qmlPort);
m_qmlPort = qmlPort;
}
void AndroidAnalyzeSupport::handleRemoteOutput(const QByteArray &output)
{
const QString msg = QString::fromUtf8(output);
if (m_engine)
m_engine->logApplicationMessage(QString::fromUtf8(output), Utils::StdOutFormatSameLine);
m_engine->logApplicationMessage(msg, Utils::StdOutFormatSameLine);
else
AndroidRunSupport::handleRemoteOutput(output);
m_outputParser.processOutput(msg);
}
void AndroidAnalyzeSupport::handleRemoteErrorOutput(const QByteArray &output)
......@@ -126,5 +130,11 @@ void AndroidAnalyzeSupport::handleRemoteErrorOutput(const QByteArray &output)
AndroidRunSupport::handleRemoteErrorOutput(output);
}
void AndroidAnalyzeSupport::remoteIsRunning()
{
if (m_engine)
m_engine->notifyRemoteSetupDone(m_qmlPort);
}
} // namespace Internal
} // namespace Android
......@@ -31,6 +31,7 @@
#define ANDROIDANALYZESUPPORT_H
#include "androidrunsupport.h"
#include <qmldebug/qmloutputparser.h>
namespace Analyzer {
class IAnalyzerEngine;
......@@ -62,8 +63,12 @@ private slots:
void handleRemoteOutput(const QByteArray &output);
void handleRemoteErrorOutput(const QByteArray &output);
void remoteIsRunning();
private:
Analyzer::IAnalyzerEngine *m_engine;
QmlDebug::QmlOutputParser m_outputParser;
int m_qmlPort;
};
} // namespace Internal
......
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