[nautilus/wip/csoriano/nautilus-3.24.1: 8/14] files-view: Select file after "Open item location"



commit b31258e7a41a801d41d468d5fe0ce063e26fe4d8
Author: Carlos Soriano <csoriano gnome org>
Date:   Thu Mar 30 16:54:27 2017 +0200

    files-view: Select file after "Open item location"
    
    Until now we weren't selecting the item that was selected.
    However it really helps to do that so the user can navigate after
    searching. For instance this is pretty good to have for the "type-ahead"
    use case.
    
    This commit select the file after the user opens the item location
    and reveals the file.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780380

 src/nautilus-files-view.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index a33c951..d37fffb 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1363,7 +1363,8 @@ action_open_item_location (GSimpleAction *action,
     NautilusFile *item;
     GFile *activation_location;
     NautilusFile *activation_file;
-    NautilusFile *location;
+    NautilusFile *parent;
+    g_autoptr (GFile) parent_location = NULL;
 
     view = NAUTILUS_FILES_VIEW (user_data);
     selection = nautilus_view_get_selection (NAUTILUS_VIEW (view));
@@ -1376,11 +1377,14 @@ action_open_item_location (GSimpleAction *action,
     item = NAUTILUS_FILE (selection->data);
     activation_location = nautilus_file_get_activation_location (item);
     activation_file = nautilus_file_get (activation_location);
-    location = nautilus_file_get_parent (activation_file);
+    parent = nautilus_file_get_parent (activation_file);
+    parent_location = nautilus_file_get_location (parent);
 
-    nautilus_files_view_activate_file (view, location, 0);
+    nautilus_application_open_location_full (NAUTILUS_APPLICATION (g_application_get_default ()),
+                                             parent_location, 0, selection, NULL,
+                                             nautilus_files_view_get_nautilus_window_slot (view));
 
-    nautilus_file_unref (location);
+    nautilus_file_unref (parent);
     nautilus_file_unref (activation_file);
     g_object_unref (activation_location);
     nautilus_file_list_free (selection);


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