diff options
author | Marja Hassinen <marja.hassinen@nokia.com> | 2011-01-04 12:02:14 +0200 |
---|---|---|
committer | Marja Hassinen <marja.hassinen@nokia.com> | 2011-01-04 12:02:14 +0200 |
commit | 11067c4b107df71de2d22eaa965a736df8787c1f (patch) | |
tree | df0bb54ea97fb1da927aa9384ac5434f914d1d36 | |
parent | 8fe4477f8149db26cedb16155e02185d7c7ae2f1 (diff) |
lcs, properly-block feature: make it possible for the plugin to fail in blockUntilReady.
-rw-r--r-- | libcontextsubscriber/src/provider.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libcontextsubscriber/src/provider.cpp b/libcontextsubscriber/src/provider.cpp index bafad166..7899f4de 100644 --- a/libcontextsubscriber/src/provider.cpp +++ b/libcontextsubscriber/src/provider.cpp @@ -417,12 +417,15 @@ void Provider::blockUntilSubscribed(const QString& key) // When this is called, the plugin waits until it's ready, and emits the // ready() signal (the connection is not queued). As a result, we - // handleSubscribes(). + // handleSubscribes() and that calls subscribe(). Or, the plugin emits + // failed(), we handleSubscribes(), and don't call anything. plugin->blockUntilReady(); - // And tell the plugin to block until the subscription of this key is - // complete. - plugin->blockUntilSubscribed(key); + if (pluginState == READY) { + // And tell the plugin to block until the subscription of this key is + // complete. + plugin->blockUntilSubscribed(key); + } } TimedValue Provider::get(const QString &key) const |