From 4acbb418b1ad093ad848143218a10ee2957db282 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Mon, 27 Sep 2010 17:05:25 +1000 Subject: 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 --- src/plugins/bearer/icd/qnetworksession_impl.cpp | 6 ++---- src/plugins/bearer/icd/qnetworksession_impl.h | 5 ++++- 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 #include +#include #include #include @@ -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, -- cgit v0.12