summaryrefslogtreecommitdiff
path: root/libresourceqt
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-04-07 14:42:07 +0300
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-04-07 14:42:07 +0300
commitd4cce391f9836996667067771e4ce9ca64d3fb3c (patch)
tree028241780453a25bafc23862bad475aa16cc8ddc /libresourceqt
parenta19a377ae930d54beb98dbe1f6171c6d39ddea80 (diff)
fixed bug #161198
Diffstat (limited to 'libresourceqt')
-rw-r--r--libresourceqt/src/resource-engine.cpp3
-rw-r--r--libresourceqt/src/resource-set.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/libresourceqt/src/resource-engine.cpp b/libresourceqt/src/resource-engine.cpp
index 014d2cc..402c0bf 100644
--- a/libresourceqt/src/resource-engine.cpp
+++ b/libresourceqt/src/resource-engine.cpp
@@ -177,7 +177,8 @@ bool ResourceEngine::connectToManager()
qDebug("ResourceEngine is now connecting...");
libresourceSet = resconn_connect(libresourceConnection, &resourceMessage,
statusCallbackHandler);
-
+ if (libresourceSet == NULL)
+ return NULL;
libresourceSet->userdata = this; //save our context
return true;
}
diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp
index af0a6fc..b7a302b 100644
--- a/libresourceqt/src/resource-set.cpp
+++ b/libresourceqt/src/resource-set.cpp
@@ -58,6 +58,8 @@ void ResourceSet::addResourceObject(Resource *resource)
{
if(resource == NULL)
return;
+ delete resourceSet[resource->type()];
+ resourceSet[resource->type()] = resource;
if (resource->type() == AudioPlaybackType) {
audioResource = static_cast<AudioResource *>(resource);
QObject::connect(audioResource,
@@ -73,8 +75,6 @@ void ResourceSet::addResourceObject(Resource *resource)
registerAudioProperties();
}
}
- delete resourceSet[resource->type()];
- resourceSet[resource->type()] = resource;
}
bool ResourceSet::addResource(ResourceType type)