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>
This commit is contained in:
Ulf Hermann
2016-04-19 16:43:30 +02:00
parent e14238650c
commit 385237dbbd
62 changed files with 239 additions and 187 deletions

View File

@@ -33,6 +33,7 @@
#include <projectexplorer/devicesupport/sshdeviceprocess.h>
#include <projectexplorer/runnables.h>
#include <ssh/sshconnection.h>
#include <utils/port.h>
#include <utils/qtcassert.h>
#include <QApplication>
@@ -66,16 +67,16 @@ class QnxPortsGatheringMethod : public PortsGatheringMethod
"done";
}
QList<int> usedPorts(const QByteArray &output) const
QList<Port> usedPorts(const QByteArray &output) const
{
QList<int> ports;
QList<Port> ports;
QList<QByteArray> portStrings = output.split('\n');
portStrings.removeFirst();
foreach (const QByteArray &portString, portStrings) {
if (portString.isEmpty())
continue;
bool ok;
const int port = portString.toInt(&ok, 16);
const Port port(portString.toInt(&ok, 16));
if (ok) {
if (!ports.contains(port))
ports << port;