[Telepathy-commits] [telepathy-qt4/master] Add basic accessors to Contact
Olli Salli
olli.salli at collabora.co.uk
Wed Jan 28 06:34:57 PST 2009
---
TelepathyQt4/Client/contact.cpp | 18 ++++++++++++++++++
TelepathyQt4/Client/contact.h | 5 +++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/TelepathyQt4/Client/contact.cpp b/TelepathyQt4/Client/contact.cpp
index eb978b2..1e7956e 100644
--- a/TelepathyQt4/Client/contact.cpp
+++ b/TelepathyQt4/Client/contact.cpp
@@ -41,8 +41,24 @@ struct Contact::Private
Connection *connection;
ReferencedHandles handle;
+ QString id;
};
+Connection *Contact::connection() const
+{
+ return mPriv->connection;
+}
+
+ReferencedHandles Contact::handle() const
+{
+ return mPriv->handle;
+}
+
+QString Contact::id() const
+{
+ return mPriv->id;
+}
+
Contact::~Contact()
{
delete mPriv;
@@ -53,6 +69,8 @@ Contact::Contact(Connection *connection, const ReferencedHandles &handle,
: QObject(connection), mPriv(new Private(connection, handle))
{
debug() << this << "initialized with" << attributes.size() << "attributes";
+
+ mPriv->id = qdbus_cast<QString>(attributes["org.freedesktop.Telepathy.Connection/contact-id"]);
}
} // Telepathy::Client
diff --git a/TelepathyQt4/Client/contact.h b/TelepathyQt4/Client/contact.h
index f73397c..4aef2b4 100644
--- a/TelepathyQt4/Client/contact.h
+++ b/TelepathyQt4/Client/contact.h
@@ -48,6 +48,11 @@ public:
};
Q_DECLARE_FLAGS(Features, Feature);
+ Connection *connection() const;
+
+ ReferencedHandles handle() const;
+ QString id() const;
+
~Contact();
private:
--
1.5.6.5
More information about the telepathy-commits
mailing list