DeviceUsedPortsGatherer: Move getNextFreePort() into PortList

Seems more natural place for this function.

Change-Id: I09f6776ce946f623e3a512411bb922841c06a47d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2022-10-14 14:59:54 +02:00
parent 8394bb0a2b
commit 8f9d582c6c
4 changed files with 13 additions and 13 deletions

View File

@@ -168,6 +168,16 @@ Port PortList::getNext()
return next;
}
Port PortList::getNextFreePort(const QList<Port> &usedPorts)
{
while (hasMore()) {
const Port port = getNext();
if (!usedPorts.contains(port))
return port;
}
return {};
}
QString PortList::toString() const
{
QString stringRep;