summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer
diff options
context:
space:
mode:
authorMartin Petersson <martin.petersson@nokia.com>2011-04-14 09:04:10 (GMT)
committerMartin Petersson <martin.petersson@nokia.com>2011-04-14 09:04:10 (GMT)
commit2e7e8a2b805b868eade36cc44fa14bf8ca2f8c2f (patch)
tree628addc49c315aa6e70c84eefed3b0d897ad564e /src/plugins/bearer
parent6f1efe75dac53377b92d779818b43a34add92f02 (diff)
downloadQt-2e7e8a2b805b868eade36cc44fa14bf8ca2f8c2f.zip
Qt-2e7e8a2b805b868eade36cc44fa14bf8ca2f8c2f.tar.gz
Qt-2e7e8a2b805b868eade36cc44fa14bf8ca2f8c2f.tar.bz2
QNativeWifiEngine: Fix problem with wifi polling on Windows
On some Windows machines the wifi detection in QNativeWifiEngine::available does not work as WlanOpenHandle still succeed altough there is no WLAN card. So instead we can detect this using the WlanEnumInterfaces in requestUpdate() instead. Task-number: QTBUG-17219 Reviewed-by: Xizhi Zhu
Diffstat (limited to 'src/plugins/bearer')
-rw-r--r--src/plugins/bearer/nativewifi/qnativewifiengine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
index 16c2239..d5beeff 100644
--- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
+++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
@@ -501,6 +501,11 @@ void QNativeWifiEngine::requestUpdate()
return;
}
+ if (interfaceList->dwNumberOfItems == 0) {
+ local_WlanFreeMemory(interfaceList);
+ return;
+ }
+
bool requested = false;
for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
result = local_WlanScan(handle, &interfaceList->InterfaceInfo[i].InterfaceGuid, 0, 0, 0);