diff options
author | Marja Hassinen <marja.hassinen@nokia.com> | 2010-11-02 14:15:41 +0200 |
---|---|---|
committer | Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> | 2010-11-02 16:59:24 +0200 |
commit | 3f7da00c21b2e6997edd5bfcfe7d3f348116cdf0 (patch) | |
tree | 1c5062d37d31a47961e136c319dda4265237f67c | |
parent | 65d6b3bda8820419da1e6499fe5eb00d9c088ecd (diff) |
Fix: don't wake up if a ValueChanged signal comes for an unsubscribed property.
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | libcontextsubscriber/src/contextkitplugin.cpp | 18 |
2 files changed, 15 insertions, 8 deletions
diff --git a/debian/changelog b/debian/changelog index 90509b6e..9d2a3d4a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,8 @@ contextkit (0.5.19.2~unreleased) unstable; urgency=low - * Replace this version with 0.5.21 (0.5.19.1 and 0.5.20 merged together) - if no more parallel bugfix releases are needed. + * Fixes: NB#200325 - -- Marja Hassinen <marja.hassinen@nokia.com> Mon, 18 Oct 2010 13:03:20 +0300 + -- Marja Hassinen <marja.hassinen@nokia.com> Tue, 02 Nov 2010 14:14:39 +0200 contextkit (0.5.19.1) unstable; urgency=low diff --git a/libcontextsubscriber/src/contextkitplugin.cpp b/libcontextsubscriber/src/contextkitplugin.cpp index b70df7c9..55786d69 100644 --- a/libcontextsubscriber/src/contextkitplugin.cpp +++ b/libcontextsubscriber/src/contextkitplugin.cpp @@ -115,6 +115,7 @@ void ContextKitPlugin::reset() delete(managerInterface); managerInterface = 0; newProtocol = false; + // Disconnect the ValueChanged signal for all keys (object paths) connection->disconnect(busName, "", propertyIName, "ValueChanged", this, SLOT(onNewValueChanged(QList<QVariant>,quint64,QDBusMessage))); } @@ -190,11 +191,6 @@ void ContextKitPlugin::useNewProtocol() { newProtocol = true; - // connect to dbus value changes too! - connection->connect(busName, "", propertyIName, "ValueChanged", - this, SLOT(onNewValueChanged(QList<QVariant>,quint64,QDBusMessage))); - - if (providerListener->isServicePresent() == DBusNameListener::NotPresent) return; @@ -248,6 +244,12 @@ void ContextKitPlugin::newSubscribe(const QString& key) objectPath, propertyIName, "Subscribe")); + + // connect to dbus value changes too, but only for this key + connection->connect(busName, objectPath, propertyIName, "ValueChanged", + this, + SLOT(onNewValueChanged(QList<QVariant>,quint64,QDBusMessage))); + PendingSubscribeWatcher *psw = new PendingSubscribeWatcher(pc, key, this); sconnect(psw, SIGNAL(subscribeFinished(QString)), @@ -275,6 +277,12 @@ void ContextKitPlugin::unsubscribe(QSet<QString> keys) objectPath, propertyIName, "Unsubscribe")); + // disconnect the ValueChanged signal for this key + connection->disconnect(busName, objectPath, + propertyIName, "ValueChanged", + this, + SLOT(onNewValueChanged(QList<QVariant>,quint64,QDBusMessage))); + } else subscriberInterface->unsubscribe(keys); |