summaryrefslogtreecommitdiff
path: root/libresourceqt
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
parenta19a377ae930d54beb98dbe1f6171c6d39ddea80 (diff)
downloadlibresourceqt-7bfa856f0673b81d4d0dafd6e02e07f10f07a023.tar.gz
dbus-qeventloop update
Diffstat (limited to 'libresourceqt')
-rw-r--r--libresourceqt/libresourceqt.pro1
-rw-r--r--libresourceqt/src/resource-engine.cpp11
-rw-r--r--libresourceqt/src/resource-engine.h1
3 files changed, 6 insertions, 7 deletions
diff --git a/libresourceqt/libresourceqt.pro b/libresourceqt/libresourceqt.pro
index f2d642c..f8ef8d8 100644
--- a/libresourceqt/libresourceqt.pro
+++ b/libresourceqt/libresourceqt.pro
@@ -28,6 +28,7 @@ MOC_DIR = build
CONFIG += qt link_pkgconfig dll
QT = core
PKGCONFIG += dbus-1 libresource0
+DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT QT_NO_DEBUG_STREAM
# Install directives
headers.files = $${PUBLIC_HEADERS}
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;
}
diff --git a/libresourceqt/src/resource-engine.h b/libresourceqt/src/resource-engine.h
index 897c27e..17768a5 100644
--- a/libresourceqt/src/resource-engine.h
+++ b/libresourceqt/src/resource-engine.h
@@ -61,7 +61,6 @@ private:
bool connected;
ResourceSet *resourceSet;
DBusConnection *dbusConnection;
- DBUSConnectionEventLoop *dbusEngine;
resconn_t *libresourceConnection;
resset_t *libresourceSet;
quint32 requestId;