[nautilus] window-manage-views: re-add an accidentally removed snipped of code



commit ae1e300376b3479e14045892caa720dd3903a89c
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jan 12 19:32:13 2011 +0100

    window-manage-views: re-add an accidentally removed snipped of code

 src/nautilus-window-manage-views.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index 8fc9c14..b456d6a 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -248,6 +248,35 @@ handle_go_forward (NautilusNavigationWindowSlot *navigation_slot,
 	g_list_free_1 (link);
 }
 
+static void
+handle_go_elsewhere (NautilusWindowSlot *slot,
+		     GFile *location)
+{
+	NautilusNavigationWindowSlot *navigation_slot;
+
+	if (NAUTILUS_IS_NAVIGATION_WINDOW_SLOT (slot)) {
+		navigation_slot = NAUTILUS_NAVIGATION_WINDOW_SLOT (slot);
+
+		/* Clobber the entire forward list, and move displayed location to back list */
+		nautilus_navigation_window_slot_clear_forward_list (navigation_slot);
+		
+		if (slot->location != NULL) {
+			/* If we're returning to the same uri somehow, don't put this uri on back list. 
+			 * This also avoids a problem where set_displayed_location
+			 * didn't update last_location_bookmark since the uri didn't change.
+			 */
+			if (!g_file_equal (slot->location, location)) {
+				/* Store bookmark for current location in back list, unless there is no current location */
+				check_last_bookmark_location_matches_slot (slot);
+				/* Use the first bookmark in the history list rather than creating a new one. */
+				navigation_slot->back_list = g_list_prepend (navigation_slot->back_list,
+									     slot->last_location_bookmark);
+				g_object_ref (navigation_slot->back_list->data);
+			}
+		}
+	}
+}
+
 void
 nautilus_window_update_up_button (NautilusWindow *window)
 {
@@ -379,6 +408,7 @@ update_history (NautilusWindowSlot *slot,
         case NAUTILUS_LOCATION_CHANGE_STANDARD:
         case NAUTILUS_LOCATION_CHANGE_FALLBACK:
                 nautilus_window_slot_add_current_location_to_history_list (slot);
+		handle_go_elsewhere (slot, new_location);
                 return;
         case NAUTILUS_LOCATION_CHANGE_RELOAD:
                 /* for reload there is no work to do */



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