[nautilus] files-view: pass proper type of file to validate_file_name



commit ab4f340d43b1e4f9d040c574a2470826e8c7b883
Author: Baptiste Mille-Mathias <baptistem gnome org>
Date:   Sat Sep 5 23:03:00 2015 +0200

    files-view: pass proper type of file to validate_file_name
    
    validate_file_name was called inconditionnaly with is_folder=TRUE, so
    the variable error_message didn't have the correct message for standard
    files.
    
    When calling validate_file_name, we now pass the boolean
    FileNameWidgetData->target_is_folder which inform if the validation is
    for a file or a directory.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754616

 src/nautilus-files-view.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 65c10ef..e122faa 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1876,7 +1876,7 @@ file_name_widget_entry_on_changed (gpointer user_data)
 
         data = (FileNameWidgetData *) user_data;
         name = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (data->name_entry))));
-        error_message = validate_file_name (name, TRUE);
+        error_message = validate_file_name (name, data->target_is_folder);
         gtk_label_set_label (GTK_LABEL (data->error_label), error_message);
 
         existing_file = nautilus_directory_get_file_by_name (data->view->details->model, name);
@@ -1995,7 +1995,7 @@ file_name_widget_on_activate (gpointer user_data)
         data = (FileNameWidgetData *) user_data;
         name = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (data->name_entry))));
         existing_file = nautilus_directory_get_file_by_name (data->view->details->model, name);
-        error_message = validate_file_name (name, TRUE);
+        error_message = validate_file_name (name, data->target_is_folder);
         valid_name = strlen (name) > 0 && error_message == NULL;
         duplicated = existing_file != NULL &&
                      (data->target_file == NULL ||


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]