summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@rim.com>2012-10-23 10:42:20 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-01 19:29:29 (GMT)
commit3de5c8c3c3a1d22a565b2fefd0c11cd71df2bbf1 (patch)
tree7cd21966b183fa3e0ae2707fe1713d5f8045360c /src
parentbd8122e2bfc362000829761cb321f83aeabbbcdf (diff)
downloadQt-3de5c8c3c3a1d22a565b2fefd0c11cd71df2bbf1.zip
Qt-3de5c8c3c3a1d22a565b2fefd0c11cd71df2bbf1.tar.gz
Qt-3de5c8c3c3a1d22a565b2fefd0c11cd71df2bbf1.tar.bz2
Blackberry bearer plugin: Only Report working interfaces as active
Some interfaces might be connected but not working (e.g. no IP address, no gateway etc.) In practice, this prevents the USB interface (among others) from being reported as active and thus the QNetworkConfigurationManager as being reported as online. We only want Wifi and 3G etc. connections to be reported as online when they are up. (cherry picked from commit b9551c1b47277d58d86a82ce15501663257ed9a1) Change-Id: Ia175d701280db44a08b9535803a94806a5d6f30f Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/bearer/blackberry/qbbengine.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/bearer/blackberry/qbbengine.cpp b/src/plugins/bearer/blackberry/qbbengine.cpp
index 2de69f4..908fecc 100644
--- a/src/plugins/bearer/blackberry/qbbengine.cpp
+++ b/src/plugins/bearer/blackberry/qbbengine.cpp
@@ -330,15 +330,14 @@ void QBBEngine::updateConfiguration(const char *interface)
const QString id = idForName(name);
- const int numberOfIpAddresses = netstatus_interface_get_num_ip_addresses(details);
- const bool isConnected = netstatus_interface_is_connected(details);
const netstatus_interface_type_t type = netstatus_interface_get_type(details);
+ const netstatus_ip_status_t ipStatus = netstatus_interface_get_ip_status(details);
netstatus_free_interface_details(&details);
QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Defined;
- if (isConnected && (numberOfIpAddresses > 0))
+ if (ipStatus == NETSTATUS_IP_STATUS_OK)
state |= QNetworkConfiguration::Active;
QMutexLocker locker(&mutex);