[telepathy-qt4/master] ChannelRequest: Do not call account->becomeReady for account received on immutableProperties.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Mon Jun 1 21:41:46 PDT 2009


---
 TelepathyQt4/channel-request.cpp |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/TelepathyQt4/channel-request.cpp b/TelepathyQt4/channel-request.cpp
index 8cb310f..db6a0de 100644
--- a/TelepathyQt4/channel-request.cpp
+++ b/TelepathyQt4/channel-request.cpp
@@ -147,14 +147,12 @@ void ChannelRequest::Private::extractMainProps(const QVariantMap &props)
 {
     interfaces = qdbus_cast<QStringList>(props.value("Interfaces"));
 
-    QDBusObjectPath accountObjectPath = qdbus_cast<QDBusObjectPath>(props.value("Account"));
-    if (!accountObjectPath.path().isEmpty()) {
+    if (!account && props.contains("Account")) {
+        QDBusObjectPath accountObjectPath =
+            qdbus_cast<QDBusObjectPath>(props.value("Account"));
         account = Account::create(
                 TELEPATHY_ACCOUNT_MANAGER_BUS_NAME,
                 accountObjectPath.path());
-        parent->connect(account->becomeReady(),
-                SIGNAL(finished(Tp::PendingOperation *)),
-                SLOT(onAccountReady(Tp::PendingOperation *)));
     }
 
     // FIXME See http://bugs.freedesktop.org/show_bug.cgi?id=21690
@@ -264,6 +262,16 @@ void ChannelRequest::gotMainProperties(QDBusPendingCallWatcher *watcher)
         props = reply.value();
 
         mPriv->extractMainProps(props);
+
+        if (mPriv->account) {
+            connect(mPriv->account->becomeReady(),
+                    SIGNAL(finished(Tp::PendingOperation *)),
+                    SLOT(onAccountReady(Tp::PendingOperation *)));
+        } else {
+            warning() << "Properties.GetAll(ChannelRequest) is missing "
+                "account property, ignoring";
+            mPriv->readinessHelper->setIntrospectCompleted(FeatureCore, true);
+        }
     }
     else {
         mPriv->readinessHelper->setIntrospectCompleted(FeatureCore,
-- 
1.5.6.5




More information about the telepathy-commits mailing list