[gucharmap/gnome-2-30] Set the search column after setting the model



commit a7ebb9b8c941484d6f0bcc86c1ceb8cbdbdad27e
Author: Christian Persch <chpe gnome org>
Date:   Thu Jun 10 18:33:33 2010 +0200

    Set the search column after setting the model
    
    It's reset to -1 when the model changes, making typeahead search weirdly
    search the english string instead of the translated one.
    
    Bug #621215.

 gucharmap/gucharmap-chapters-view.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gucharmap/gucharmap-chapters-view.c b/gucharmap/gucharmap-chapters-view.c
index 805de99..74f4468 100644
--- a/gucharmap/gucharmap-chapters-view.c
+++ b/gucharmap/gucharmap-chapters-view.c
@@ -68,7 +68,6 @@ gucharmap_chapters_view_init (GucharmapChaptersView *view)
   selection = gtk_tree_view_get_selection (tree_view);
   gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
 
-  gtk_tree_view_set_search_column (tree_view, GUCHARMAP_CHAPTERS_MODEL_COLUMN_LABEL);
   gtk_tree_view_set_enable_search (tree_view, TRUE);
 }
 
@@ -110,6 +109,9 @@ gucharmap_chapters_view_set_model (GucharmapChaptersView *view,
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model),
                                         GUCHARMAP_CHAPTERS_MODEL_COLUMN_LABEL,
                                         GTK_SORT_ASCENDING);
+
+  /* Need to re-set this here since it's set to -1 when the tree view model changes! */
+  gtk_tree_view_set_search_column (tree_view, GUCHARMAP_CHAPTERS_MODEL_COLUMN_LABEL);
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]