From 935c5e8cc030612fc45dada8fde9bffb266e0be4 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 30 May 2012 13:34:17 +0200 Subject: [PATCH] Examples: do no use message-internal.h https://bugs.freedesktop.org/show_bug.cgi?id=49384 --- examples/cm/echo-message-parts/chan.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/cm/echo-message-parts/chan.c b/examples/cm/echo-message-parts/chan.c index 3d1d853..b37019a 100644 --- a/examples/cm/echo-message-parts/chan.c +++ b/examples/cm/echo-message-parts/chan.c @@ -18,9 +18,6 @@ #include #include -/* FIXME: example code should not be doing this! */ -#include - static void destroyable_iface_init (gpointer iface, gpointer data); static void sms_iface_init (gpointer iface, gpointer data); @@ -416,10 +413,15 @@ sms_get_sms_length (TpSvcChannelInterfaceSMS *self, for (i = 0; i < parts->len; i++) { - tp_g_hash_table_update (g_ptr_array_index (message->parts, i), - g_ptr_array_index (parts, i), - (GBoxedCopyFunc) g_strdup, - (GBoxedCopyFunc) tp_g_value_slice_dup); + GHashTableIter iter; + gpointer key, value; + + tp_message_append_part (message); + g_hash_table_iter_init (&iter, g_ptr_array_index (parts, i)); + while (g_hash_table_iter_next (&iter, &key, &value)) + { + tp_message_set (message, i, key, value); + } } txt = tp_message_to_text (message, NULL); -- 1.7.9.5