diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c index b4f6e592..50d3195b 100644 --- a/src/fs/gnunet-fs-gtk.c +++ b/src/fs/gnunet-fs-gtk.c | |||
@@ -496,19 +496,16 @@ main_window_search_button_clicked_cb (GtkButton *button, gpointer user_data) | |||
496 | { | 496 | { |
497 | namespace_model = gtk_tree_row_reference_get_model (ref); | 497 | namespace_model = gtk_tree_row_reference_get_model (ref); |
498 | namespace_treepath = gtk_tree_row_reference_get_path (ref); | 498 | namespace_treepath = gtk_tree_row_reference_get_path (ref); |
499 | gtk_tree_model_get_iter (namespace_model, &iter, namespace_treepath); | 499 | if ( (NULL != namespace_treepath) && |
500 | (TRUE == gtk_tree_model_get_iter (namespace_model, &iter, namespace_treepath)) ) | ||
501 | gtk_tree_model_get (namespace_model, &iter, 1, &nsid, 2, &root, -1); | ||
500 | } | 502 | } |
501 | |||
502 | query_entry = GTK_ENTRY (gtk_builder_get_object (builder, | 503 | query_entry = GTK_ENTRY (gtk_builder_get_object (builder, |
503 | "main_window_search_entry")); | 504 | "main_window_search_entry")); |
504 | |||
505 | if (namespace_treepath != NULL) | ||
506 | gtk_tree_model_get (namespace_model, &iter, 1, &nsid, 2, &root, -1); | ||
507 | if (root == NULL) | 505 | if (root == NULL) |
508 | root = g_strdup (""); | 506 | root = g_strdup (""); |
509 | |||
510 | entry_keywords = gtk_entry_get_text (query_entry); | 507 | entry_keywords = gtk_entry_get_text (query_entry); |
511 | 508 | /* FIXME: why is 'root' added here? Why is 'mime_keyword' not made mandatory? (+) */ | |
512 | keywords = g_strdup_printf ("%s %s %s", entry_keywords, mime_keyword, root); | 509 | keywords = g_strdup_printf ("%s %s %s", entry_keywords, mime_keyword, root); |
513 | g_free (mime_keyword); | 510 | g_free (mime_keyword); |
514 | g_free (root); | 511 | g_free (root); |