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

@@ -26,6 +26,7 @@
#include "linuxdevicetester.h"
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
#include <utils/port.h>
#include <utils/qtcassert.h>
#include <ssh/sshremoteprocess.h>
#include <ssh/sshconnection.h>
@@ -169,8 +170,8 @@ void GenericLinuxDeviceTester::handlePortListReady()
emit progressMessage(tr("All specified ports are available.") + QLatin1Char('\n'));
} else {
QString portList;
foreach (const int port, d->portsGatherer.usedPorts())
portList += QString::number(port) + QLatin1String(", ");
foreach (const Utils::Port port, d->portsGatherer.usedPorts())
portList += QString::number(port.number()) + QLatin1String(", ");
portList.remove(portList.count() - 2, 2);
emit errorMessage(tr("The following specified ports are currently in use: %1")
.arg(portList) + QLatin1Char('\n'));