summaryrefslogtreecommitdiff
path: root/libresourceqt/src/resource-set.cpp
diff options
context:
space:
mode:
authorRobert Löfman <rlofman@x201.research.nokia.com>2010-11-18 14:50:40 +0200
committerRobert Löfman <rlofman@x201.research.nokia.com>2010-11-18 14:50:40 +0200
commit05f8fa1ebccab6eb55ccbd8a3921bc7016512749 (patch)
tree93e46f320e838869b5119237ff6fc50014c58ae2 /libresourceqt/src/resource-set.cpp
parent4b949a43b56a2336499c30e2bdc4c1cda8e81a68 (diff)
downloadlibresourceqt-05f8fa1ebccab6eb55ccbd8a3921bc7016512749.tar.gz
Added bool ResourceSet::initAndConnect() so that one can connect without acquiring.
Diffstat (limited to 'libresourceqt/src/resource-set.cpp')
-rw-r--r--libresourceqt/src/resource-set.cpp27
1 files changed, 20 insertions, 7 deletions
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();
}