summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2017-03-30 16:54:27 +0200
committerCarlos Soriano <csoriano@gnome.org>2017-04-22 17:16:47 +0200
commitb31258e7a41a801d41d468d5fe0ce063e26fe4d8 (patch)
treec76a8bdd5ea182b5d6bb818a4ff08e4a2ead7dda
parent2322b3ca3220fdd20024ce3f43d59612d7bb6dd2 (diff)
downloadnautilus-b31258e7a41a801d41d468d5fe0ce063e26fe4d8.tar.gz
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
-rw-r--r--src/nautilus-files-view.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index a33c9517f..d37fffb33 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);