summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Streltsov <[email protected]>2019-08-09 00:02:11 +0300
committerraveit65 <[email protected]>2022-07-20 21:40:41 +0200
commit1c8d35af46aa3b76ef7c5860514d6ef8226c3f56 (patch)
treead5f38dd40bc311460cdcf78d1cba33a1ee79756
parent7ef4ed2753c673db0a985239b1944d41046f7610 (diff)
downloadcaja-1c8d35af46aa3b76ef7c5860514d6ef8226c3f56.tar.bz2
caja-1c8d35af46aa3b76ef7c5860514d6ef8226c3f56.tar.xz
Use the same view settings for search results as the folder being searched
Fix issue https://github.com/mate-desktop/caja/issues/704
-rw-r--r--src/caja-window-manage-views.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/caja-window-manage-views.c b/src/caja-window-manage-views.c
index 9599eea7..73e8b307 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,