[Telepathy-commits] [telepathy-mission-control/master] Add methods to set/get a dictionary of properties
Alberto Mardegan
alberto.mardegan at nokia.com
Mon Nov 17 00:05:16 PST 2008
Added two internal methods, to bundle the array of immutable properties to a McdChannel.
---
src/mcd-channel.c | 29 +++++++++++++++++++++++++++++
src/mcd-channel.h | 5 +++++
2 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/src/mcd-channel.c b/src/mcd-channel.c
index 9ca3a3a..9da21ef 100644
--- a/src/mcd-channel.c
+++ b/src/mcd-channel.c
@@ -116,6 +116,8 @@ enum _McdChannelPropertyType
#define DEPRECATED_PROPERTY_WARNING \
g_warning ("%s: property %s is deprecated", G_STRFUNC, pspec->name)
+#define IMMUTABLE_PROPERTIES "immprop"
+
static guint mcd_channel_signals[LAST_SIGNAL] = { 0 };
static void _mcd_channel_release_tp_channel (McdChannel *channel,
@@ -1059,3 +1061,30 @@ mcd_channel_leave (McdChannel *channel, const gchar *message,
#endif
}
+/*
+ * _mcd_channel_set_immutable_properties:
+ * @channel: the #McdChannel.
+ * @properties: a #GHashTable of immutable properties.
+ *
+ * Internal function: assign a hash table of properties to @channel.
+ */
+void
+_mcd_channel_set_immutable_properties (McdChannel *channel,
+ GHashTable *properties)
+{
+ g_object_set_data_full ((GObject *)channel, IMMUTABLE_PROPERTIES,
+ properties, (GDestroyNotify)g_hash_table_destroy);
+}
+
+/*
+ * _mcd_channel_get_immutable_properties:
+ * @channel: the #McdChannel.
+ *
+ * Returns: the #GHashTable of the immutable properties.
+ */
+GHashTable *
+_mcd_channel_get_immutable_properties (McdChannel *channel)
+{
+ return g_object_get_data ((GObject *)channel, IMMUTABLE_PROPERTIES);
+}
+
diff --git a/src/mcd-channel.h b/src/mcd-channel.h
index 3dcb90f..696a2be 100644
--- a/src/mcd-channel.h
+++ b/src/mcd-channel.h
@@ -118,5 +118,10 @@ gboolean mcd_channel_is_missed (McdChannel *channel);
gboolean mcd_channel_leave (McdChannel *channel, const gchar *message,
TpChannelGroupChangeReason reason);
+/* not exported: */
+void _mcd_channel_set_immutable_properties (McdChannel *channel,
+ GHashTable *properties);
+GHashTable *_mcd_channel_get_immutable_properties (McdChannel *channel);
+
G_END_DECLS
#endif /* MCD_CHANNEL_H */
--
1.5.6.5
More information about the Telepathy-commits
mailing list