From 05631c692809b68c3bdba2939818bbe52b1b5b09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1=D1?=
 =?UTF-8?q?=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com>
Date: Mon, 12 Dec 2011 00:47:28 +0400
Subject: [PATCH 2/2] Get text from the combobox entry

---
 src/fs/gnunet-fs-gtk.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c
index 6833783..766241e 100644
--- a/src/fs/gnunet-fs-gtk.c
+++ b/src/fs/gnunet-fs-gtk.c
@@ -385,13 +385,14 @@ main_window_search_button_clicked_cb (GtkButton *button, gpointer user_data)
   GtkTreePath *namespace_treepath = NULL;
   GtkTreeModel *namespace_model = NULL;
   GtkComboBox *mime_combo;
+  GtkEntry *mime_entry;
   GtkTreeModel *mime_model;
   GtkEntry *query_entry;
   guint anonymity_level;
   GtkTreeIter iter;
   const char *entry_keywords;
   gchar *keywords;
-  gchar *mime_keyword;
+  const gchar *mime_keyword;
 
   GNUNET_HashCode *nsid = NULL;
   struct GNUNET_FS_Uri *uri;
@@ -404,12 +405,8 @@ main_window_search_button_clicked_cb (GtkButton *button, gpointer user_data)
 
   mime_combo = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object
       ("main_window_search_mime_combobox"));
-  mime_model = gtk_combo_box_get_model (mime_combo);
-  if (mime_model && gtk_combo_box_get_active_iter (mime_combo, &iter))
-  {
-    mime_keyword = NULL;
-    gtk_tree_model_get (mime_model, &iter, 0, &mime_keyword, -1);
-  }
+  mime_entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (mime_combo)));
+  mime_keyword = gtk_entry_get_text (mime_entry);
 
   get_selected_namespace_treepath_iter_model_widget (builder,
       &namespace_treepath, &iter, &namespace_model, NULL);
@@ -421,7 +418,6 @@ main_window_search_button_clicked_cb (GtkButton *button, gpointer user_data)
   if (mime_keyword != NULL)
   {
     keywords = g_strdup_printf ("%s %s", entry_keywords, mime_keyword);
-    g_free (mime_keyword);
   }
   else
     keywords = g_strdup (entry_keywords);
-- 
1.7.4

