From 27ca0ac7e6b73b1c633674d119f03a8e19dcd3fd Mon Sep 17 00:00:00 2001 From: Andrey Streltsov Date: Fri, 9 Aug 2019 00:02:11 +0300 Subject: Use the same view settings for search results as the folder being searched Fix issue https://github.com/mate-desktop/caja/issues/704 --- src/caja-window-manage-views.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/caja-window-manage-views.c b/src/caja-window-manage-views.c index 40cf9ae8..caaa858b 100644 --- a/src/caja-window-manage-views.c +++ b/src/caja-window-manage-views.c @@ -1266,7 +1266,20 @@ got_file_info_for_view_selection_callback (CajaFile *file, /* Otherwise, use default */ if (view_id == NULL) { - view_id = caja_global_preferences_get_default_folder_viewer_preference_as_iid (); + char *uri; + uri = caja_file_get_uri (file); + + /* Use same view settings for search results as the current folder */ + if (eel_uri_is_search (uri)) + { + view_id = g_strdup (caja_view_get_view_id (slot->content_view)); + } + else + { + view_id = caja_global_preferences_get_default_folder_viewer_preference_as_iid (); + } + + g_free (uri); if (view_id != NULL && !caja_view_factory_view_supports_uri (view_id, -- cgit v1.2.1