summaryrefslogtreecommitdiff
path: root/libresourceqt/src/resource-set.cpp
diff options
context:
space:
mode:
authorVsevolod Buzinov <ext-vsevolod.buzinov@nokia.com>2010-08-06 11:05:19 +0300
committerVsevolod Buzinov <ext-vsevolod.buzinov@nokia.com>2010-08-06 11:05:19 +0300
commite259ac49bc79329e2b6736eab08f666e3ab87615 (patch)
tree960b2918b883fd1977cf8d5471f9229054b12e77 /libresourceqt/src/resource-set.cpp
parentb4e779fd1d17f25e14520e4904e2b294a7402f7b (diff)
parent68260cf98b7878d8db912450081e8cf5e5b4d5ef (diff)
Merge branch 'master' of ssh://karma.research.nokia.com/u/repositories/libresourceqt
Diffstat (limited to 'libresourceqt/src/resource-set.cpp')
-rw-r--r--libresourceqt/src/resource-set.cpp42
1 files changed, 32 insertions, 10 deletions
diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp
index 8ddb54b..babddfe 100644
--- a/libresourceqt/src/resource-set.cpp
+++ b/libresourceqt/src/resource-set.cpp
@@ -272,18 +272,40 @@ bool ResourceSet::alwaysGetReply()
void ResourceSet::connectedHandler()
{
qDebug("**************** ResourceSet::%s().... %d", __FUNCTION__, __LINE__);
- qDebug("Connected to manager!");
+ if (resourceEngine->isConnectedToManager()) {
+ qDebug("ResourceSet::%s() Connected to manager!", __FUNCTION__);
- if (pendingAudioProperties) {
- registerAudioProperties();
- }
- if (pendingUpdate) {
- resourceEngine->updateResources();
- pendingUpdate = false;
+ if (pendingAudioProperties) {
+ registerAudioProperties();
+ }
+ if (pendingUpdate) {
+ resourceEngine->updateResources();
+ pendingUpdate = false;
+ }
+ if (pendingAcquire) {
+ resourceEngine->acquireResources();
+ pendingAcquire = false;
+ }
}
- if (pendingAcquire) {
- resourceEngine->acquireResources();
- pendingAcquire = false;
+ else { // assuming reconnecting
+ qDebug("ResourceSet::%s() Reconnecting to manager...", __FUNCTION__);
+
+ // first check if we have any acquired resources
+ for (int i = 0; i < NumberOfTypes; i++) {
+ if (resourceSet[i] != NULL) {
+ if (resourceSet[i]->isGranted()) {
+ if (i == AudioPlaybackType) {
+ pendingAudioProperties = true;
+ qDebug("ResourceSet::%s() We have audio", __FUNCTION__);
+ }
+ qDebug("ResourceSet::%s() We have acquired resources. Re-acquire", __FUNCTION__);
+ pendingAcquire = true;
+ resourceSet[i]->unsetGranted();
+ }
+ }
+ }
+ // now reconnect
+ resourceEngine->connectToManager();
}
}