summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/bearer/nativewifi/qnativewifiengine.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
index 952a6a3..b6522ad 100644
--- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
+++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
@@ -111,8 +111,6 @@ void QNativeWifiEngine::scanComplete()
{
QMutexLocker locker(&mutex);
- QStringList previous = accessPointConfigurations.keys();
-
// enumerate interfaces
WLAN_INTERFACE_INFO_LIST *interfaceList;
DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
@@ -120,9 +118,15 @@ void QNativeWifiEngine::scanComplete()
#ifdef BEARER_MANAGEMENT_DEBUG
qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
#endif
+
+ locker.unlock();
+ emit updateCompleted();
+
return;
}
+ QStringList previous = accessPointConfigurations.keys();
+
for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i];
@@ -458,18 +462,31 @@ void QNativeWifiEngine::requestUpdate()
#ifdef BEARER_MANAGEMENT_DEBUG
qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
#endif
+
+ locker.unlock();
+ emit updateCompleted();
+
return;
}
+ bool requested = false;
for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
result = local_WlanScan(handle, &interfaceList->InterfaceInfo[i].InterfaceGuid, 0, 0, 0);
+ if (result != ERROR_SUCCESS) {
#ifdef BEARER_MANAGEMENT_DEBUG
- if (result != ERROR_SUCCESS)
qDebug("%s: WlanScan failed with error %ld\n", __FUNCTION__, result);
#endif
+ } else {
+ requested = true;
+ }
}
local_WlanFreeMemory(interfaceList);
+
+ if (!requested) {
+ locker.unlock();
+ emit updateCompleted();
+ }
}
QNetworkSession::State QNativeWifiEngine::sessionStateForId(const QString &id)