[nautilus] files-view: display search base for file chooser
- From: Alexandru-Ionut Pandelea <alexpandelea src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] files-view: display search base for file chooser
- Date: Wed, 22 Mar 2017 20:37:53 +0000 (UTC)
commit b57d5923d7692df1bbfb9eb543ce4159da564aae
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date: Mon Mar 20 01:11:02 2017 +0200
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
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 3f2b9fb..e6c7e16 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -5949,6 +5949,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);
@@ -6000,7 +6001,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",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]