diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c index 8f484a6b..f5e7dad1 100644 --- a/src/fs/gnunet-fs-gtk.c +++ b/src/fs/gnunet-fs-gtk.c | |||
@@ -501,8 +501,11 @@ main_window_search_button_clicked_cb (GtkButton *button, gpointer user_data) | |||
501 | mime_keyword = NULL; | 501 | mime_keyword = NULL; |
502 | if (mime_model && gtk_combo_box_get_active_iter (mime_combo, &iter)) | 502 | if (mime_model && gtk_combo_box_get_active_iter (mime_combo, &iter)) |
503 | gtk_tree_model_get (mime_model, &iter, 0, &mime_keyword, -1); | 503 | gtk_tree_model_get (mime_model, &iter, 0, &mime_keyword, -1); |
504 | if (mime_keyword == NULL) | 504 | if (strcmp (mime_keyword, " ") == 0) |
505 | mime_keyword = g_strdup (""); | 505 | { |
506 | g_free (mime_keyword); | ||
507 | mime_keyword = NULL; | ||
508 | } | ||
506 | 509 | ||
507 | ref = g_object_get_data (G_OBJECT (toggle_button), "selected-row-reference"); | 510 | ref = g_object_get_data (G_OBJECT (toggle_button), "selected-row-reference"); |
508 | if (ref) | 511 | if (ref) |
@@ -516,7 +519,7 @@ main_window_search_button_clicked_cb (GtkButton *button, gpointer user_data) | |||
516 | query_entry = GTK_ENTRY (gtk_builder_get_object (builder, | 519 | query_entry = GTK_ENTRY (gtk_builder_get_object (builder, |
517 | "main_window_search_entry")); | 520 | "main_window_search_entry")); |
518 | entry_keywords = gtk_entry_get_text (query_entry); | 521 | entry_keywords = gtk_entry_get_text (query_entry); |
519 | keywords = g_strdup_printf ("%s +%s", entry_keywords, mime_keyword); | 522 | keywords = g_strdup_printf ("%s %s%s", entry_keywords, mime_keyword ? "+" : "", mime_keyword ? mime_keyword : ""); |
520 | g_free (mime_keyword); | 523 | g_free (mime_keyword); |
521 | if (nsid != NULL) | 524 | if (nsid != NULL) |
522 | { | 525 | { |
@@ -610,6 +613,18 @@ add_namespace_to_ts (void *cls, const GNUNET_HashCode * pseudonym, | |||
610 | EXTRACTOR_METATYPE_SUBJECT, | 613 | EXTRACTOR_METATYPE_SUBJECT, |
611 | EXTRACTOR_METATYPE_KEYWORDS, | 614 | EXTRACTOR_METATYPE_KEYWORDS, |
612 | -1); | 615 | -1); |
616 | if (description == NULL) | ||
617 | description = g_strdup (_("no description supplied")); | ||
618 | else | ||
619 | { | ||
620 | char *utf8_desc = NULL; | ||
621 | utf8_desc = GNUNET_FS_GTK_dubious_meta_to_utf8 (EXTRACTOR_METAFORMAT_UTF8, description, strlen (description)); | ||
622 | GNUNET_free (description); | ||
623 | if (utf8_desc != NULL) | ||
624 | description = utf8_desc; | ||
625 | else | ||
626 | description = NULL; | ||
627 | } | ||
613 | gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, 0, ns_name, 1, | 628 | gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, 0, ns_name, 1, |
614 | nsid, 2, root, 3, description, -1); | 629 | nsid, 2, root, 3, description, -1); |
615 | GNUNET_free (ns_name); | 630 | GNUNET_free (ns_name); |