aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk-common.c')
-rw-r--r--src/fs/gnunet-fs-gtk-common.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/fs/gnunet-fs-gtk-common.c b/src/fs/gnunet-fs-gtk-common.c
index 1a250c62..e9c052e6 100644
--- a/src/fs/gnunet-fs-gtk-common.c
+++ b/src/fs/gnunet-fs-gtk-common.c
@@ -48,9 +48,11 @@ GNUNET_FS_GTK_add_meta_data_to_list_store (void *cls, const char *plugin_name,
48 const char *data_mime_type, 48 const char *data_mime_type,
49 const char *data, size_t data_len) 49 const char *data, size_t data_len)
50{ 50{
51 gchar *data_to_insert = NULL;
52 gboolean freedata = FALSE;
53 GtkListStore *ls = GTK_LIST_STORE (cls); 51 GtkListStore *ls = GTK_LIST_STORE (cls);
52 const gchar *data_to_insert = NULL;
53 gchar *free_data = NULL;
54 gsize rd;
55 gsize wr;
54 56
55 if (format == EXTRACTOR_METAFORMAT_UTF8) 57 if (format == EXTRACTOR_METAFORMAT_UTF8)
56 { 58 {
@@ -61,19 +63,17 @@ GNUNET_FS_GTK_add_meta_data_to_list_store (void *cls, const char *plugin_name,
61 } 63 }
62 if (format == EXTRACTOR_METAFORMAT_C_STRING) 64 if (format == EXTRACTOR_METAFORMAT_C_STRING)
63 { 65 {
64 gsize rd, wr; 66 free_data = g_locale_to_utf8 (data, data_len, &rd, &wr, NULL);
65 data_to_insert = g_locale_to_utf8 (data, data_len, &rd, &wr, NULL); 67 data_to_insert = free_data;
66 freedata = TRUE;
67 } 68 }
68 69
69 if (data_to_insert) 70 if (NULL != data_to_insert)
70 {
71 gtk_list_store_insert_with_values (ls, NULL, G_MAXINT, 0, type, 1, format, 71 gtk_list_store_insert_with_values (ls, NULL, G_MAXINT, 0, type, 1, format,
72 2, EXTRACTOR_metatype_to_string (type), 72 2, EXTRACTOR_metatype_to_string (type),
73 3, data_to_insert, -1); 73 3, data_to_insert, -1);
74 if (freedata) 74 if (NULL != free_data)
75 g_free (data_to_insert); 75 g_free (free_data);
76 } 76
77 return 0; 77 return 0;
78} 78}
79 79