[nautilus] When loading a location in a slot also load in other non-loaded panes



commit 84631cacd1909000ebd43b7267b7cacb8115d857
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Dec 11 16:42:47 2009 +0100

    When loading a location in a slot also load in other non-loaded panes
    
    This makes sure that if a window is created with more than one pane
    we'll load something in each of them.

 src/nautilus-window-manage-views.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index 6c68ca6..6b85a33 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -485,12 +485,14 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
 {
 	NautilusWindow *window;
         NautilusWindow *target_window;
+        NautilusWindowPane *pane;
         NautilusWindowSlot *target_slot;
 	NautilusWindowOpenFlags slot_flags;
         gboolean do_load_location = TRUE;
 	GFile *old_location;
 	char *old_uri, *new_uri;
 	int new_slot_position;
+	GList *l;
 
 	window = slot->pane->window;
 
@@ -630,6 +632,17 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
 
         begin_location_change (target_slot, location, new_selection,
                                NAUTILUS_LOCATION_CHANGE_STANDARD, 0, NULL);
+
+	/* Additionally, load this in all slots that have no location, this means
+	   we load both panes in e.g. a newly opened dual pane window. */
+	for (l = target_window->details->panes; l != NULL; l = l->next) {
+		pane = l->data;
+		slot = pane->active_slot;
+		if (slot->location == NULL && slot->pending_location == NULL) {
+			begin_location_change (slot, location, new_selection,
+					       NAUTILUS_LOCATION_CHANGE_STANDARD, 0, NULL);
+		}
+	}
 }
 
 void



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