[telepathy-qt4/master] ClientRegistrar: Added observer registration support.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Fri May 15 07:29:37 PDT 2009


---
 TelepathyQt4/client-registrar.cpp |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/TelepathyQt4/client-registrar.cpp b/TelepathyQt4/client-registrar.cpp
index 5029bc9..02d2fae 100644
--- a/TelepathyQt4/client-registrar.cpp
+++ b/TelepathyQt4/client-registrar.cpp
@@ -459,7 +459,6 @@ bool ClientRegistrar::registerClient(const AbstractClientPtr &client,
 
     AbstractClientHandler *handler =
         dynamic_cast<AbstractClientHandler*>(client.data());
-
     if (handler) {
         // export o.f.T.Client.Handler
         new ClientHandlerAdaptor(mPriv->bus, handler, object);
@@ -474,6 +473,15 @@ bool ClientRegistrar::registerClient(const AbstractClientPtr &client,
         }
     }
 
+    AbstractClientObserver *observer =
+        dynamic_cast<AbstractClientObserver*>(client.data());
+    if (observer) {
+        // export o.f.T.Client.Handler
+        new ClientObserverAdaptor(mPriv->bus, observer, object);
+        interfaces.append(
+                QLatin1String("org.freedesktop.Telepathy.Client.Observer"));
+    }
+
     // TODO add more adaptors when they exist
 
     if (interfaces.isEmpty()) {
-- 
1.5.6.5




More information about the telepathy-commits mailing list