diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-16 19:07:24 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-16 19:07:24 +0000 |
commit | 185c7ce47e3239b3cc6a0eaa9f8c888a9843e992 (patch) | |
tree | b9a5a6c4c8ca5a1fa35ef30b6152b4485da06897 | |
parent | 79ade1ef64a13a962b738fb75ed41398cdbdc47d (diff) | |
download | gnunet-gtk-185c7ce47e3239b3cc6a0eaa9f8c888a9843e992.tar.gz gnunet-gtk-185c7ce47e3239b3cc6a0eaa9f8c888a9843e992.zip |
-fix compiler warning
-rw-r--r-- | contrib/gnunet_fs_gtk_about_window.glade | 2 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-common.c | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/contrib/gnunet_fs_gtk_about_window.glade b/contrib/gnunet_fs_gtk_about_window.glade index 90d118e4..95534b63 100644 --- a/contrib/gnunet_fs_gtk_about_window.glade +++ b/contrib/gnunet_fs_gtk_about_window.glade | |||
@@ -1,6 +1,6 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <interface> | 2 | <interface> |
3 | <requires lib="gtk+" version="2.24"/> | 3 | <requires lib="gtk+" version="2.20"/> |
4 | <!-- interface-naming-policy project-wide --> | 4 | <!-- interface-naming-policy project-wide --> |
5 | <object class="GtkWindow" id="about_window"> | 5 | <object class="GtkWindow" id="about_window"> |
6 | <property name="can_focus">False</property> | 6 | <property name="can_focus">False</property> |
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 | ||