[Xfce4-commits] [xfce/thunar] 02/04: Keep the history across view changes (bug #10171)

noreply at xfce.org noreply at xfce.org
Thu Apr 9 11:12:29 CEST 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit ad8dd9c351ded0fd0d2c15fba40ec0fc9c6e4598
Author: Harald Judt <h.judt at gmx.at>
Date:   Wed Apr 8 19:56:39 2015 +0200

    Keep the history across view changes (bug #10171)
---
 thunar/thunar-window.c |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index b25e638..2e863ef 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -43,6 +43,7 @@
 #include <thunar/thunar-gio-extensions.h>
 #include <thunar/thunar-gobject-extensions.h>
 #include <thunar/thunar-gtk-extensions.h>
+#include <thunar/thunar-history.h>
 #include <thunar/thunar-icon-view.h>
 #include <thunar/thunar-launcher.h>
 #include <thunar/thunar-location-buttons.h>
@@ -2683,10 +2684,11 @@ thunar_window_action_view_changed (GtkRadioAction *action,
                                    GtkRadioAction *current,
                                    ThunarWindow   *window)
 {
-  ThunarFile *file = NULL;
-  ThunarFile *current_directory = NULL;
-  GtkWidget  *old_view;
-  GList      *selected_files = NULL;
+  ThunarFile     *file = NULL;
+  ThunarFile     *current_directory = NULL;
+  ThunarHistory  *history = NULL;
+  GtkWidget      *old_view;
+  GList          *selected_files = NULL;
 
   /* drop the previous view (if any) */
   old_view = window->view;
@@ -2704,6 +2706,9 @@ thunar_window_action_view_changed (GtkRadioAction *action,
       /* remember the file selection */
       selected_files = thunar_g_file_list_copy (thunar_component_get_selected_files (THUNAR_COMPONENT (old_view)));
 
+      /* get a copy of the history */
+      history = thunar_standard_view_copy_history (THUNAR_STANDARD_VIEW (old_view));
+
       /* update the UI (else GtkUIManager will crash on merging) */
       gtk_ui_manager_ensure_update (window->ui_manager);
     }
@@ -2744,6 +2749,10 @@ thunar_window_action_view_changed (GtkRadioAction *action,
   if (gtk_widget_get_visible (GTK_WIDGET (window)))
     g_object_set (G_OBJECT (window->preferences), "last-view", g_type_name (window->view_type), NULL);
 
+  /* use the copy of the old history if available */
+  if (history != NULL)
+    thunar_standard_view_set_history (THUNAR_STANDARD_VIEW (window->view), history);
+
   /* release the file references */
   if (G_UNLIKELY (file != NULL))
     g_object_unref (G_OBJECT (file));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list