[telepathy-qt4/master] Connection: Bind to ConnectionError signal.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue Nov 10 04:37:46 PST 2009


---
 TelepathyQt4/connection.cpp |   10 ++++++++++
 TelepathyQt4/connection.h   |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/connection.cpp b/TelepathyQt4/connection.cpp
index 4588596..752ea62 100644
--- a/TelepathyQt4/connection.cpp
+++ b/TelepathyQt4/connection.cpp
@@ -278,6 +278,9 @@ void Connection::Private::init()
     parent->connect(baseInterface,
                     SIGNAL(StatusChanged(uint, uint)),
                     SLOT(onStatusChanged(uint, uint)));
+    parent->connect(baseInterface,
+                    SIGNAL(ConnectionError(const QString &, const QVariantMap &)),
+                    SLOT(onConnectionError(const QString &, const QVariantMap &)));
 
     debug() << "Calling GetStatus()";
     QDBusPendingCallWatcher *watcher =
@@ -915,6 +918,13 @@ void Connection::onStatusChanged(uint status, uint reason)
     }
 }
 
+void Connection::onConnectionError(const QString &error,
+        const QVariantMap &details)
+{
+    invalidate(error,
+            details.value(QLatin1String("debug-message")).toString());
+}
+
 void Connection::gotStatus(QDBusPendingCallWatcher *watcher)
 {
     QDBusPendingReply<uint> reply = *watcher;
diff --git a/TelepathyQt4/connection.h b/TelepathyQt4/connection.h
index 0d3519b..1cfae64 100644
--- a/TelepathyQt4/connection.h
+++ b/TelepathyQt4/connection.h
@@ -175,6 +175,7 @@ protected:
 private Q_SLOTS:
     void onStatusReady(uint);
     void onStatusChanged(uint, uint);
+    void onConnectionError(const QString &, const QVariantMap &);
     void gotStatus(QDBusPendingCallWatcher *watcher);
     void gotInterfaces(QDBusPendingCallWatcher *watcher);
     void gotContactAttributeInterfaces(QDBusPendingCallWatcher *watcher);
-- 
1.5.6.5




More information about the telepathy-commits mailing list