summaryrefslogtreecommitdiff
path: root/libresourceqt/src/resource-engine.cpp
diff options
context:
space:
mode:
authorMartin Wolf <ext-martin.2.wolf@nokia.com>2010-04-07 13:33:26 +0300
committerMartin Wolf <ext-martin.2.wolf@nokia.com>2010-04-07 13:33:26 +0300
commit7bfa856f0673b81d4d0dafd6e02e07f10f07a023 (patch)
tree309ac66b5cbfe77df701fc9c7a0c7e5a68d147e7 /libresourceqt/src/resource-engine.cpp
parenta19a377ae930d54beb98dbe1f6171c6d39ddea80 (diff)
downloadlibresourceqt-7bfa856f0673b81d4d0dafd6e02e07f10f07a023.tar.gz
dbus-qeventloop update
Diffstat (limited to 'libresourceqt/src/resource-engine.cpp')
-rw-r--r--libresourceqt/src/resource-engine.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/libresourceqt/src/resource-engine.cpp b/libresourceqt/src/resource-engine.cpp
index 014d2cc..38afb64 100644
--- a/libresourceqt/src/resource-engine.cpp
+++ b/libresourceqt/src/resource-engine.cpp
@@ -14,7 +14,7 @@ static void handleAdviceMessage(resmsg_t *msg, resset_t *rs, void *data);
ResourceEngine::ResourceEngine(ResourceSet *resourceSet)
: QObject(resourceSet), connected(false), resourceSet(resourceSet),
- dbusEngine(NULL), libresourceConnection(NULL), libresourceSet(NULL),
+ libresourceConnection(NULL), libresourceSet(NULL),
requestId(0), messageMap(), connectionMode(0)
{
if (resourceSet->alwaysGetReply()) {
@@ -28,7 +28,6 @@ ResourceEngine::ResourceEngine(ResourceSet *resourceSet)
ResourceEngine::~ResourceEngine()
{
- delete dbusEngine;
if (libresourceSet != NULL)
libresourceSet->userdata = NULL;
//need to destroy all libresource structures, but how?
@@ -38,9 +37,6 @@ bool ResourceEngine::initialize()
{
DBusError dbusError;
DBusConnection *dbusConnection;
- dbusEngine = new DBUSConnectionEventLoop;
- if(dbusEngine == NULL)
- return false;
dbus_error_init(&dbusError);
dbusConnection = dbus_bus_get(DBUS_BUS_SESSION, &dbusError);
@@ -50,7 +46,7 @@ bool ResourceEngine::initialize()
return false;
}
dbus_error_free(&dbusError);
- dbusEngine->addConnection(dbusConnection);
+ DBUSConnectionEventLoop::addConnection(dbusConnection);
libresourceConnection = resproto_init(RESPROTO_ROLE_CLIENT, RESPROTO_TRANSPORT_DBUS,
connectionIsUp, dbusConnection);
if (libresourceConnection == NULL) {
@@ -178,6 +174,9 @@ bool ResourceEngine::connectToManager()
libresourceSet = resconn_connect(libresourceConnection, &resourceMessage,
statusCallbackHandler);
+ if (libresourceSet == NULL)
+ return false;
+
libresourceSet->userdata = this; //save our context
return true;
}