[telepathy-qt4/master] Connection: Create an empty ConnectionCapabilities object if Requests interface is not supported.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Thu Oct 8 11:10:24 PDT 2009


---
 TelepathyQt4/connection.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/connection.cpp b/TelepathyQt4/connection.cpp
index 229a20d..1c6d26c 100644
--- a/TelepathyQt4/connection.cpp
+++ b/TelepathyQt4/connection.cpp
@@ -928,6 +928,10 @@ void Connection::gotInterfaces(QDBusPendingCallWatcher *watcher)
         if (interfaces().contains(TELEPATHY_INTERFACE_CONNECTION_INTERFACE_REQUESTS)) {
             mPriv->introspectCapabilities();
         } else {
+            // we don't support Requests interface, so let's create an empty
+            // ConnectionCapabilities object
+            mPriv->caps = new ConnectionCapabilities();
+
             mPriv->introspectSelfHandle();
         }
     } else {
@@ -1040,6 +1044,8 @@ void Connection::gotCapabilities(QDBusPendingCallWatcher *watcher)
     } else {
         warning().nospace() << "Getting capabilities failed with " <<
             reply.error().name() << ":" << reply.error().message();
+        // Some error occurred, so let's create an empty
+        // ConnectionCapabilities object
         mPriv->caps = new ConnectionCapabilities();
     }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list