GNOME Bugzilla – Bug 333265
Open the directory of a search result/recent file
Last modified: 2013-06-16 01:10:48 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.
*** Bug 333267 has been marked as a duplicate of this bug. ***
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.
typo. sorry for the spam.
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".
Ubuntu bug about that: https://launchpad.net/products/nautilus/+bug/70230
Still an issue in 2.22 and Novell bug: https://bugzilla.novell.com/process_bug.cgi
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.
*** Bug 561148 has been marked as a duplicate of this bug. ***
Still valid in 3.1.4.
*** Bug 675206 has been marked as a duplicate of this bug. ***
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
The problem is that this is labeled as an enhancement when it really is a usability bug...
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.
*** Bug 622789 has been marked as a duplicate of this bug. ***
*** Bug 681439 has been marked as a duplicate of this bug. ***
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.
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);
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.
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?
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
Review of attachment 246919 [details] [review]: Looks great! Do you have a GNOME git account?
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.