summaryrefslogtreecommitdiff
path: root/src/nautilus-batch-rename-dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nautilus-batch-rename-dialog.c')
-rw-r--r--src/nautilus-batch-rename-dialog.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nautilus-batch-rename-dialog.c b/src/nautilus-batch-rename-dialog.c
index c3a4be26f..ddc1942a6 100644
--- a/src/nautilus-batch-rename-dialog.c
+++ b/src/nautilus-batch-rename-dialog.c
@@ -1354,10 +1354,12 @@ have_unallowed_character (NautilusBatchRenameDialog *dialog)
GList *names;
GString *new_name;
const gchar *entry_text;
+ gboolean have_empty_name;
gboolean have_unallowed_character_slash;
gboolean have_unallowed_character_dot;
gboolean have_unallowed_character_dotdot;
+ have_empty_name = FALSE;
have_unallowed_character_slash = FALSE;
have_unallowed_character_dot = FALSE;
have_unallowed_character_dotdot = FALSE;
@@ -1404,6 +1406,12 @@ have_unallowed_character (NautilusBatchRenameDialog *dialog)
{
new_name = names->data;
+ if (g_strcmp0 (new_name->str, "") == 0)
+ {
+ have_empty_name = TRUE;
+ break;
+ }
+
if (g_strcmp0 (new_name->str, "..") == 0)
{
have_unallowed_character_dotdot = TRUE;
@@ -1412,6 +1420,12 @@ have_unallowed_character (NautilusBatchRenameDialog *dialog)
}
}
+ if (have_empty_name)
+ {
+ gtk_label_set_label (GTK_LABEL (dialog->conflict_label),
+ _("A file must have a name"));
+ }
+
if (have_unallowed_character_slash)
{
gtk_label_set_label (GTK_LABEL (dialog->conflict_label),
@@ -1430,7 +1444,8 @@ have_unallowed_character (NautilusBatchRenameDialog *dialog)
"“..” is an unallowed file name");
}
- if (have_unallowed_character_slash || have_unallowed_character_dot || have_unallowed_character_dotdot)
+ if (have_unallowed_character_slash || have_unallowed_character_dot || have_unallowed_character_dotdot
+ || have_empty_name)
{
gtk_widget_set_sensitive (dialog->rename_button, FALSE);
gtk_widget_set_sensitive (dialog->conflict_down, FALSE);