[gtk+/bgo141154-filechooser-icon-view: 8/23] Don't frob the treeview if that's not the current view mode



commit 5ab5122ce6a47bfbde7b940aaa8fab2d7e626fe3
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Apr 5 12:40:16 2011 -0500

    Don't frob the treeview if that's not the current view mode
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 gtk/gtkfilechooserdefault.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 00c2f26..b003105 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -4877,12 +4877,14 @@ view_mode_combo_box_changed_cb (GtkComboBox *combo,
       create_browse_files_icon_view (impl);
       impl->browse_files_current_view = impl->browse_files_icon_view;
       old_view = impl->browse_files_tree_view;
+      impl->browse_files_tree_view = NULL;
     }
   else if (target == VIEW_MODE_LIST)
     {
       create_browse_files_tree_view (impl);
       impl->browse_files_current_view = impl->browse_files_tree_view;
       old_view = impl->browse_files_icon_view;
+      impl->browse_files_icon_view = NULL;
     }
   else
     g_assert_not_reached ();
@@ -6485,10 +6487,15 @@ load_set_model (GtkFileChooserDefault *impl)
 
   profile_msg ("    gtk_tree_view_set_model start", NULL);
   current_view_set_file_model (impl, GTK_TREE_MODEL (impl->browse_files_model));
-  gtk_tree_view_columns_autosize (GTK_TREE_VIEW (impl->browse_files_tree_view));
-  gtk_tree_view_set_search_column (GTK_TREE_VIEW (impl->browse_files_tree_view),
-				   MODEL_COL_NAME);
-  file_list_set_sort_column_ids (impl);
+
+  if (impl->view_mode == VIEW_MODE_LIST)
+    {
+      gtk_tree_view_columns_autosize (GTK_TREE_VIEW (impl->browse_files_tree_view));
+      gtk_tree_view_set_search_column (GTK_TREE_VIEW (impl->browse_files_tree_view),
+				       MODEL_COL_NAME);
+      file_list_set_sort_column_ids (impl);
+    }
+
   set_sort_column (impl);
   profile_msg ("    gtk_tree_view_set_model end", NULL);
   impl->list_sort_ascending = TRUE;



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