Change conflicting variable
This commit is contained in:
parent
3d3d641e1c
commit
34f071ed1d
@ -820,19 +820,19 @@ QString MacAddress() {
|
|||||||
|
|
||||||
QString ret;
|
QString ret;
|
||||||
|
|
||||||
for (QNetworkInterface &interface : QNetworkInterface::allInterfaces()) {
|
for (QNetworkInterface &netif : QNetworkInterface::allInterfaces()) {
|
||||||
if (
|
if (
|
||||||
(interface.hardwareAddress() == "00:00:00:00:00:00") ||
|
(netif.hardwareAddress() == "00:00:00:00:00:00") ||
|
||||||
(interface.flags() & QNetworkInterface::IsLoopBack) ||
|
(netif.flags() & QNetworkInterface::IsLoopBack) ||
|
||||||
!(interface.flags() & QNetworkInterface::IsUp) ||
|
!(netif.flags() & QNetworkInterface::IsUp) ||
|
||||||
!(interface.flags() & QNetworkInterface::IsRunning)
|
!(netif.flags() & QNetworkInterface::IsRunning)
|
||||||
) { continue; }
|
) { continue; }
|
||||||
if (ret.isEmpty()
|
if (ret.isEmpty()
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||||
|| interface.type() == QNetworkInterface::Ethernet || interface.type() == QNetworkInterface::Wifi
|
|| netif.type() == QNetworkInterface::Ethernet || netif.type() == QNetworkInterface::Wifi
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
ret = interface.hardwareAddress();
|
ret = netif.hardwareAddress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user