Remove not present networks from QNetworkInterface::allInterfaces

Windows 7 accumulates networks over time with the status
"not present". This is so it can remember whether a given network
was a public, home or work network next time you use it.
By default, these networks are not returned when enumerating
network interfaces, but we specified a flag to request all networks.
These networks are generally not useful so use the default behaviour
of not reporting them.

Task-number: QTBUG-18824
Change-Id: I4edc4cea83a0e97a88ac649b7d8af95a8a600b89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Shane Kearns 2012-05-04 11:18:38 +01:00 committed by Qt by Nokia
parent bcc9c50b50
commit 360c481840

View File

@ -146,8 +146,7 @@ static QList<QNetworkInterfacePrivate *> interfaceListingWinXP()
ULONG bufSize = sizeof staticBuf;
const QHash<QHostAddress, QHostAddress> &ipv4netmasks = ipv4Netmasks();
ULONG flags = GAA_FLAG_INCLUDE_ALL_INTERFACES |
GAA_FLAG_INCLUDE_PREFIX |
ULONG flags = GAA_FLAG_INCLUDE_PREFIX |
GAA_FLAG_SKIP_DNS_SERVER |
GAA_FLAG_SKIP_MULTICAST;
ULONG retval = ptrGetAdaptersAddresses(AF_UNSPEC, flags, NULL, pAdapter, &bufSize);