From 82a8ea1c5dbe7e892763d1f7395fe7d69c7a485d Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Thu, 14 Aug 2008 11:43:23 +0000 Subject: Remove the sort_func for the location entry. It is not really needed, since the values in comparison are simple numbers that don't need any thought on top. svn path=/trunk/; revision=8416 --- lib/widgets/ephy-location-entry.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'lib') diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index 53b28338b..5773ddaf5 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -920,23 +920,6 @@ ephy_location_entry_new (void) return GTK_WIDGET (g_object_new (EPHY_TYPE_LOCATION_ENTRY, NULL)); } -static gint -sort_func (GtkTreeModel *model, - GtkTreeIter *a, - GtkTreeIter *b, - gpointer data) -{ - gint valuea, valueb; - EphyLocationEntry *le = EPHY_LOCATION_ENTRY (data); - - gtk_tree_model_get (model, a, - le->priv->relevance_col, &valuea, -1); - gtk_tree_model_get (model, b, - le->priv->relevance_col, &valueb, -1); - - return valueb - valuea; -} - static gboolean cursor_on_match_cb (GtkEntryCompletion *completion, GtkTreeModel *model, @@ -1025,10 +1008,12 @@ ephy_location_entry_set_completion (EphyLocationEntry *le, le->priv->favicon_col = favicon_col; sort_model = gtk_tree_model_sort_new_with_model (model); + g_object_unref (model); - gtk_tree_sortable_set_default_sort_func - (GTK_TREE_SORTABLE (sort_model), - sort_func, le, NULL); + gtk_tree_sortable_set_sort_column_id + (GTK_TREE_SORTABLE (sort_model), + le->priv->relevance_col, + GTK_SORT_DESCENDING); completion = gtk_entry_completion_new (); gtk_entry_completion_set_model (completion, sort_model); -- cgit