diff options
author | Alexandru Pandelea <alexandru.pandelea@gmail.com> | 2017-03-20 01:11:02 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2017-04-22 17:15:22 +0200 |
commit | 28dd203d02317e6f5da7d7655ab4a5db6a571e5f (patch) | |
tree | f8465fb4f05d6ea655b6688e6b4548261ebcd39e | |
parent | 314ad2c43135960b84d022abf87aa5df76075544 (diff) | |
download | nautilus-28dd203d02317e6f5da7d7655ab4a5db6a571e5f.tar.gz |
files-view: display search base for file chooser
Currently when the move to/copy to file chooser dialog is launched
during search, the dialog shows an error as the location is invalid.
Change this so that the base of the search is displayed in the dialog
when this dialog is launched while searching.
https://bugzilla.gnome.org/show_bug.cgi?id=778113
-rw-r--r-- | src/nautilus-files-view.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 0bb513ee6..a305ef873 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -5956,6 +5956,7 @@ copy_or_move_selection (NautilusFilesView *view, CopyCallbackData *copy_data; GList *selection; const gchar *title; + NautilusDirectory *directory; priv = nautilus_files_view_get_instance_private (view); @@ -6007,7 +6008,17 @@ copy_or_move_selection (NautilusFilesView *view, gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter); } - uri = nautilus_directory_get_uri (priv->model); + + if (nautilus_view_is_searching (NAUTILUS_VIEW (view))) + { + directory = nautilus_search_directory_get_base_model (NAUTILUS_SEARCH_DIRECTORY (priv->model)); + 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); g_free (uri); g_signal_connect (dialog, "current-folder-changed", |