From 1c82a533ede33f2eceeccc99b913e3d575c503e2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 2 Jul 2015 02:10:05 -0700 Subject: [PATCH] file chooser: Don't allow resorting recent files They are inherently sorted by access time. --- gtk/gtkfilechooserwidget.c | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 90d4d4f91e..5b1c0576f2 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -6677,23 +6677,12 @@ recent_setup_model (GtkFileChooserWidget *impl) _gtk_file_system_model_set_filter (priv->recent_model, priv->current_filter); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (priv->recent_model), - MODEL_COL_NAME, - name_sort_func, - impl, NULL); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (priv->recent_model), - MODEL_COL_SIZE, - size_sort_func, - impl, NULL); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (priv->recent_model), - MODEL_COL_TIME, - time_sort_func, - impl, NULL); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (priv->recent_model), - MODEL_COL_LOCATION_TEXT, - location_sort_func, - impl, NULL); - set_sort_column (impl); + gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (priv->recent_model), + time_sort_func, + impl, NULL); + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (priv->recent_model), + GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, + GTK_SORT_DESCENDING); } typedef struct @@ -6711,13 +6700,17 @@ recent_idle_cleanup (gpointer data) gtk_tree_view_set_model (GTK_TREE_VIEW (priv->browse_files_tree_view), GTK_TREE_MODEL (priv->recent_model)); - file_list_set_sort_column_ids (impl); - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (priv->recent_model), MODEL_COL_TIME, GTK_SORT_DESCENDING); + gtk_tree_view_set_search_column (GTK_TREE_VIEW (priv->browse_files_tree_view), -1); + + gtk_tree_view_column_set_sort_column_id (priv->list_name_column, -1); + gtk_tree_view_column_set_sort_column_id (priv->list_time_column, -1); + gtk_tree_view_column_set_sort_column_id (priv->list_size_column, -1); + gtk_tree_view_column_set_sort_column_id (priv->list_location_column, -1); set_busy_cursor (impl, FALSE); - + priv->load_recent_id = 0; - + g_free (load_data); } -- 2.30.2