diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-30 23:45:36 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-30 23:45:36 +0000 |
commit | 684af0945283ced2830b0533fb22e818713a8a48 (patch) | |
tree | 1fe12cb4ec17e90529f7c332fab613a54f10ca16 | |
parent | 1277a8eb766842c78fe2f8080a304a2ff773faf9 (diff) | |
download | gnunet-gtk-684af0945283ced2830b0533fb22e818713a8a48.tar.gz gnunet-gtk-684af0945283ced2830b0533fb22e818713a8a48.zip |
-LRN: utf8-ize gnunet-gtk - #2049 - remove loc conversion except for extractor, as gnunet core already does it
-rw-r--r-- | src/fs/gnunet-fs-gtk-common.c | 6 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-download.c | 12 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-event_handler.c | 10 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c | 7 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_create_pseudonym.c | 7 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_file_publish.c | 26 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_open_directory.c | 9 |
7 files changed, 21 insertions, 56 deletions
diff --git a/src/fs/gnunet-fs-gtk-common.c b/src/fs/gnunet-fs-gtk-common.c index 4d416849..c4058cd1 100644 --- a/src/fs/gnunet-fs-gtk-common.c +++ b/src/fs/gnunet-fs-gtk-common.c | |||
@@ -60,9 +60,9 @@ GNUNET_FS_GTK_dubious_meta_to_utf8 (enum EXTRACTOR_MetaFormat format, | |||
60 | if (format == EXTRACTOR_METAFORMAT_C_STRING) | 60 | if (format == EXTRACTOR_METAFORMAT_C_STRING) |
61 | { | 61 | { |
62 | if (data_len > 0) | 62 | if (data_len > 0) |
63 | { /* There are no guarantees that data is NULL-terminated, AFAIU, | 63 | { /* There are no guarantees that data is NULL-terminated, AFAIU, |
64 | * so let's play it safe, shall we? | 64 | * so let's play it safe, shall we? |
65 | */ | 65 | */ |
66 | char *data_copy = GNUNET_malloc (data_len + 1); | 66 | char *data_copy = GNUNET_malloc (data_len + 1); |
67 | 67 | ||
68 | memcpy (data_copy, data, data_len); | 68 | memcpy (data_copy, data, data_len); |
diff --git a/src/fs/gnunet-fs-gtk-download.c b/src/fs/gnunet-fs-gtk-download.c index ee6b1927..61b34419 100644 --- a/src/fs/gnunet-fs-gtk-download.c +++ b/src/fs/gnunet-fs-gtk-download.c | |||
@@ -74,7 +74,7 @@ GNUNET_GTK_save_as_dialog_delete_event_cb (GtkWidget * widget, GdkEvent * event, | |||
74 | } | 74 | } |
75 | GNUNET_free_non_null (dc->filename); | 75 | GNUNET_free_non_null (dc->filename); |
76 | dc->filename = | 76 | dc->filename = |
77 | GNUNET_GTK_filechooser_get_filename_loc (GTK_FILE_CHOOSER (dlc->dialog)); | 77 | GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (dlc->dialog)); |
78 | dc->is_recursive = | 78 | dc->is_recursive = |
79 | (TRUE == | 79 | (TRUE == |
80 | gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cb))) ? GNUNET_YES : | 80 | gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cb))) ? GNUNET_YES : |
@@ -167,8 +167,7 @@ GNUNET_FS_GTK_open_download_as_dialog (struct DownloadContext *dc) | |||
167 | (builder, "GNUNET_GTK_save_as_dialog")); | 167 | (builder, "GNUNET_GTK_save_as_dialog")); |
168 | if (dc->filename != NULL) | 168 | if (dc->filename != NULL) |
169 | { | 169 | { |
170 | char buf[1024]; | 170 | char buf[FILENAME_MAX]; |
171 | char *buf_utf8; | ||
172 | 171 | ||
173 | if (NULL != getcwd (buf, sizeof (buf))) | 172 | if (NULL != getcwd (buf, sizeof (buf))) |
174 | { | 173 | { |
@@ -177,12 +176,7 @@ GNUNET_FS_GTK_open_download_as_dialog (struct DownloadContext *dc) | |||
177 | strcat (buf, DIR_SEPARATOR_STR); | 176 | strcat (buf, DIR_SEPARATOR_STR); |
178 | strcat (buf, dc->filename); | 177 | strcat (buf, dc->filename); |
179 | } | 178 | } |
180 | buf_utf8 = GNUNET_GTK_from_loc_to_utf8 (buf); | 179 | gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (ad), buf); |
181 | if (buf_utf8 != NULL) | ||
182 | { | ||
183 | gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (ad), buf_utf8); | ||
184 | GNUNET_free (buf_utf8); | ||
185 | } | ||
186 | } | 180 | } |
187 | } | 181 | } |
188 | dlc = g_new0 (struct dialog_context, 1); | 182 | dlc = g_new0 (struct dialog_context, 1); |
diff --git a/src/fs/gnunet-fs-gtk-event_handler.c b/src/fs/gnunet-fs-gtk-event_handler.c index ac734af5..46ab20ea 100644 --- a/src/fs/gnunet-fs-gtk-event_handler.c +++ b/src/fs/gnunet-fs-gtk-event_handler.c | |||
@@ -546,7 +546,6 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | |||
546 | GtkTreeIter iter; | 546 | GtkTreeIter iter; |
547 | GtkTreePath *path; | 547 | GtkTreePath *path; |
548 | struct SearchResult *srp; | 548 | struct SearchResult *srp; |
549 | gchar *filename_utf8; | ||
550 | 549 | ||
551 | if (de == NULL) | 550 | if (de == NULL) |
552 | { | 551 | { |
@@ -586,15 +585,13 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | |||
586 | return de; | 585 | return de; |
587 | } | 586 | } |
588 | gtk_tree_path_free (path); | 587 | gtk_tree_path_free (path); |
589 | filename_utf8 = GNUNET_GTK_from_loc_to_utf8 ((char *) filename); | ||
590 | gtk_tree_store_set (de->ts, &iter, 4, | 588 | gtk_tree_store_set (de->ts, &iter, 4, |
591 | (guint) ((size > | 589 | (guint) ((size > |
592 | 0) ? (100 * completed / | 590 | 0) ? (100 * completed / |
593 | size) : 100) /* progress */ , | 591 | size) : 100) /* progress */ , |
594 | 6, filename_utf8 /* filename/description */ , | 592 | 6, filename /* filename/description */ , |
595 | 8, "blue" /* status colour: pending */ , | 593 | 8, "blue" /* status colour: pending */ , |
596 | -1); | 594 | -1); |
597 | GNUNET_free_non_null (filename_utf8); | ||
598 | return de; | 595 | return de; |
599 | } | 596 | } |
600 | 597 | ||
@@ -1637,7 +1634,6 @@ setup_publish (struct GNUNET_FS_PublishContext *pc, const char *fn, | |||
1637 | GtkWidget *close_button; | 1634 | GtkWidget *close_button; |
1638 | GtkNotebook *notebook; | 1635 | GtkNotebook *notebook; |
1639 | char *size_fancy; | 1636 | char *size_fancy; |
1640 | char *fn_utf8 = NULL; | ||
1641 | 1637 | ||
1642 | if (NULL == parent) | 1638 | if (NULL == parent) |
1643 | { | 1639 | { |
@@ -1705,12 +1701,10 @@ setup_publish (struct GNUNET_FS_PublishContext *pc, const char *fn, | |||
1705 | ent = GNUNET_malloc (sizeof (struct PublishEntry)); | 1701 | ent = GNUNET_malloc (sizeof (struct PublishEntry)); |
1706 | ent->is_top = (parent == NULL) ? GNUNET_YES : GNUNET_NO; | 1702 | ent->is_top = (parent == NULL) ? GNUNET_YES : GNUNET_NO; |
1707 | ent->tab = publish_tab; | 1703 | ent->tab = publish_tab; |
1708 | fn_utf8 = GNUNET_GTK_from_loc_to_utf8 ((char *) fn); | ||
1709 | gtk_tree_store_insert_with_values (publish_tab->ts, &iter, pitrptr, G_MAXINT, | 1704 | gtk_tree_store_insert_with_values (publish_tab->ts, &iter, pitrptr, G_MAXINT, |
1710 | 0, fn_utf8, 1, size_fancy, 2, "white", 3, | 1705 | 0, fn, 1, size_fancy, 2, "white", 3, |
1711 | (guint) 0 /* progress */ , | 1706 | (guint) 0 /* progress */ , |
1712 | 4, ent, -1); | 1707 | 4, ent, -1); |
1713 | GNUNET_free_non_null (fn_utf8); | ||
1714 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (publish_tab->ts), &iter); | 1708 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (publish_tab->ts), &iter); |
1715 | GNUNET_assert (NULL != path); | 1709 | GNUNET_assert (NULL != path); |
1716 | ent->rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (publish_tab->ts), path); | 1710 | ent->rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (publish_tab->ts), path); |
diff --git a/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c b/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c index d429694d..d5382391 100644 --- a/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c +++ b/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c | |||
@@ -49,15 +49,10 @@ add_to_list (void *cls, const char *name, const GNUNET_HashCode * id) | |||
49 | { | 49 | { |
50 | GtkListStore *ls = cls; | 50 | GtkListStore *ls = cls; |
51 | GtkTreeIter iter; | 51 | GtkTreeIter iter; |
52 | char *name_utf8; | 52 | gtk_list_store_insert_with_values (ls, &iter, -1, 0, name, 1, |
53 | |||
54 | name_utf8 = GNUNET_GTK_from_loc_to_utf8 ((char *) name); | ||
55 | |||
56 | gtk_list_store_insert_with_values (ls, &iter, -1, 0, name_utf8, 1, | ||
57 | GNUNET_FS_namespace_create | 53 | GNUNET_FS_namespace_create |
58 | (GNUNET_FS_GTK_get_fs_handle (), name), | 54 | (GNUNET_FS_GTK_get_fs_handle (), name), |
59 | -1); | 55 | -1); |
60 | GNUNET_free_non_null (name_utf8); | ||
61 | } | 56 | } |
62 | 57 | ||
63 | 58 | ||
diff --git a/src/fs/gnunet-fs-gtk-main_window_create_pseudonym.c b/src/fs/gnunet-fs-gtk-main_window_create_pseudonym.c index dfa62bb1..996b6ad1 100644 --- a/src/fs/gnunet-fs-gtk-main_window_create_pseudonym.c +++ b/src/fs/gnunet-fs-gtk-main_window_create_pseudonym.c | |||
@@ -32,7 +32,6 @@ GNUNET_GTK_create_namespace_dialog_response_cb (GtkDialog * dialog, | |||
32 | gpointer user_data) | 32 | gpointer user_data) |
33 | { | 33 | { |
34 | const char *name; | 34 | const char *name; |
35 | gchar *name_loc; | ||
36 | struct GNUNET_FS_Namespace *ns; | 35 | struct GNUNET_FS_Namespace *ns; |
37 | GtkWidget *ad; | 36 | GtkWidget *ad; |
38 | GtkBuilder *builder; | 37 | GtkBuilder *builder; |
@@ -53,12 +52,10 @@ GNUNET_GTK_create_namespace_dialog_response_cb (GtkDialog * dialog, | |||
53 | (builder, | 52 | (builder, |
54 | "GNUNET_GTK_create_namespace_name_entry"))); | 53 | "GNUNET_GTK_create_namespace_name_entry"))); |
55 | /* FIXME: show busy dialog while doing key creation */ | 54 | /* FIXME: show busy dialog while doing key creation */ |
56 | name_loc = GNUNET_GTK_from_utf8_to_loc ((char *) name); | 55 | if (NULL != name) |
57 | if (NULL != name_loc) | ||
58 | { | 56 | { |
59 | ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name_loc); | 57 | ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name); |
60 | GNUNET_FS_namespace_delete (ns, GNUNET_NO); | 58 | GNUNET_FS_namespace_delete (ns, GNUNET_NO); |
61 | GNUNET_free (name_loc); | ||
62 | } | 59 | } |
63 | gtk_widget_destroy (ad); | 60 | gtk_widget_destroy (ad); |
64 | g_object_unref (G_OBJECT (builder)); | 61 | g_object_unref (G_OBJECT (builder)); |
diff --git a/src/fs/gnunet-fs-gtk-main_window_file_publish.c b/src/fs/gnunet-fs-gtk-main_window_file_publish.c index 2d93e722..16df7b93 100644 --- a/src/fs/gnunet-fs-gtk-main_window_file_publish.c +++ b/src/fs/gnunet-fs-gtk-main_window_file_publish.c | |||
@@ -205,7 +205,6 @@ add_file_at_iter (gpointer data, const char *filename, | |||
205 | GtkTreePath *path; | 205 | GtkTreePath *path; |
206 | uint64_t file_size; | 206 | uint64_t file_size; |
207 | const char *short_fn; | 207 | const char *short_fn; |
208 | char *short_fn_utf8; | ||
209 | struct GNUNET_CONTAINER_MetaData *meta; | 208 | struct GNUNET_CONTAINER_MetaData *meta; |
210 | struct GNUNET_FS_Uri *ksk_uri; | 209 | struct GNUNET_FS_Uri *ksk_uri; |
211 | GtkTreeStore *ts; | 210 | GtkTreeStore *ts; |
@@ -243,11 +242,10 @@ add_file_at_iter (gpointer data, const char *filename, | |||
243 | short_fn = filename; | 242 | short_fn = filename; |
244 | while (NULL != (ss = strstr (short_fn, DIR_SEPARATOR_STR))) | 243 | while (NULL != (ss = strstr (short_fn, DIR_SEPARATOR_STR))) |
245 | short_fn = 1 + ss; | 244 | short_fn = 1 + ss; |
246 | short_fn_utf8 = GNUNET_GTK_from_loc_to_utf8 ((char *) short_fn); | ||
247 | GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet-gtk>", | 245 | GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet-gtk>", |
248 | EXTRACTOR_METATYPE_FILENAME, | 246 | EXTRACTOR_METATYPE_FILENAME, |
249 | EXTRACTOR_METAFORMAT_UTF8, "text/plain", | 247 | EXTRACTOR_METAFORMAT_UTF8, "text/plain", |
250 | short_fn_utf8, strlen (short_fn_utf8) + 1); | 248 | short_fn, strlen (short_fn) + 1); |
251 | ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (meta); | 249 | ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (meta); |
252 | gtk_tree_store_insert_before (ts, &pos, iter, NULL); | 250 | gtk_tree_store_insert_before (ts, &pos, iter, NULL); |
253 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (ts), &pos); | 251 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (ts), &pos); |
@@ -264,9 +262,8 @@ add_file_at_iter (gpointer data, const char *filename, | |||
264 | else | 262 | else |
265 | file_size_fancy = GNUNET_STRINGS_byte_size_fancy (file_size); | 263 | file_size_fancy = GNUNET_STRINGS_byte_size_fancy (file_size); |
266 | gtk_tree_store_set (ts, &pos, 0, file_size_fancy, 1, (gboolean) do_index, 2, | 264 | gtk_tree_store_set (ts, &pos, 0, file_size_fancy, 1, (gboolean) do_index, 2, |
267 | short_fn_utf8, 3, (guint) bo->anonymity_level, 4, | 265 | short_fn, 3, (guint) bo->anonymity_level, 4, |
268 | (guint) bo->content_priority, 5, fi, -1); | 266 | (guint) bo->content_priority, 5, fi, -1); |
269 | GNUNET_free_non_null (short_fn_utf8); | ||
270 | GNUNET_free (file_size_fancy); | 267 | GNUNET_free (file_size_fancy); |
271 | update_selectivity (data); | 268 | update_selectivity (data); |
272 | } | 269 | } |
@@ -503,7 +500,6 @@ extract_file (struct AddDirContext *adc, const char *filename) | |||
503 | GNUNET_HashCode hc; | 500 | GNUNET_HashCode hc; |
504 | const char *short_fn; | 501 | const char *short_fn; |
505 | const char *ss; | 502 | const char *ss; |
506 | char *short_fn_utf8; | ||
507 | 503 | ||
508 | adc->dir_entry_count++; | 504 | adc->dir_entry_count++; |
509 | pd = GNUNET_malloc (sizeof (struct PublishData)); | 505 | pd = GNUNET_malloc (sizeof (struct PublishData)); |
@@ -515,12 +511,10 @@ extract_file (struct AddDirContext *adc, const char *filename) | |||
515 | short_fn = filename; | 511 | short_fn = filename; |
516 | while (NULL != (ss = strstr (short_fn, DIR_SEPARATOR_STR))) | 512 | while (NULL != (ss = strstr (short_fn, DIR_SEPARATOR_STR))) |
517 | short_fn = 1 + ss; | 513 | short_fn = 1 + ss; |
518 | short_fn_utf8 = GNUNET_GTK_from_loc_to_utf8 ((char *) short_fn); | ||
519 | GNUNET_CONTAINER_meta_data_insert (pd->meta, "<gnunet-gtk>", | 514 | GNUNET_CONTAINER_meta_data_insert (pd->meta, "<gnunet-gtk>", |
520 | EXTRACTOR_METATYPE_FILENAME, | 515 | EXTRACTOR_METATYPE_FILENAME, |
521 | EXTRACTOR_METAFORMAT_UTF8, "text/plain", | 516 | EXTRACTOR_METAFORMAT_UTF8, "text/plain", |
522 | short_fn, strlen (short_fn_utf8) + 1); | 517 | short_fn, strlen (short_fn) + 1); |
523 | GNUNET_free_non_null (short_fn_utf8); | ||
524 | 518 | ||
525 | gtk_tree_store_insert_before (adc->ts, &pd->iter, adc->parent, NULL); | 519 | gtk_tree_store_insert_before (adc->ts, &pd->iter, adc->parent, NULL); |
526 | GNUNET_CRYPTO_hash (filename, strlen (filename), &hc); | 520 | GNUNET_CRYPTO_hash (filename, strlen (filename), &hc); |
@@ -578,7 +572,6 @@ add_entry_to_ts (GtkTreeStore * ts, GtkTreeIter * iter, const char *filename, | |||
578 | struct GNUNET_FS_Uri *kill_ksk; | 572 | struct GNUNET_FS_Uri *kill_ksk; |
579 | const char *ss; | 573 | const char *ss; |
580 | const char *short_fn; | 574 | const char *short_fn; |
581 | char *short_fn_utf8; | ||
582 | struct stat sbuf; | 575 | struct stat sbuf; |
583 | 576 | ||
584 | if (0 != STAT (filename, &sbuf)) | 577 | if (0 != STAT (filename, &sbuf)) |
@@ -630,11 +623,9 @@ add_entry_to_ts (GtkTreeStore * ts, GtkTreeIter * iter, const char *filename, | |||
630 | short_fn = filename; | 623 | short_fn = filename; |
631 | while (NULL != (ss = strstr (short_fn, DIR_SEPARATOR_STR))) | 624 | while (NULL != (ss = strstr (short_fn, DIR_SEPARATOR_STR))) |
632 | short_fn = 1 + ss; | 625 | short_fn = 1 + ss; |
633 | short_fn_utf8 = GNUNET_GTK_from_loc_to_utf8 ((char *) short_fn); | ||
634 | gtk_tree_store_set (ts, iter, 0, file_size_fancy, 1, (gboolean) do_index, 2, | 626 | gtk_tree_store_set (ts, iter, 0, file_size_fancy, 1, (gboolean) do_index, 2, |
635 | short_fn_utf8, 3, (guint) bo->anonymity_level, 4, | 627 | short_fn, 3, (guint) bo->anonymity_level, 4, |
636 | (guint) bo->content_priority, 5, fi, -1); | 628 | (guint) bo->content_priority, 5, fi, -1); |
637 | GNUNET_free_non_null (short_fn_utf8); | ||
638 | GNUNET_free (file_size_fancy); | 629 | GNUNET_free (file_size_fancy); |
639 | } | 630 | } |
640 | 631 | ||
@@ -1397,7 +1388,7 @@ GNUNET_GTK_publish_directory_dialog_response_cb (GtkDialog * dialog, | |||
1397 | (builder, "GNUNET_GTK_publish_directory_dialog")); | 1388 | (builder, "GNUNET_GTK_publish_directory_dialog")); |
1398 | if (response_id == -5) | 1389 | if (response_id == -5) |
1399 | { | 1390 | { |
1400 | filename = GNUNET_GTK_filechooser_get_filename_loc (GTK_FILE_CHOOSER (ad)); | 1391 | filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (ad)); |
1401 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object | 1392 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object |
1402 | (builder, | 1393 | (builder, |
1403 | "GNUNET_GTK_publish_directory_dialog_expiration_year_spin_button")); | 1394 | "GNUNET_GTK_publish_directory_dialog_expiration_year_spin_button")); |
@@ -1621,15 +1612,13 @@ add_namespace_to_ts (void *cls, const char *name, const GNUNET_HashCode * id) | |||
1621 | GtkTreeStore *ts = cls; | 1612 | GtkTreeStore *ts = cls; |
1622 | struct UpdateableContext uc; | 1613 | struct UpdateableContext uc; |
1623 | GtkTreeIter iter; | 1614 | GtkTreeIter iter; |
1624 | gchar *name_utf8; | ||
1625 | 1615 | ||
1626 | uc.parent = &iter; | 1616 | uc.parent = &iter; |
1627 | uc.namespace_name = name; | 1617 | uc.namespace_name = name; |
1628 | uc.ts = ts; | 1618 | uc.ts = ts; |
1629 | uc.ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name); | 1619 | uc.ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name); |
1630 | uc.update_called = GNUNET_NO; | 1620 | uc.update_called = GNUNET_NO; |
1631 | name_utf8 = GNUNET_GTK_from_loc_to_utf8 ((char *) name); | 1621 | gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, 0, name, 1, |
1632 | gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, 0, name_utf8, 1, | ||
1633 | uc.ns, 2, NULL /* last-id */ , | 1622 | uc.ns, 2, NULL /* last-id */ , |
1634 | 3, NULL /* last-uri (as string!) */ , | 1623 | 3, NULL /* last-uri (as string!) */ , |
1635 | 4, NULL /* meta */ , | 1624 | 4, NULL /* meta */ , |
@@ -1638,7 +1627,6 @@ add_namespace_to_ts (void *cls, const char *name, const GNUNET_HashCode * id) | |||
1638 | 7, TRUE /* update editable */ , | 1627 | 7, TRUE /* update editable */ , |
1639 | 8, TRUE /* current editable */ , | 1628 | 8, TRUE /* current editable */ , |
1640 | -1); | 1629 | -1); |
1641 | GNUNET_free_non_null (name_utf8); | ||
1642 | uc.seen = GNUNET_CONTAINER_multihashmap_create (128); | 1630 | uc.seen = GNUNET_CONTAINER_multihashmap_create (128); |
1643 | GNUNET_FS_namespace_list_updateable (uc.ns, NULL, &add_updateable_to_ts, &uc); | 1631 | GNUNET_FS_namespace_list_updateable (uc.ns, NULL, &add_updateable_to_ts, &uc); |
1644 | GNUNET_CONTAINER_multihashmap_destroy (uc.seen); | 1632 | GNUNET_CONTAINER_multihashmap_destroy (uc.seen); |
@@ -1861,7 +1849,7 @@ GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog * dialog, | |||
1861 | (builder, | 1849 | (builder, |
1862 | "GNUNET_GTK_publish_file_dialog_do_index_checkbutton"))); | 1850 | "GNUNET_GTK_publish_file_dialog_do_index_checkbutton"))); |
1863 | 1851 | ||
1864 | filename = GNUNET_GTK_filechooser_get_filename_loc (GTK_FILE_CHOOSER (ad)); | 1852 | filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (ad)); |
1865 | add_file_at_iter (user_data, filename, &bo, do_index, NULL); | 1853 | add_file_at_iter (user_data, filename, &bo, do_index, NULL); |
1866 | g_free (filename); | 1854 | g_free (filename); |
1867 | update_selectivity (user_data); | 1855 | update_selectivity (user_data); |
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 094ef67d..bf28109a 100644 --- a/src/fs/gnunet-fs-gtk-main_window_open_directory.c +++ b/src/fs/gnunet-fs-gtk-main_window_open_directory.c | |||
@@ -92,7 +92,7 @@ GNUNET_GTK_open_directory_dialog_response_cb (GtkDialog * dialog, | |||
92 | { | 92 | { |
93 | GtkBuilder *builder; | 93 | GtkBuilder *builder; |
94 | GtkWidget *ad; | 94 | GtkWidget *ad; |
95 | char *filename, *filename_utf8; | 95 | char *filename; |
96 | struct AddChildContext acc; | 96 | struct AddChildContext acc; |
97 | 97 | ||
98 | builder = GTK_BUILDER (user_data); | 98 | builder = GTK_BUILDER (user_data); |
@@ -106,15 +106,12 @@ GNUNET_GTK_open_directory_dialog_response_cb (GtkDialog * dialog, | |||
106 | return; | 106 | return; |
107 | } | 107 | } |
108 | 108 | ||
109 | filename = GNUNET_GTK_filechooser_get_filename_loc (GTK_FILE_CHOOSER (ad)); | 109 | filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (ad)); |
110 | filename_utf8 = | ||
111 | GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (ad)); | ||
112 | gtk_widget_destroy (ad); | 110 | gtk_widget_destroy (ad); |
113 | g_object_unref (G_OBJECT (builder)); | 111 | g_object_unref (G_OBJECT (builder)); |
114 | acc.filename = filename_utf8; | 112 | acc.filename = filename; |
115 | acc.ts = NULL; | 113 | acc.ts = NULL; |
116 | GNUNET_FS_GTK_mmap_and_scan (filename, &add_child, &acc); | 114 | GNUNET_FS_GTK_mmap_and_scan (filename, &add_child, &acc); |
117 | g_free (filename_utf8); | ||
118 | g_free (filename); | 115 | g_free (filename); |
119 | } | 116 | } |
120 | 117 | ||