Commit 06f91028 authored by Matthias Clasen's avatar Matthias Clasen

file chooser: Allow rename-to-self

When checking for a name clash for renaming, don't complain if the
name is unchanged. That's harmless.
parent 7c9e3df1
......@@ -1022,6 +1022,7 @@ check_valid_child_name (GtkFileChooserWidget *impl,
GFile *parent,
const gchar *name,
gboolean is_folder,
GFile *original,
GtkWidget *error_label,
GtkWidget *button)
{
......@@ -1056,6 +1057,11 @@ check_valid_child_name (GtkFileChooserWidget *impl,
gtk_label_set_text (GTK_LABEL (error_label), error->message);
g_error_free (error);
}
else if (original && g_file_equal (original, file))
{
gtk_widget_set_sensitive (button, TRUE);
g_object_unref (file);
}
else
{
struct FileExistsData *data;
......@@ -1106,6 +1112,7 @@ new_folder_name_changed (GtkEntry *entry,
priv->current_folder,
gtk_entry_get_text (entry),
TRUE,
NULL,
priv->new_folder_error_label,
priv->new_folder_create_button);
}
......@@ -1532,6 +1539,7 @@ rename_file_name_changed (GtkEntry *entry,
priv->current_folder,
gtk_entry_get_text (entry),
file_type == G_FILE_TYPE_DIRECTORY,
priv->rename_file_source_file,
priv->rename_file_error_label,
priv->rename_file_rename_button);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment