[telepathy-qt4/master] Channel: Added immutableProperties public method.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Wed May 27 07:51:25 PDT 2009


---
 TelepathyQt4/channel.cpp |   27 ++++++++++++++++++++++++---
 TelepathyQt4/channel.h   |    2 ++
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/TelepathyQt4/channel.cpp b/TelepathyQt4/channel.cpp
index a3544ac..960b875 100644
--- a/TelepathyQt4/channel.cpp
+++ b/TelepathyQt4/channel.cpp
@@ -64,7 +64,8 @@ namespace Tp
 
 struct Channel::Private
 {
-    Private(Channel *parent, const ConnectionPtr &connection);
+    Private(Channel *parent, const ConnectionPtr &connection,
+            const QVariantMap &immutableProperties);
     ~Private();
 
     static void introspectMain(Private *self);
@@ -104,6 +105,8 @@ struct Channel::Private
     // channels
     ConnectionPtr connection;
 
+    QVariantMap immutableProperties;
+
     // Optional interface proxies
     Client::ChannelInterfaceGroupInterface *group;
     Client::DBus::PropertiesInterface *properties;
@@ -196,11 +199,13 @@ struct Channel::Private::GroupMembersChangedInfo
     QString message;
 };
 
-Channel::Private::Private(Channel *parent, const ConnectionPtr &connection)
+Channel::Private::Private(Channel *parent, const ConnectionPtr &connection,
+        const QVariantMap &immutableProperties)
     : parent(parent),
       baseInterface(new Client::ChannelInterface(parent->dbusConnection(),
                     parent->busName(), parent->objectPath(), parent)),
       connection(connection),
+      immutableProperties(immutableProperties),
       group(0),
       properties(0),
       readinessHelper(parent->readinessHelper()),
@@ -973,7 +978,7 @@ Channel::Channel(const ConnectionPtr &connection,
             objectPath),
       OptionalInterfaceFactory<Channel>(this),
       ReadyObject(this, FeatureCore),
-      mPriv(new Private(this, connection))
+      mPriv(new Private(this, connection, immutableProperties))
 {
     // FIXME: remember the immutableProperties, and use them to reduce the
     // number of D-Bus calls we need to make (but we should make at least
@@ -999,6 +1004,22 @@ ConnectionPtr Channel::connection() const
 }
 
 /**
+ * Return the immutable properties of the channel.
+ *
+ * The keys and values in this map are defined by the Telepathy D-Bus
+ * specification, or by third-party extensions to that specification.
+ * These are the properties that cannot change over the lifetime of the
+ * channel; they're announced in the result of the request, for efficiency.
+ *
+ * \return A map in which the keys are D-Bus property names and the values
+ *         are the corresponding values.
+ */
+QVariantMap Channel::immutableProperties() const
+{
+    return mPriv->immutableProperties;
+}
+
+/**
  * Return a list of optional interfaces implemented by the remote object.
  *
  * \return D-Bus names of the implemented optional interfaces.
diff --git a/TelepathyQt4/channel.h b/TelepathyQt4/channel.h
index 3d43a59..b791f91 100644
--- a/TelepathyQt4/channel.h
+++ b/TelepathyQt4/channel.h
@@ -66,6 +66,8 @@ public:
 
     ConnectionPtr connection() const;
 
+    QVariantMap immutableProperties() const;
+
     QString channelType() const;
     QStringList interfaces() const;
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list