summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-view.c6
-rw-r--r--src/nautilus-window-manage-views.c16
2 files changed, 16 insertions, 6 deletions
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 06637aaff..d647f968c 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -9126,12 +9126,6 @@ load_directory (NautilusView *view,
}
old_directory = view->details->model;
-
- if (NAUTILUS_IS_SEARCH_DIRECTORY (directory) &&
- !NAUTILUS_IS_SEARCH_DIRECTORY (old_directory)) {
- nautilus_search_directory_set_base_model (NAUTILUS_SEARCH_DIRECTORY (directory), old_directory);
- }
-
disconnect_model_handlers (view);
nautilus_directory_ref (directory);
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index cf146da7e..407a27eeb 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -971,6 +971,7 @@ create_content_view (NautilusWindowSlot *slot,
GList *selection;
gboolean ret = TRUE;
GError *error = NULL;
+ NautilusDirectory *old_directory, *new_directory;
window = nautilus_window_slot_get_window (slot);
@@ -1003,6 +1004,21 @@ create_content_view (NautilusWindowSlot *slot,
nautilus_window_connect_content_view (window, slot->new_content_view);
}
+ /* Forward search selection and state before loading the new model */
+ new_directory = nautilus_directory_get (slot->pending_location);
+ old_directory = nautilus_directory_get (slot->location);
+
+ if (NAUTILUS_IS_SEARCH_DIRECTORY (new_directory) &&
+ !NAUTILUS_IS_SEARCH_DIRECTORY (old_directory)) {
+ nautilus_search_directory_set_base_model (NAUTILUS_SEARCH_DIRECTORY (new_directory), old_directory);
+ }
+
+ if (NAUTILUS_IS_SEARCH_DIRECTORY (old_directory) &&
+ !NAUTILUS_IS_SEARCH_DIRECTORY (new_directory) &&
+ slot->pending_selection == NULL) {
+ slot->pending_selection = nautilus_view_get_selection (slot->content_view);
+ }
+
/* Actually load the pending location and selection: */
if (slot->pending_location != NULL) {