aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkos PASZTORY <ext-akos.pasztory@nokia.com>2009-10-27 11:59:37 +0200
committerAkos PASZTORY <ext-akos.pasztory@nokia.com>2009-10-27 11:59:37 +0200
commit67b7dd1ab469691d12887c64c6af8996de99475a (patch)
tree617a2f67f2c830f34c3c7c714f95aa100dc580a2
parent897c2d04e413466efb5b8a342a0f61bc207a679d (diff)
bugfix: handle registry changes without provider additions
-rwxr-xr-xlibcontextsubscriber/customer-tests/subscription/multiprovider2.py2
-rw-r--r--libcontextsubscriber/src/propertyhandle.cpp5
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/provider.h1
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp5
4 files changed, 12 insertions, 1 deletions
diff --git a/libcontextsubscriber/customer-tests/subscription/multiprovider2.py b/libcontextsubscriber/customer-tests/subscription/multiprovider2.py
index 7eb55bbb..70e89a8f 100755
--- a/libcontextsubscriber/customer-tests/subscription/multiprovider2.py
+++ b/libcontextsubscriber/customer-tests/subscription/multiprovider2.py
@@ -35,7 +35,7 @@ class MultiProvider(unittest.TestCase):
except:
pass
- def testMultipleProviders(self):
+ def testMultipleProviders2(self):
"""
Description
This test verifies correct client behavior in the presence
diff --git a/libcontextsubscriber/src/propertyhandle.cpp b/libcontextsubscriber/src/propertyhandle.cpp
index 17ec3761..73a88877 100644
--- a/libcontextsubscriber/src/propertyhandle.cpp
+++ b/libcontextsubscriber/src/propertyhandle.cpp
@@ -152,6 +152,11 @@ void PropertyHandle::updateProvider()
pendingSubscriptions << newprovider;
}
myProviders = newProviders;
+ // If all subscriptions succeeded immediately, then we have to trigger
+ // recomputing the value now. Otherwise we rely on the
+ // subscribeFinished signal.
+ if (subscribeCount > 0 && pendingSubscriptions.empty())
+ onValueChanged();
}
/// Sets \c subscribePending to false.
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/provider.h b/libcontextsubscriber/unit-tests/propertyhandle/provider.h
index 076893e7..15da4f8c 100644
--- a/libcontextsubscriber/unit-tests/propertyhandle/provider.h
+++ b/libcontextsubscriber/unit-tests/propertyhandle/provider.h
@@ -43,6 +43,7 @@ public:
bool subscribe(const QString &key);
void unsubscribe(const QString &key);
TimedValue get(const QString &key) const;
+ void clearValues();
signals:
void subscribeFinished(QString key);
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp b/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp
index 3a9c885d..44f33264 100644
--- a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp
+++ b/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp
@@ -147,6 +147,11 @@ void Provider::unsubscribe(const QString& key)
unsubscribeProviderNames << myName;
}
+void Provider::clearValues()
+{
+ cachedValue = TimedValue(QVariant());
+}
+
void Provider::setValue(const QString &key, const QVariant &value)
{
cachedValue = TimedValue(value);