aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config-druid.c
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/mail-config-druid.c
parent167d08a15e130cd3aee68d6956b8e66d8942a52e (diff)
downloadgsoc2013-evolution-36b34c1470005dd160464dff1227781d3deb687c.tar
gsoc2013-evolution-36b34c1470005dd160464dff1227781d3deb687c.tar.gz
gsoc2013-evolution-36b34c1470005dd160464dff1227781d3deb687c.tar.bz2
gsoc2013-evolution-36b34c1470005dd160464dff1227781d3deb687c.tar.lz
gsoc2013-evolution-36b34c1470005dd160464dff1227781d3deb687c.tar.xz
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/mail-config-druid.c')
-rw-r--r--mail/mail-config-druid.c40
1 files changed, 22 insertions, 18 deletions
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);