diff options
author | Ernestas Kulik <ernestask@gnome.org> | 2017-08-09 14:16:42 +0300 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2017-08-09 23:26:34 +0300 |
commit | 351dc4147d08fbd6072a47cba7e8a553dad28082 (patch) | |
tree | 2d3dbe3ebfdf3c36ad2df8d3d27e8a2a10ca1148 | |
parent | 18ca2259f29033aa5b88b9f77349990816aff539 (diff) | |
download | nautilus-351dc4147d08fbd6072a47cba7e8a553dad28082.tar.gz |
files-view: fix “extract to” dialog in search
Currently, the file chooser dialog points to the base directory of the
archive when selecting the location for decompression. This poses a
problem when searching, as the file chooser is unable to display the
directory. This commit fixes that by showing the file chooser at the
base directory of the search.
https://bugzilla.gnome.org/show_bug.cgi?id=783090
-rw-r--r-- | src/nautilus-files-view.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 10e4a0c4e..b3ea59516 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -6453,7 +6453,24 @@ extract_files_to_chosen_location (NautilusFilesView *view, gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); - uri = nautilus_directory_get_uri (priv->model); + /* The file chooser will not be able to display the search directory, + * so we need to get the base directory of the search if we are, in fact, + * in search. + */ + if (nautilus_view_is_searching (NAUTILUS_VIEW (view))) + { + NautilusSearchDirectory *search_directory; + NautilusDirectory *directory; + + search_directory = NAUTILUS_SEARCH_DIRECTORY (priv->model); + directory = nautilus_search_directory_get_base_model (search_directory); + uri = nautilus_directory_get_uri (directory); + } + else + { + uri = nautilus_directory_get_uri (priv->model); + } + gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog), uri); data->view = view; |