From 05f8fa1ebccab6eb55ccbd8a3921bc7016512749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6fman?= Date: Thu, 18 Nov 2010 14:50:40 +0200 Subject: Added bool ResourceSet::initAndConnect() so that one can connect without acquiring. --- libresourceqt/src/resource-set.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'libresourceqt/src/resource-set.cpp') diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp index 8b46664..b6885a5 100644 --- a/libresourceqt/src/resource-set.cpp +++ b/libresourceqt/src/resource-set.cpp @@ -228,21 +228,34 @@ Resource * ResourceSet::resource(ResourceType type) const return resourceSet[type]; } -bool ResourceSet::acquire() +bool ResourceSet::initAndConnect() { - if (!initialized) { + if ( !initialized ) + { qDebug("ResourceSet::%s().... initializing...", __FUNCTION__); - pendingAcquire = true; return initialize(); } - if (!resourceEngine->isConnectedToManager()) { + if ( !resourceEngine->isConnectedToManager() ) + { qDebug("ResourceSet::%s().... connecting...", __FUNCTION__); + return resourceEngine->connectToManager(); + } + else + qDebug("ResourceSet::%s(): already connected", __FUNCTION__); + + return true; +} + +bool ResourceSet::acquire() +{ + if ( !initialized || !resourceEngine->isConnectedToManager() ) + { pendingAcquire = true; - resourceEngine->connectToManager(); - return true; + return initAndConnect(); } - else { + else + { qDebug("ResourceSet::%s().... acquiring", __FUNCTION__); return resourceEngine->acquireResources(); } -- cgit v1.2.3 From b723c98d18c4fdec1654ea283e5bfd9ea44dc701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6fman?= Date: Fri, 26 Nov 2010 15:26:32 +0200 Subject: Added connectedToManager() signal --- libresourceqt/src/resource-set.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'libresourceqt/src/resource-set.cpp') diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp index b6885a5..8f26a13 100644 --- a/libresourceqt/src/resource-set.cpp +++ b/libresourceqt/src/resource-set.cpp @@ -322,6 +322,7 @@ void ResourceSet::connectedHandler() qDebug("**************** ResourceSet::%s().... %d", __FUNCTION__, __LINE__); if (resourceEngine->isConnectedToManager()) { qDebug("ResourceSet::%s() Connected to manager!", __FUNCTION__); + emit connectedToManager(); if (pendingAudioProperties) { registerAudioProperties(); -- cgit v1.2.3 From 248ec24e0e776588278053c33bef18be52c489c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6fman?= Date: Wed, 1 Dec 2010 11:51:22 +0200 Subject: Implemented suggestions from reviews. --- libresourceqt/src/resource-set.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libresourceqt/src/resource-set.cpp') diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp index 8f26a13..086401c 100644 --- a/libresourceqt/src/resource-set.cpp +++ b/libresourceqt/src/resource-set.cpp @@ -230,14 +230,12 @@ Resource * ResourceSet::resource(ResourceType type) const bool ResourceSet::initAndConnect() { - if ( !initialized ) - { + if ( !initialized ) { qDebug("ResourceSet::%s().... initializing...", __FUNCTION__); return initialize(); } - if ( !resourceEngine->isConnectedToManager() ) - { + if ( !resourceEngine->isConnectedToManager() ) { qDebug("ResourceSet::%s().... connecting...", __FUNCTION__); return resourceEngine->connectToManager(); } -- cgit v1.2.3