[gtk+/bgo141154-filechooser-icon-view: 11/23] Fixed copying selection from old view to the target view



commit b2ce089e83c16329ee2fc8e5dbf820f811e5e19a
Author: Simo KivimÃki <simo kivimaki fi>
Date:   Sat Apr 16 11:13:57 2011 +0300

    Fixed copying selection from old view to the target view
    
    Commit 2c53dbdb2ce3b942f0a7 set view to NULL too early.

 gtk/gtkfilechooserdefault.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index a77f34c..023a117 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -4871,14 +4871,12 @@ 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 ();
@@ -4889,6 +4887,13 @@ view_mode_combo_box_changed_cb (GtkComboBox *combo,
   copy_old_selection_to_current_view (impl, old_view_mode);
 
   /* Destroy the old view */
+  if (target == VIEW_MODE_ICON)
+    impl->browse_files_tree_view = NULL;
+  else if (target == VIEW_MODE_LIST)
+    impl->browse_files_icon_view = NULL;
+  else
+    g_assert_not_reached ();
+
   if (impl->browse_shortcuts_popup_menu)
     gtk_menu_detach (GTK_MENU (impl->browse_shortcuts_popup_menu));
 



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