summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2017-03-30 16:54:27 +0200
committerCarlos Soriano <csoriano@gnome.org>2017-03-30 17:00:55 +0200
commit1b84e204fddd7b94513fb99b4c02f8190ee7f071 (patch)
treeccf473ab0384f6663c5d6e1d0b2fcb2ff317b01e
parentbf2ebecd7423fb79c77faaf47ec74103973a7b81 (diff)
downloadnautilus-1b84e204fddd7b94513fb99b4c02f8190ee7f071.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);