From 385237dbbd5261ff2825e5b054166ae6a225e423 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 19 Apr 2016 16:43:30 +0200 Subject: Use Utils::Port where possible This solves the ambiguity between 0 and -1 being the "invalid" port. Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5 Reviewed-by: hjk --- src/plugins/debugger/qml/qmlengine.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/debugger/qml/qmlengine.cpp') diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index b9691939e5..cdce030c80 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -347,7 +347,7 @@ void QmlEngine::connectionEstablished() notifyEngineRunAndInferiorRunOk(); } -void QmlEngine::tryToConnect(quint16 port) +void QmlEngine::tryToConnect(Utils::Port port) { showMessage(QLatin1String("QML Debugger: No application output received in time, trying to connect ..."), LogStatus); d->retryOnConnectFail = true; @@ -366,7 +366,7 @@ void QmlEngine::tryToConnect(quint16 port) } } -void QmlEngine::beginConnection(quint16 port) +void QmlEngine::beginConnection(Utils::Port port) { d->noDebugOutputTimer.stop(); @@ -391,13 +391,13 @@ void QmlEngine::beginConnection(quint16 port) * the connection will be closed again (instead of returning the "connection refused" * error that we expect). */ - if (runParameters().qmlServerPort > 0) + if (runParameters().qmlServerPort.isValid()) port = runParameters().qmlServerPort; if (!d->connection || d->connection->isConnected()) return; - d->connection->connectToHost(host, port); + d->connection->connectToHost(host, port.number()); //A timeout to check the connection state d->connectionTimer.start(); @@ -563,7 +563,7 @@ void QmlEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) DebuggerEngine::notifyEngineRemoteSetupFinished(result); if (result.success) { - if (result.qmlServerPort != InvalidPort) + if (result.qmlServerPort.isValid()) runParameters().qmlServerPort = result.qmlServerPort; notifyEngineSetupOk(); @@ -587,7 +587,7 @@ void QmlEngine::notifyEngineRemoteServerRunning(const QByteArray &serverChannel, bool ok = false; quint16 qmlPort = serverChannel.toUInt(&ok); if (ok) - runParameters().qmlServerPort = qmlPort; + runParameters().qmlServerPort = Utils::Port(qmlPort); else qWarning() << tr("QML debugging port not set: Unable to convert %1 to unsigned int.").arg(QString::fromLatin1(serverChannel)); -- cgit v1.2.1