summaryrefslogtreecommitdiff
path: root/telepathy-glib/dbus-properties-mixin.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2008-09-04 12:08:06 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2008-09-15 18:18:38 +0100
commit1ba488a59ea7e6fea49a24f4538dd05bb8f331e7 (patch)
tree362649a8f1452b42b2c9b5c297ee9d3baf1a34f6 /telepathy-glib/dbus-properties-mixin.c
parentea98be0104e9fcb80a58f2cdcc99ca42e09b55c8 (diff)
downloadtelepathy-glib-1ba488a59ea7e6fea49a24f4538dd05bb8f331e7.tar.gz
Move tp_dbus_properties_mixin_make_properties_hash to the correct file
Diffstat (limited to 'telepathy-glib/dbus-properties-mixin.c')
-rw-r--r--telepathy-glib/dbus-properties-mixin.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/telepathy-glib/dbus-properties-mixin.c b/telepathy-glib/dbus-properties-mixin.c
index df0f3d789..173126099 100644
--- a/telepathy-glib/dbus-properties-mixin.c
+++ b/telepathy-glib/dbus-properties-mixin.c
@@ -752,6 +752,42 @@ tp_dbus_properties_mixin_get (GObject *self,
return TRUE;
}
+
+GHashTable *
+tp_dbus_properties_mixin_make_properties_hash (
+ GObject *object,
+ const gchar *first_interface,
+ const gchar *first_property,
+ ...)
+{
+ va_list ap;
+ GHashTable *table;
+ const gchar *interface, *property;
+
+ table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
+ (GDestroyNotify) tp_g_value_slice_free);
+
+ va_start (ap, first_property);
+
+ for (interface = first_interface, property = first_property;
+ interface != NULL;
+ interface = va_arg (ap, gchar *), property = va_arg (ap, gchar *))
+ {
+ GValue *value = g_slice_new0 (GValue);
+
+ tp_dbus_properties_mixin_get (object, interface, property,
+ value, NULL);
+ /* Fetching our immutable properties had better not fail... */
+ g_assert (G_IS_VALUE (value));
+
+ g_hash_table_insert (table,
+ g_strdup_printf ("%s.%s", interface, property), value);
+ }
+
+ return table;
+}
+
+
static void
_tp_dbus_properties_mixin_get (TpSvcDBusProperties *iface,
const gchar *interface_name,