summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/icd
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-09-27 07:05:25 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-09-28 01:54:33 (GMT)
commit4acbb418b1ad093ad848143218a10ee2957db282 (patch)
tree2149ef44b2853d4aa540d1566a17ef5a3ef08f70 /src/plugins/bearer/icd
parent668f1bcdb6e75ad420fd510ec7e264ca87f5c174 (diff)
downloadQt-4acbb418b1ad093ad848143218a10ee2957db282.zip
Qt-4acbb418b1ad093ad848143218a10ee2957db282.tar.gz
Qt-4acbb418b1ad093ad848143218a10ee2957db282.tar.bz2
Connect/Disconnect requests needs to use the same dbus connection to ICD for the refcounting to work in ICD.
Fixes NB#188145 - Network interface doesn't go down after last client disconnects
Diffstat (limited to 'src/plugins/bearer/icd')
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp6
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.h5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index 8013d30..787cc55 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -881,7 +881,6 @@ void QNetworkSessionPrivateImpl::close()
} else if (isOpen) {
if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
// We will not wait any disconnect from icd as it might never come
- Maemo::Icd icd;
#ifdef BEARER_MANAGEMENT_DEBUG
qDebug() << "closing session" << publicConfig.identifier();
#endif
@@ -894,7 +893,7 @@ void QNetworkSessionPrivateImpl::close()
opened = false;
isOpen = false;
- icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
+ m_dbusInterface->call(ICD_DBUS_API_DISCONNECT_REQ, ICD_CONNECTION_FLAG_APPLICATION_EVENT);
startTime = QDateTime();
} else {
opened = false;
@@ -915,7 +914,6 @@ void QNetworkSessionPrivateImpl::stop()
emit QNetworkSessionPrivate::error(lastError);
} else {
if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
- Maemo::Icd icd;
#ifdef BEARER_MANAGEMENT_DEBUG
qDebug() << "stopping session" << publicConfig.identifier();
#endif
@@ -928,7 +926,7 @@ void QNetworkSessionPrivateImpl::stop()
opened = false;
isOpen = false;
- icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
+ m_dbusInterface->call(ICD_DBUS_API_DISCONNECT_REQ, ICD_CONNECTION_FLAG_APPLICATION_EVENT);
startTime = QDateTime();
} else {
opened = false;
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.h b/src/plugins/bearer/icd/qnetworksession_impl.h
index 390e508..a879971 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.h
+++ b/src/plugins/bearer/icd/qnetworksession_impl.h
@@ -58,6 +58,7 @@
#include <QtCore/qdatetime.h>
#include <QtCore/qtimer.h>
+#include <QtCore/quuid.h>
#include <QtDBus/qdbusconnection.h>
#include <QtDBus/qdbusinterface.h>
@@ -98,7 +99,9 @@ public:
m_stopTimer.setSingleShot(true);
connect(&m_stopTimer, SIGNAL(timeout()), this, SLOT(finishStopBySendingClosedSignal()));
- QDBusConnection systemBus = QDBusConnection::systemBus();
+ QDBusConnection systemBus = QDBusConnection::connectToBus(
+ QDBusConnection::SystemBus,
+ QUuid::createUuid().toString());
m_dbusInterface = new QDBusInterface(ICD_DBUS_API_INTERFACE,
ICD_DBUS_API_PATH,