diff options
author | Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> | 2010-03-22 03:28:38 (GMT) |
---|---|---|
committer | Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> | 2010-03-22 03:28:38 (GMT) |
commit | 0dff17f1e08f57040f3a156f9f3675024ec59978 (patch) | |
tree | 0b3c47a172b90acfd3582b7f6d04bb9b8d9ff780 /src/plugins/bearer/nativewifi/qnativewifiengine.cpp | |
parent | 1ef014ebae2c28c38c25facd90ba8be71b195195 (diff) | |
parent | dbd293e2579e80756ca7e711ea1f82b9e42c5b92 (diff) | |
download | Qt-0dff17f1e08f57040f3a156f9f3675024ec59978.zip Qt-0dff17f1e08f57040f3a156f9f3675024ec59978.tar.gz Qt-0dff17f1e08f57040f3a156f9f3675024ec59978.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.7
Diffstat (limited to 'src/plugins/bearer/nativewifi/qnativewifiengine.cpp')
-rw-r--r-- | src/plugins/bearer/nativewifi/qnativewifiengine.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp index b6522ad..6c74159 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp @@ -185,6 +185,8 @@ void QNativeWifiEngine::scanComplete() bool changed = false; + ptr->mutex.lock(); + if (!ptr->isValid) { ptr->isValid = true; changed = true; @@ -200,8 +202,13 @@ void QNativeWifiEngine::scanComplete() changed = true; } - if (changed) + ptr->mutex.unlock(); + + if (changed) { + locker.unlock(); emit configurationChanged(ptr); + locker.relock(); + } } else { QNetworkConfigurationPrivatePointer ptr(new QNetworkConfigurationPrivate); @@ -214,7 +221,9 @@ void QNativeWifiEngine::scanComplete() accessPointConfigurations.insert(id, ptr); + locker.unlock(); emit configurationAdded(ptr); + locker.relock(); } } @@ -227,9 +236,12 @@ void QNativeWifiEngine::scanComplete() QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(previous.takeFirst()); + locker.unlock(); emit configurationRemoved(ptr); + locker.relock(); } + locker.unlock(); emit updateCompleted(); } @@ -358,6 +370,7 @@ void QNativeWifiEngine::connectToId(const QString &id) #ifdef BEARER_MANAGEMENT_DEBUG qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result); #endif + locker.unlock(); emit connectionError(id, InterfaceLookupError); return; } @@ -405,7 +418,9 @@ void QNativeWifiEngine::connectToId(const QString &id) #ifdef BEARER_MANAGEMENT_DEBUG qDebug("%s: WlanConnect failed with error %ld\n", __FUNCTION__, result); #endif + locker.unlock(); emit connectionError(id, ConnectError); + locker.relock(); break; } @@ -415,8 +430,10 @@ void QNativeWifiEngine::connectToId(const QString &id) local_WlanFreeMemory(interfaceList); - if (profile.isEmpty()) + if (profile.isEmpty()) { + locker.unlock(); emit connectionError(id, InterfaceLookupError); + } } void QNativeWifiEngine::disconnectFromId(const QString &id) @@ -426,6 +443,7 @@ void QNativeWifiEngine::disconnectFromId(const QString &id) QString interface = getInterfaceFromId(id); if (interface.isEmpty()) { + locker.unlock(); emit connectionError(id, InterfaceLookupError); return; } @@ -446,6 +464,7 @@ void QNativeWifiEngine::disconnectFromId(const QString &id) #ifdef BEARER_MANAGEMENT_DEBUG qDebug("%s: WlanDisconnect failed with error %ld\n", __FUNCTION__, result); #endif + locker.unlock(); emit connectionError(id, DisconnectionError); return; } |