aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/mail-config-druid.c40
2 files changed, 29 insertions, 18 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index f9d923ce8e..7b57e448de 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2002-10-10 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-config-druid.c (management_prepare): Only set an account
+ name if one doesn't already exist. Also use the
+ e_utf8_gtk_entry_get/set_text functions since account names are
+ supposed to be in UTF8. Fixes bug #31891.
+
2002-10-09 Jeffrey Stedfast <fejj@ximian.com>
* folder-browser.c (main_folder_changed): Don't do anything if the
diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c
index 245516d993..5d4ff66b86 100644
--- a/mail/mail-config-druid.c
+++ b/mail/mail-config-druid.c
@@ -413,28 +413,32 @@ static void
management_prepare (EvolutionWizard *wizard, gpointer data)
{
MailConfigWizard *gui = data;
- const char *name;
+ const char *name, *text;
gui->page = MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT;
- name = gtk_entry_get_text (gui->gui->email_address);
- if (name && *name) {
- if (mail_config_get_account_by_name (name)) {
- char *template;
- unsigned int i = 1, len;
+
+ text = gtk_entry_get_text (gui->gui->account_name);
+ if (!text || *text == '\0') {
+ name = e_utf8_gtk_entry_get_text (gui->gui->email_address);
+ if (name && *name) {
+ if (mail_config_get_account_by_name (name)) {
+ char *template;
+ unsigned int i = 1, len;
+
+ /* length of name + 1 char for ' ' + 1 char
+ for '(' + 10 chars for %d + 1 char for ')'
+ + 1 char for nul */
+ len = strlen (name);
+ template = alloca (len + 14);
+ strcpy (template, name);
+ name = template;
+ do {
+ sprintf (template + len, " (%d)", i++);
+ } while (mail_config_get_account_by_name (name) && i != 0);
+ }
- /* length of name + 1 char for ' ' + 1 char
- for '(' + 10 chars for %d + 1 char for ')'
- + 1 char for nul */
- len = strlen (name);
- template = alloca (len + 14);
- strcpy (template, name);
- name = template;
- do {
- sprintf (template + len, " (%d)", i++);
- } while (mail_config_get_account_by_name (name) && i != 0);
+ e_utf8_gtk_entry_set_text (gui->gui->account_name, name);
}
-
- gtk_entry_set_text (gui->gui->account_name, name);
}
management_check (gui);