chars = gtk_editable_get_chars (editable, 0, -1);
g_return_if_fail (chars != NULL);
- /* Dimm OK button */
- if (strlen (chars) == 0) {
+ /* Dimm OK button. Do not allow also the "/" */
+ if (strlen (chars) == 0 || strchr (chars, '/')) {
GtkWidget *ok_button;
GList *buttons;
}
}
+ if (!strcmp (name, " ") || strchr (name, '/')) {
+ priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED;
+ g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR,
+ MODEST_MAIL_OPERATION_ERROR_FOLDER_RULES,
+ _("mail_in_ui_folder_create_error"));
+ }
+
if (!priv->error) {
/* Create the folder */
new_folder = tny_folder_store_create_folder (parent, name, &(priv->error));
/* Notify about operation end */
modest_mail_operation_notify_end (self, FALSE);
+ } else if (!strcmp (name, " ") || strchr (name, '/')) {
+ priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED;
+ g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR,
+ MODEST_MAIL_OPERATION_ERROR_FOLDER_RULES,
+ _("FIXME: unable to rename"));
+ /* Notify about operation end */
+ modest_mail_operation_notify_end (self, FALSE);
} else {
- /* Rename. Camel handles folder subscription/unsubscription */
TnyFolderStore *into;
+ /* Rename. Camel handles folder subscription/unsubscription */
into = tny_folder_get_folder_store (folder);
tny_folder_copy_async (folder, into, name, TRUE,
transfer_folder_cb,
transfer_folder_status_cb,
self);
if (into)
- g_object_unref (into);
-
+ g_object_unref (into);
}
}