aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-10-11 10:36:54 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-10-11 10:36:54 +0800
commit36b34c1470005dd160464dff1227781d3deb687c (patch)
tree0ee31ac7e039a968076a92c63fa679dee8dcfc54 /mail
parent167d08a15e130cd3aee68d6956b8e66d8942a52e (diff)
downloadgsoc2013-evolution-36b34c1470005dd160464dff1227781d3deb687c.tar.gz
gsoc2013-evolution-36b34c1470005dd160464dff1227781d3deb687c.tar.zst
gsoc2013-evolution-36b34c1470005dd160464dff1227781d3deb687c.zip
Only set an account name if one doesn't already exist. Also use the
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. svn path=/trunk/; revision=18365
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);