[Telepathy-commits] [telepathy-qt4/master] PendingChannel: expose immutableProperties()

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Feb 10 03:57:01 PST 2009


This allows library users to instantiate their own Channel subclasses
in an efficient way (rather than calling channel(), which will return
a normal Telepathy-Qt4 class), or to process channels without ever making
a proxy for them (which is what a ChannelDispatcher implementation
should do).
---
 TelepathyQt4/Client/pending-channel.cpp |   25 +++++++++++++++++++++++++
 TelepathyQt4/Client/pending-channel.h   |    2 ++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/Client/pending-channel.cpp b/TelepathyQt4/Client/pending-channel.cpp
index 5245462..326514a 100644
--- a/TelepathyQt4/Client/pending-channel.cpp
+++ b/TelepathyQt4/Client/pending-channel.cpp
@@ -203,6 +203,31 @@ uint PendingChannel::handle() const
 }
 
 /**
+ * If this channel request has finished, return the immutable properties of
+ * the resulting channel. Otherwise, return an empty map.
+ *
+ * The keys and values in this map are defined by the Telepathy D-Bus API
+ * 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.
+ * This map should be passed to the constructor of Channel or its subclasses
+ * (such as TextChannel).
+ *
+ * These properties can also be used to process channels in a way that does
+ * not require the creation of a Channel object - for instance, a
+ * ChannelDispatcher implementation should be able to classify and process
+ * channels based on their immutable properties, without needing to create
+ * Channel objects.
+ *
+ * \return A map in which the keys are D-Bus property names and the values
+ *         are the corresponding values.
+ */
+QVariantMap PendingChannel::immutableProperties() const
+{
+    return mPriv->immutableProperties;
+}
+
+/**
  * Returns a newly constructed Channel high-level proxy object associated
  * with the remote channel resulting from the channel request. If isValid()
  * returns <code>false</code>, the request has not (at least yet) completed
diff --git a/TelepathyQt4/Client/pending-channel.h b/TelepathyQt4/Client/pending-channel.h
index 9a23d64..6de1b5a 100644
--- a/TelepathyQt4/Client/pending-channel.h
+++ b/TelepathyQt4/Client/pending-channel.h
@@ -59,6 +59,8 @@ public:
 
     uint handle() const;
 
+    QVariantMap immutableProperties() const;
+
     Channel *channel(QObject *parent = 0) const;
 
 private Q_SLOTS:
-- 
1.5.6.5




More information about the telepathy-commits mailing list