forked from qt-creator/qt-creator
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:
@@ -88,8 +88,8 @@ IosDevice::IosDevice()
|
||||
setDisplayName(IosDevice::name());
|
||||
setDeviceState(DeviceDisconnected);
|
||||
Utils::PortList ports;
|
||||
ports.addRange(Constants::IOS_DEVICE_PORT_START,
|
||||
Constants::IOS_DEVICE_PORT_END);
|
||||
ports.addRange(Utils::Port(Constants::IOS_DEVICE_PORT_START),
|
||||
Utils::Port(Constants::IOS_DEVICE_PORT_END));
|
||||
setFreePorts(ports);
|
||||
}
|
||||
|
||||
@@ -200,12 +200,12 @@ QString IosDevice::osVersion() const
|
||||
return m_extraInfo.value(QLatin1String("osVersion"));
|
||||
}
|
||||
|
||||
quint16 IosDevice::nextPort() const
|
||||
Utils::Port IosDevice::nextPort() const
|
||||
{
|
||||
// use qrand instead?
|
||||
if (++m_lastPort >= Constants::IOS_DEVICE_PORT_END)
|
||||
m_lastPort = Constants::IOS_DEVICE_PORT_START;
|
||||
return m_lastPort;
|
||||
return Utils::Port(m_lastPort);
|
||||
}
|
||||
|
||||
bool IosDevice::canAutoDetectPorts() const
|
||||
|
||||
Reference in New Issue
Block a user