[nautilus: 1/2] nautilus-files-view: reveal item location opened from recent view



commit 0d3bae9c63c487c18b7627c0b5fd2017ccaaa49a
Author: Nelson Benítez León <nbenitezl+gnome gmail com>
Date:   Tue Oct 24 22:05:06 2017 +0500

    nautilus-files-view: reveal item location opened from recent view
    
    "open item location" action from 'recent files' view was not
    revealing (selecting and scrolling to) the item whose location
    was opened.
    
    Selection code logic on canvas/list view compares NautilusFiles's,
    so we need to provide one that refers to the destination uri
    (activation uri) instead of the original one from recent view which
    has a "recent://" uri scheme.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784516

 src/nautilus-files-view.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index a18cdeb88..49cbdcb72 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1360,6 +1360,15 @@ action_open_item_location (GSimpleAction *action,
     parent = nautilus_file_get_parent (activation_file);
     parent_location = nautilus_file_get_location (parent);
 
+    if (nautilus_file_is_in_recent (item))
+    {
+        /* Selection logic will check against a NautilusFile of the
+         * activation uri, not the recent:// one. Fixes bug 784516 */
+        nautilus_file_unref (item);
+        item = nautilus_file_ref (activation_file);
+        selection->data = item;
+    }
+
     nautilus_application_open_location_full (NAUTILUS_APPLICATION (g_application_get_default ()),
                                              parent_location, 0, selection, NULL,
                                              nautilus_files_view_get_nautilus_window_slot (view));


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