diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-04-19 16:43:30 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-04-20 11:06:34 +0000 |
commit | 385237dbbd5261ff2825e5b054166ae6a225e423 (patch) | |
tree | 3020c9ec0187a614915d291a6768eb94b0105e7c /src/plugins/debugger/qml/qmlengine.cpp | |
parent | e14238650c841fdb314ded3ec59253beff1514a7 (diff) | |
download | qt-creator-385237dbbd5261ff2825e5b054166ae6a225e423.tar.gz |
Use Utils::Port where possible
This solves the ambiguity between 0 and -1 being the "invalid" port.
Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/plugins/debugger/qml/qmlengine.cpp')
-rw-r--r-- | src/plugins/debugger/qml/qmlengine.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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)); |