After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 333265 - Open the directory of a search result/recent file
Open the directory of a search result/recent file
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Views: All
3.8.x
Other All
: Normal enhancement
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 333267 561148 622789 675206 681439 (view as bug list)
Depends on:
Blocks: 681439
 
 
Reported: 2006-03-03 16:13 UTC by Mårten Woxberg
Modified: 2013-06-16 01:10 UTC
See Also:
GNOME target: ---
GNOME version: 3.5/3.6


Attachments
Bug 333265 - Open the folder of a search result or recent item (3.63 KB, patch)
2013-06-14 16:09 UTC, Garrett Regier
none Details | Review
Bug 333265 - Open the folder of a search result or recent item v2 (3.96 KB, patch)
2013-06-15 07:28 UTC, Garrett Regier
reviewed Details | Review
Bug 333265 - Open the folder of a search result or recent item v3 (5.07 KB, patch)
2013-06-16 00:53 UTC, Garrett Regier
committed Details | Review

Description Mårten Woxberg 2006-03-03 16:13:10 UTC
Please describe the problem:
When I get a hit in the search dialogue (not using any limitations to which
directory is searched) I want to be able to rightclick a file and click "Open
location" and nautilus would then open the folder that the file is located in.

I'm using beagle as the searchengine btw.

Steps to reproduce:
1. Search for anything
2. Rightclick the file
3. There is no "Open Location"


Actual results:
Nothing It's not there.

Expected results:
I would expect it to open the folder that the file is located in.

Does this happen every time?
Yes

Other information:
It would be great if the search could show it's results sorted by folder.
Or if in list view that a Path column is added.
Comment 1 Sergej Kotliar 2006-03-04 13:13:33 UTC
*** Bug 333267 has been marked as a duplicate of this bug. ***
Comment 2 Sergej Kotliar 2006-03-04 13:19:11 UTC
So - what you're asking for here is to be able to open the directory a search result is in, not the search directory that could be interpreted as the "stored search directory", or the vFolder. 
Retitling the bug, hope it's ok with you, otherwise please change it back.
And confirming.
Comment 3 Sergej Kotliar 2006-03-04 13:20:35 UTC
typo. sorry for the spam.
Comment 4 mannheim89 2006-03-31 01:33:05 UTC
From memory, that is the way that search works in Windows XP. The results are displayed in something like an ordinary window of the file browser, in what would be called "list view" in nautilus. The contextual-menu of each entry in the list has an item "Open containing folder ...", as this bug proposes.

In addition to not providing this option, the present nautilus gives the user no way to discover the containing folder of any item, other than by opening the "Properties" window for the item. (In Windows, the list-view window is given an extra column, for "In Folder".
Comment 5 Sebastien Bacher 2006-12-25 15:17:48 UTC
Ubuntu bug about that: https://launchpad.net/products/nautilus/+bug/70230
Comment 6 Magnus Boman 2008-03-19 09:59:36 UTC
Still an issue in 2.22 and Novell bug: https://bugzilla.novell.com/process_bug.cgi
Comment 7 Tim McCormack 2008-10-05 01:53:58 UTC
I think the problem has not been made sufficiently clear, so allow me to provide an example of this bug "in action":

I search for "tetris" in my home directory. Three files appear, all named "tetris.ss". One of these is my file, the others are provided by a locally-built application. How do I know which is mine?

I can open the Properties of each file, one at a time, until I determine which is which. But even that fails, since the directory name is cut off by the edge of the dialog box. I have to stretch the box to the edge of the screen to read the end of the path. (That's another bug, of course.)

This is why it is important to show the path in the search results.

I would also recommend showing only the relative path, if this is done -- you already know the directory path up to the current folder.
Comment 8 Cosimo Cecchi 2008-11-17 14:39:04 UTC
*** Bug 561148 has been marked as a duplicate of this bug. ***
Comment 9 André Klapper 2011-08-11 18:32:27 UTC
Still valid in 3.1.4.
Comment 10 Cosimo Cecchi 2012-05-01 12:50:05 UTC
*** Bug 675206 has been marked as a duplicate of this bug. ***
Comment 11 Asif Ali Rizvan 2012-05-01 15:27:55 UTC
I'm amazed, that a small yet useful feature which could be implement in a few minutes, is lying here for 6 years.

"Every detail matters" means only gnome-shell matters and not nautilus, search interface, and core apps?
http://live.gnome.org/EveryDetailMatters
Comment 12 Mårten Woxberg 2012-05-01 20:09:12 UTC
The problem is that this is labeled as an enhancement when it really is a usability bug...
Comment 13 Volker Sobek (weld) 2012-08-04 13:16:11 UTC
Now that nautilus 3.6 will start a search by default on typing this becomes crucial IMO. The search is rather useless because you can't:

1. Easily see a found file's path
2. Easily open the containing folder of any found file


Having a quick look at dolphin, for example, shows that the search result is presented in list-view with 2 columns, the second being the full path.

Also it has the options 'Open path in new tab/window' at the top of the context menu for each found file.

I'm not saying this is how it should be done in nautilus, just adding this as a reference.
Comment 14 William Jon McCann 2012-09-05 12:12:29 UTC
*** Bug 622789 has been marked as a duplicate of this bug. ***
Comment 15 Cosimo Cecchi 2013-04-25 20:40:32 UTC
*** Bug 681439 has been marked as a duplicate of this bug. ***
Comment 16 Garrett Regier 2013-06-14 16:09:31 UTC
Created attachment 246823 [details] [review]
Bug 333265 - Open the folder of a search result or recent item

Adds an "Open Folder" menu item to the top of the context menu when a search result or recent item is selected.

Note: I have not been able to test this with a recent item.
Comment 17 António Fernandes 2013-06-14 17:36:51 UTC
When I test it with a file in Recent, it will simply reload Recent, because Recent is the parent of that item. So, it "works", but that's not what we want it to do.

*** Warning: I-have-no-idea-what-I-am-doing ahead ***

I managed to make it do what we want with this hack:

	view = NAUTILUS_VIEW (callback_data);
	selection = nautilus_view_get_selection (view);
	file_location = nautilus_file_get_activation_location (NAUTILUS_FILE (selection->data));
	file = nautilus_file_get (file_location);
	folder = nautilus_file_get_parent (file);
Comment 18 Garrett Regier 2013-06-15 07:28:33 UTC
Created attachment 246878 [details] [review]
Bug 333265 - Open the folder of a search result or recent item v2

Thanks for the feedback, it now works with recent files.
Comment 19 Cosimo Cecchi 2013-06-16 00:21:45 UTC
Review of attachment 246878 [details] [review]:

Thanks for the patch! This looks mostly good, with some minor comments below.

::: src/nautilus-view.c
@@ +7157,3 @@
 				 G_CALLBACK (action_open_callback) },
+  /* name, stock id */         { NAUTILUS_ACTION_OPEN_FOLDER, NULL,
+  /* label, accelerator */       N_("Open Fol_der"), "<control><alt>o",

I'm not 100% sure about the string used here; I think "Open Item Location" might be a bit better.

@@ +8493,3 @@
+					      NAUTILUS_ACTION_OPEN_FOLDER);
+	if (selection_count == 1 &&
+	    (nautilus_file_is_in_recent (NAUTILUS_FILE (selection->data)) ||

Can you use the existing selection_contains_recent variable for this?

@@ +8495,3 @@
+	    (nautilus_file_is_in_recent (NAUTILUS_FILE (selection->data)) ||
+	     (view->details->model &&
+	      NAUTILUS_IS_SEARCH_DIRECTORY (view->details->model)))) {

It seems a similar check is done later in the same function - can you refactor this check into a boolean variable and use it from both places?
Comment 20 Garrett Regier 2013-06-16 00:53:50 UTC
Created attachment 246919 [details] [review]
Bug 333265 - Open the folder of a search result or recent item v3

(In reply to comment #19)
> Review of attachment 246878 [details] [review]:
> 
> Thanks for the patch! This looks mostly good, with some minor comments below.
> 
> ::: src/nautilus-view.c
> @@ +7157,3 @@
>                   G_CALLBACK (action_open_callback) },
> +  /* name, stock id */         { NAUTILUS_ACTION_OPEN_FOLDER, NULL,
> +  /* label, accelerator */       N_("Open Fol_der"), "<control><alt>o",
> 
> I'm not 100% sure about the string used here; I think "Open Item Location"
> might be a bit better.
> 

Done

> @@ +8493,3 @@
> +                          NAUTILUS_ACTION_OPEN_FOLDER);
> +    if (selection_count == 1 &&
> +        (nautilus_file_is_in_recent (NAUTILUS_FILE (selection->data)) ||
> 
> Can you use the existing selection_contains_recent variable for this?
> 

Fixed

> @@ +8495,3 @@
> +        (nautilus_file_is_in_recent (NAUTILUS_FILE (selection->data)) ||
> +         (view->details->model &&
> +          NAUTILUS_IS_SEARCH_DIRECTORY (view->details->model)))) {
> 
> It seems a similar check is done later in the same function - can you refactor
> this check into a boolean variable and use it from both places?

Fixed
Comment 21 Cosimo Cecchi 2013-06-16 00:56:40 UTC
Review of attachment 246919 [details] [review]:

Looks great! Do you have a GNOME git account?
Comment 22 Cosimo Cecchi 2013-06-16 01:00:04 UTC
Review of attachment 246919 [details] [review]:

Looks great! Do you have a GNOME git account?
Comment 23 Garrett Regier 2013-06-16 01:10:29 UTC
Yes, committed patch. Thanks for the reviews!


This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.