diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp index fea6d4451b9..f2d5ccf0960 100644 --- a/src/network/kernel/qnetworkinterface.cpp +++ b/src/network/kernel/qnetworkinterface.cpp @@ -29,8 +29,8 @@ static QList postProcess(QListaddressEntries) { + for (QNetworkInterfacePrivate *iface : list) { + for (QNetworkAddressEntry &address : iface->addressEntries) { if (address.ip().protocol() != QAbstractSocket::IPv4Protocol) continue; @@ -62,11 +62,11 @@ QSharedDataPointer QNetworkInterfaceManager::interface bool ok; uint index = name.toUInt(&ok); - for (const auto &interface : interfaceList) { - if (ok && interface->index == int(index)) - return interface; - else if (interface->name == name) - return interface; + for (const auto &iface : interfaceList) { + if (ok && iface->index == int(index)) + return iface; + else if (iface->name == name) + return iface; } return empty; @@ -75,9 +75,9 @@ QSharedDataPointer QNetworkInterfaceManager::interface QSharedDataPointer QNetworkInterfaceManager::interfaceFromIndex(int index) { const auto interfaceList = allInterfaces(); - for (const auto &interface : interfaceList) { - if (interface->index == index) - return interface; + for (const auto &iface : interfaceList) { + if (iface->index == index) + return iface; } return empty;