diff options
author | Alexandru Fazakas <alex.fazakas97@yahoo.com> | 2018-02-19 17:33:27 +0200 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2018-03-24 20:24:28 +0200 |
commit | c6b6c0c73d84283d773e1ac40a55bfffdb31342b (patch) | |
tree | 28b35be2a0b91e2261584347b6705fb7e9c2c1da | |
parent | 44ba721a18ada4176ed24cf8bd4479c062660a16 (diff) | |
download | nautilus-c6b6c0c73d84283d773e1ac40a55bfffdb31342b.tar.gz |
files-view: Remove new empty folder name suggestion
When we choose to create a new empty folder, while selecting one or more
folders, Nautilus offers as suggestion the common filename prefix. In the case
of one selected folder, the suggestion is the name of the folder.
In this patch, we changed this so the common filename is displayed only in the
"with selection" case.
Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/206
-rw-r--r-- | src/nautilus-files-view.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 28e0475dc..0623e3b44 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -2047,9 +2047,8 @@ static void nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view, gboolean with_selection) { - NautilusDirectory *containing_directory; + g_autoptr (NautilusDirectory) containing_directory = NULL; NautilusFilesViewPrivate *priv; - GList *selection; g_autofree char *uri = NULL; g_autofree char *common_prefix = NULL; @@ -2063,8 +2062,13 @@ nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view, uri = nautilus_files_view_get_backing_uri (view); containing_directory = nautilus_directory_get_by_uri (uri); - selection = nautilus_view_get_selection (NAUTILUS_VIEW (view)); - common_prefix = nautilus_get_common_filename_prefix (selection, MIN_COMMON_FILENAME_PREFIX_LENGTH); + if (with_selection) + { + GList *selection; + selection = nautilus_view_get_selection (NAUTILUS_VIEW (view)); + common_prefix = nautilus_get_common_filename_prefix (selection, MIN_COMMON_FILENAME_PREFIX_LENGTH); + nautilus_file_list_free (selection); + } priv->new_folder_controller = nautilus_new_folder_dialog_controller_new (nautilus_files_view_get_containing_window (view), @@ -2080,9 +2084,6 @@ nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view, "cancelled", (GCallback) new_folder_dialog_controller_on_cancelled, view); - - nautilus_file_list_free (selection); - nautilus_directory_unref (containing_directory); } typedef struct |