From 24364797eff3d4416fa93fa860bfdd79349a0b23 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 21 Sep 2001 00:58:28 +0000 Subject: Do not add the account here as this is taken care of in 2001-09-20 Jeffrey Stedfast * mail-config-druid.c (wizard_finish_cb): Do not add the account here as this is taken care of in mail_account_gui_save() since it has to be able to set the default account. * mail-config.c (mail_config_set_default_account): Don't allow the index to become invalid. * mail-account-gui.c (mail_account_gui_save): Add the account before setting it as the default. svn path=/trunk/; revision=13037 --- mail/mail-accounts.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'mail/mail-accounts.c') diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index 391d4f0aaa..5e3086182d 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -117,20 +117,19 @@ mail_accounts_dialog_finalise (GtkObject *obj) static void load_accounts (MailAccountsDialog *dialog) { - const MailConfigAccount *account; + const MailConfigAccount *account, *default_account; const GSList *node = dialog->accounts; int i = 0; - int default_account; - + gtk_clist_freeze (dialog->mail_accounts); gtk_clist_clear (dialog->mail_accounts); - default_account = mail_config_get_default_account_num (); - + default_account = mail_config_get_default_account (); + while (node) { CamelURL *url; - gchar *text[3]; + char *text[3]; account = node->data; @@ -142,7 +141,7 @@ load_accounts (MailAccountsDialog *dialog) text[0] = ""; text[1] = e_utf8_to_gtk_string (GTK_WIDGET (dialog->mail_accounts), account->name); text[2] = g_strdup_printf ("%s%s", url && url->protocol ? url->protocol : _("None"), - (i == default_account) ? _(" (default)") : ""); + (account == default_account) ? _(" (default)") : ""); if (url) camel_url_free (url); @@ -155,7 +154,7 @@ load_accounts (MailAccountsDialog *dialog) gtk_clist_set_pixmap (dialog->mail_accounts, i, 0, dialog->mark_pixmap, dialog->mark_bitmap); - + /* set the account on the row */ gtk_clist_set_row_data (dialog->mail_accounts, i, (gpointer) account); @@ -164,7 +163,7 @@ load_accounts (MailAccountsDialog *dialog) } gtk_clist_thaw (dialog->mail_accounts); - + /* * The selection gets cleared when we rebuild the clist, but no * unselect event is emitted. So we simulate it here. @@ -180,7 +179,7 @@ mail_select (GtkCList *clist, gint row, gint column, GdkEventButton *event, gpoi { MailAccountsDialog *dialog = data; MailConfigAccount *account = gtk_clist_get_row_data (clist, row); - + dialog->accounts_row = row; gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_edit), TRUE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_delete), TRUE); -- cgit v1.2.3