[Telepathy-commits] [telepathy-qt4/master] Connection: Added getter and signal (changed) for self handle.
Andre Moreira Magalhaes (andrunko)
andre.magalhaes at collabora.co.uk
Mon Jan 26 09:01:13 PST 2009
---
TelepathyQt4/Client/connection.cpp | 14 ++++++++++++++
TelepathyQt4/Client/connection.h | 3 +++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/TelepathyQt4/Client/connection.cpp b/TelepathyQt4/Client/connection.cpp
index 864b350..3407985 100644
--- a/TelepathyQt4/Client/connection.cpp
+++ b/TelepathyQt4/Client/connection.cpp
@@ -566,6 +566,19 @@ QStringList Connection::interfaces() const
}
/**
+ * Return the handle which represents the user on this connection, which will remain
+ * valid for the lifetime of this connection, or until a change in the user's
+ * identifier is signalled by the selfHandleChanged signal. If the connection is
+ * not yet in the ConnectionStatusConnected state, the value of this property MAY be zero.
+ *
+ * \return Self handle.
+ */
+uint Connection::selfHandle() const
+{
+ return mPriv->selfHandle;
+}
+
+/**
* Return a dictionary of presence statuses valid for use with the new(er)
* Telepathy SimplePresence interface on the remote object.
*
@@ -1511,6 +1524,7 @@ void Connection::onPresenceChanged(const Telepathy::SimpleContactPresences &pres
void Connection::onSelfHandleChanged(uint handle)
{
mPriv->selfHandle = handle;
+ emit selfHandleChanged(handle);
}
}
diff --git a/TelepathyQt4/Client/connection.h b/TelepathyQt4/Client/connection.h
index 6a98c85..640ea98 100644
--- a/TelepathyQt4/Client/connection.h
+++ b/TelepathyQt4/Client/connection.h
@@ -78,6 +78,8 @@ public:
QStringList interfaces() const;
+ uint selfHandle() const;
+
SimpleStatusSpecMap allowedPresenceStatuses() const;
PendingOperation *setSelfPresence(const QString &status, const QString &statusMessage);
Telepathy::SimplePresence selfPresence() const;
@@ -158,6 +160,7 @@ public:
Q_SIGNALS:
void statusChanged(uint newStatus, uint newStatusReason);
+ void selfHandleChanged(uint newHandle);
void selfPresenceChanged(const Telepathy::SimplePresence &newPresence);
protected:
--
1.5.6.5
More information about the Telepathy-commits
mailing list