Debugger: Fix QML-only debugging on Harmattan

Actually wait for the 'Waiting for debugger on port ' ... message
to appear in the application output before connecting, and also
use the port specified there.

Change-Id: Ib498e5306bc49f2f3d468353b1c5d1ea38a809e6
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Kai Koehne
2012-02-21 15:47:55 +01:00
parent 08786b09a0
commit 742019e301
10 changed files with 82 additions and 27 deletions

View File

@@ -32,7 +32,6 @@
#include "qmladapter.h"
#include "debuggerstartparameters.h"
#include "qscriptdebuggerclient.h"
#include "qmlv8debuggerclient.h"
#include "qmljsprivateapi.h"
@@ -46,6 +45,7 @@
#include <QTimer>
#include <QDebug>
#include <QWeakPointer>
namespace Debugger {
namespace Internal {
@@ -108,23 +108,28 @@ QmlAdapter::~QmlAdapter()
delete d;
}
void QmlAdapter::beginConnection()
void QmlAdapter::beginConnectionTcp(const QString &address, quint16 port)
{
if (d->m_engine.isNull()
|| (d->m_conn && d->m_conn->state() != QAbstractSocket::UnconnectedState))
return;
const DebuggerStartParameters &parameters = d->m_engine.data()->startParameters();
if (parameters.communicationChannel == DebuggerStartParameters::CommunicationChannelUsb) {
const QString &port = parameters.remoteChannel;
showConnectionStatusMessage(tr("Connecting to debug server on %1").arg(port));
d->m_conn->connectToOst(port);
} else {
const QString &address = parameters.qmlServerAddress;
quint16 port = parameters.qmlServerPort;
showConnectionStatusMessage(tr("Connecting to debug server %1:%2").arg(address).arg(QString::number(port)));
d->m_conn->connectToHost(address, port);
}
showConnectionStatusMessage(tr("Connecting to debug server %1:%2").arg(address).arg(
QString::number(port)));
d->m_conn->connectToHost(address, port);
//A timeout to check the connection state
d->m_connectionTimer.start();
}
void QmlAdapter::beginConnectionOst(const QString &channel)
{
if (d->m_engine.isNull()
|| (d->m_conn && d->m_conn->state() != QAbstractSocket::UnconnectedState))
return;
showConnectionStatusMessage(tr("Connecting to debug server on %1").arg(channel));
d->m_conn->connectToOst(channel);
//A timeout to check the connection state
d->m_connectionTimer.start();