From 0c1c0410ce8c62cb93dc1305bcbab93694353fd0 Mon Sep 17 00:00:00 2001 From: Marja Hassinen Date: Mon, 26 Oct 2009 16:16:31 +0200 Subject: libcontextprovider, protocol change: Fixing the previous fix: safeguards agains emitting firstSubscriber and lastSubscriber signals unnecessarily. --- libcontextprovider/src/propertyprivate.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libcontextprovider/src/propertyprivate.cpp b/libcontextprovider/src/propertyprivate.cpp index fce31811..80c480f6 100644 --- a/libcontextprovider/src/propertyprivate.cpp +++ b/libcontextprovider/src/propertyprivate.cpp @@ -132,14 +132,18 @@ void PropertyPrivate::emitValue() void PropertyPrivate::setSubscribed() { - subscribed = true; - emit firstSubscriberAppeared(key); + if (subscribed == false) { + subscribed = true; + emit firstSubscriberAppeared(key); + } } void PropertyPrivate::setUnsubscribed() { - subscribed = false; - emit lastSubscriberDisappeared(key); + if (subscribed == true) { + subscribed = false; + emit lastSubscriberDisappeared(key); + } } void PropertyPrivate::updateOverheardValue(const QVariantList& v, const quint64& t) -- cgit v1.2.3