[telepathy-qt4/master] ChannelRequest: Fix to make ChannelRequest::Properties::GetAll works.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue May 5 11:06:23 PDT 2009


Need to check why this is needed here, see FIXME.
---
 TelepathyQt4/channel-request.cpp |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/TelepathyQt4/channel-request.cpp b/TelepathyQt4/channel-request.cpp
index d902d6b..0f6891a 100644
--- a/TelepathyQt4/channel-request.cpp
+++ b/TelepathyQt4/channel-request.cpp
@@ -118,13 +118,11 @@ void ChannelRequest::Private::introspectMain(ChannelRequest::Private *self)
         Q_ASSERT(self->properties != 0);
     }
 
-    connect(self->baseInterface,
+    self->parent->connect(self->baseInterface,
             SIGNAL(Failed(const QString &, const QString &)),
-            self->parent,
             SIGNAL(failed(const QString &, const QString &)));
-    connect(self->baseInterface,
+    self->parent->connect(self->baseInterface,
             SIGNAL(Succeeded()),
-            self->parent,
             SIGNAL(succeeded()));
 
     debug() << "Calling Properties::GetAll(ChannelRequest)";
@@ -132,9 +130,15 @@ void ChannelRequest::Private::introspectMain(ChannelRequest::Private *self)
         new QDBusPendingCallWatcher(
                 self->properties->GetAll(TELEPATHY_INTERFACE_CHANNEL_REQUEST),
                 self->parent);
-    self->parent->connect(watcher,
-            SIGNAL(finished(QDBusPendingCallWatcher*)),
-            SLOT(gotMainProperties(QDBusPendingCallWatcher*)));
+    // FIXME: check if we need to add this check in all other places, and if
+    //        not, why this is needed here.
+    if (watcher->isFinished()) {
+        self->parent->gotMainProperties(watcher);
+    } else {
+        self->parent->connect(watcher,
+                SIGNAL(finished(QDBusPendingCallWatcher*)),
+                SLOT(gotMainProperties(QDBusPendingCallWatcher*)));
+    }
 }
 
 /**
-- 
1.5.6.5




More information about the telepathy-commits mailing list