From f072e6e8fe72da876d3ea9b53c2f8718742ba1b4 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 18:38:38 +0400
Subject: [PATCH 3/3] Revert "Get text from the combobox entry"

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

diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c
index f292a33..971775c 100644
--- a/src/fs/gnunet-fs-gtk.c
+++ b/src/fs/gnunet-fs-gtk.c
@@ -385,14 +385,13 @@ 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;
-  const gchar *mime_keyword;
+  gchar *mime_keyword;
 
   GNUNET_HashCode *nsid = NULL;
   struct GNUNET_FS_Uri *uri;
@@ -405,8 +404,12 @@ 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_entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (mime_combo)));
-  mime_keyword = gtk_entry_get_text (mime_entry);
+  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);
+  }
 
   get_selected_namespace_treepath_iter_model_widget (builder,
       &namespace_treepath, &iter, &namespace_model, NULL);
@@ -418,6 +421,7 @@ 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

