[telepathy-qt4/master] PendingChannelRequest: Added workaround to work with buggy Qt versions.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Fri Jun 12 08:31:47 PDT 2009


---
 TelepathyQt4/pending-channel-request.cpp |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/TelepathyQt4/pending-channel-request.cpp b/TelepathyQt4/pending-channel-request.cpp
index a3fec59..b625a41 100644
--- a/TelepathyQt4/pending-channel-request.cpp
+++ b/TelepathyQt4/pending-channel-request.cpp
@@ -120,9 +120,17 @@ PendingChannelRequest::PendingChannelRequest(const QDBusConnection &dbusConnecti
                     userActionTime.isNull() ? 0 : userActionTime.toTime_t(),
                     preferredHandler), this);
     }
-    connect(watcher,
-            SIGNAL(finished(QDBusPendingCallWatcher *)),
-            SLOT(onWatcherFinished(QDBusPendingCallWatcher *)));
+
+    // FIXME: This is a Qt bug fixed upstream, should be in the next Qt release.
+    //        We should not need to check watcher->isFinished() here, remove the
+    //        check when a fixed Qt version is released.
+    if (watcher->isFinished()) {
+        onWatcherFinished(watcher);
+    } else {
+        connect(watcher,
+                SIGNAL(finished(QDBusPendingCallWatcher *)),
+                SLOT(onWatcherFinished(QDBusPendingCallWatcher *)));
+    }
 }
 
 /**
-- 
1.5.6.5




More information about the telepathy-commits mailing list