diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk-main_window_open_directory.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_open_directory.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/fs/gnunet-fs-gtk-main_window_open_directory.c b/src/fs/gnunet-fs-gtk-main_window_open_directory.c index 23e71fc6..e614451f 100644 --- a/src/fs/gnunet-fs-gtk-main_window_open_directory.c +++ b/src/fs/gnunet-fs-gtk-main_window_open_directory.c | |||
@@ -67,7 +67,7 @@ add_child (void *cls, const char *filename, const struct GNUNET_FS_Uri *uri, | |||
67 | dmeta = GNUNET_CONTAINER_meta_data_duplicate (meta); | 67 | dmeta = GNUNET_CONTAINER_meta_data_duplicate (meta); |
68 | GNUNET_CONTAINER_meta_data_insert (dmeta, "<user>", | 68 | GNUNET_CONTAINER_meta_data_insert (dmeta, "<user>", |
69 | EXTRACTOR_METATYPE_FILENAME, | 69 | EXTRACTOR_METATYPE_FILENAME, |
70 | EXTRACTOR_METAFORMAT_C_STRING, | 70 | EXTRACTOR_METAFORMAT_UTF8, |
71 | "text/plain", acc->filename, | 71 | "text/plain", acc->filename, |
72 | strlen (acc->filename) + 1); | 72 | strlen (acc->filename) + 1); |
73 | acc->tab = GNUNET_GTK_add_to_uri_tab (&acc->iter, &acc->par, dmeta, NULL); | 73 | acc->tab = GNUNET_GTK_add_to_uri_tab (&acc->iter, &acc->par, dmeta, NULL); |
@@ -91,7 +91,7 @@ GNUNET_GTK_open_directory_dialog_response_cb (GtkDialog *dialog, | |||
91 | { | 91 | { |
92 | GtkBuilder *builder; | 92 | GtkBuilder *builder; |
93 | GtkWidget *ad; | 93 | GtkWidget *ad; |
94 | char *filename; | 94 | char *filename, *filename_utf8; |
95 | struct AddChildContext acc; | 95 | struct AddChildContext acc; |
96 | 96 | ||
97 | builder = GTK_BUILDER (user_data); | 97 | builder = GTK_BUILDER (user_data); |
@@ -105,12 +105,14 @@ GNUNET_GTK_open_directory_dialog_response_cb (GtkDialog *dialog, | |||
105 | return; | 105 | return; |
106 | } | 106 | } |
107 | 107 | ||
108 | filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (ad)); | 108 | filename = GNUNET_GTK_filechooser_get_filename_loc (GTK_FILE_CHOOSER (ad)); |
109 | filename_utf8 = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (ad)); | ||
109 | gtk_widget_destroy (ad); | 110 | gtk_widget_destroy (ad); |
110 | g_object_unref (G_OBJECT (builder)); | 111 | g_object_unref (G_OBJECT (builder)); |
111 | acc.filename = filename; | 112 | acc.filename = filename_utf8; |
112 | acc.ts = NULL; | 113 | acc.ts = NULL; |
113 | GNUNET_FS_GTK_mmap_and_scan (filename, &add_child, &acc); | 114 | GNUNET_FS_GTK_mmap_and_scan (filename, &add_child, &acc); |
115 | g_free (filename_utf8); | ||
114 | g_free (filename); | 116 | g_free (filename); |
115 | } | 117 | } |
116 | 118 | ||