From 70ebdb57030c1f92b1ef872debd4023040749f0a Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Tue, 20 Nov 2007 15:13:50 +0000 Subject: [PATCH] * src/maemo/modest-platform.c: * Now we check in on_response of new name for folder dialog also if we're setting a name of a special local folder (fixes NB#76506). pmo-trunk-r3781 --- src/maemo/modest-platform.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index e263cfd..8e4ee23 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -50,6 +50,7 @@ #include #include #include "modest-tny-folder.h" +#include "modest-tny-account.h" #include #include @@ -714,23 +715,40 @@ on_response (GtkDialog *dialog, GList *child_vbox, *child_hbox; GtkWidget *hbox, *entry; TnyFolderStore *parent; + const gchar *new_name; + gboolean exists; if (response != GTK_RESPONSE_ACCEPT) return; - + /* Get entry */ child_vbox = gtk_container_get_children (GTK_CONTAINER (dialog->vbox)); hbox = child_vbox->data; child_hbox = gtk_container_get_children (GTK_CONTAINER (hbox)); entry = child_hbox->next->data; - + parent = TNY_FOLDER_STORE (user_data); - + new_name = gtk_entry_get_text (GTK_ENTRY (entry)); + exists = FALSE; + /* Look for another folder with the same name */ if (modest_tny_folder_has_subfolder_with_name (parent, - gtk_entry_get_text (GTK_ENTRY (entry)), + new_name, TRUE)) { - + exists = TRUE; + } + + if (!exists) { + if (TNY_IS_ACCOUNT (parent) && + modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (parent)) && + modest_tny_local_folders_account_folder_name_in_use (MODEST_TNY_LOCAL_FOLDERS_ACCOUNT (parent), + new_name)) { + exists = TRUE; + } + } + + if (exists) { + /* Show an error */ hildon_banner_show_information (gtk_widget_get_parent (GTK_WIDGET (dialog)), NULL, _CS("ckdg_ib_folder_already_exists")); -- 1.7.9.5