[Telepathy-commits] [telepathy-qt4/master] *implemented signal to Account - notifying that the presence has changed

basysKom GmbH (none) basyskom at basysVM02
Thu Feb 5 04:56:02 PST 2009


---
 TelepathyQt4/Prototype/Account.cpp |    8 ++++++++
 TelepathyQt4/Prototype/Account.h   |    3 ++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/TelepathyQt4/Prototype/Account.cpp b/TelepathyQt4/Prototype/Account.cpp
index a85c0bc..d703336 100644
--- a/TelepathyQt4/Prototype/Account.cpp
+++ b/TelepathyQt4/Prototype/Account.cpp
@@ -203,6 +203,14 @@ QString Account::currentPresence()
     {
         return g_offline;
     }
+#if 1
+    disconnect ( connection()->presenceManager(), SIGNAL( signalOwnPresenceUpdated( const TpPrototype::Account* , const Telepathy::SimplePresence& ) ),
+            this, SIGNAL( signalPresenceChanged() ) );
+
+    connect ( connection()->presenceManager(), SIGNAL( signalOwnPresenceUpdated( const TpPrototype::Account* , const Telepathy::SimplePresence& ) ),
+                this, SIGNAL( signalPresenceChanged() ) );
+#endif
+
     return connection()->presenceManager()->currentPresence().status;
 }
 
diff --git a/TelepathyQt4/Prototype/Account.h b/TelepathyQt4/Prototype/Account.h
index 6c049f4..6fa1086 100644
--- a/TelepathyQt4/Prototype/Account.h
+++ b/TelepathyQt4/Prototype/Account.h
@@ -114,6 +114,7 @@ public:
     /**
      * Get the current presence.
      * The presence for the current connection is returned.
+     * Needs to be called befor <b>signalPresenceChanged()</b>will be emitted.
      * @return The current aggregated presence.
      */
     QString currentPresence();
@@ -129,7 +130,7 @@ signals:
     void signalRemoved();
 
     /** Account presence was changed. Signal is emitted after the account changed its presence state.
-     * @todo Implement this..
+     * <b>currentPresence()</b> has to be called before.
      */
     void signalPresenceChanged();
     
-- 
1.5.6.5



More information about the telepathy-commits mailing list