aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-accounts.c
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-07-19 09:25:09 +0800
committerJacob Leach <jleach@src.gnome.org>2001-07-19 09:25:09 +0800
commitc87ef1f0a3302d89aacafcff22de49e442c18dc4 (patch)
treeade4574bee3d8204047b40ac6881d4cae5a5786b /mail/mail-accounts.c
parent150e7c57f8f542baf7e4f71caf38fe0d60c8917b (diff)
downloadgsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.tar
gsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.tar.gz
gsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.tar.bz2
gsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.tar.lz
gsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.tar.xz
gsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.tar.zst
gsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.zip
[Simplifying how default account is stored and used internally, fixes
2001-07-18 Jason Leach <jleach@ximian.com> [Simplifying how default account is stored and used internally, fixes possabilities of having multiple default accounts and things like deleting the current default account] * mail-account-gui.c (mail_account_gui_new): Update for new way of finding out the default account. (mail_account_gui_save): Ditto. * mail-accounts.c (load_accounts): Ditto. * mail-config-druid.c (make_default_account): Ditto. * mail-config.c: Added an int MailConfig::default_account, to be used instead of a 'default_account' boolean on each mail account. (mail_config_set_default_account_num): New function, facilitates things. * Mail.idl: removed the Account::default_account boolean. svn path=/trunk/; revision=11218
Diffstat (limited to 'mail/mail-accounts.c')
-rw-r--r--mail/mail-accounts.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c
index cbf20fa1db..d1abcb136d 100644
--- a/mail/mail-accounts.c
+++ b/mail/mail-accounts.c
@@ -110,15 +110,18 @@ load_accounts (MailAccountsDialog *dialog)
const MailConfigAccount *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 ();
+
while (node) {
CamelURL *url;
gchar *text[3];
-
+
account = node->data;
if (account->source && account->source->url)
@@ -129,7 +132,7 @@ load_accounts (MailAccountsDialog *dialog)
text[0] = (account->source && account->source->enabled) ? "+" : "";
text[1] = account->name;
text[2] = g_strdup_printf ("%s%s", url && url->protocol ? url->protocol : _("None"),
- account->default_account ? _(" (default)") : "");
+ (i == default_account) ? _(" (default)") : "");
if (url)
camel_url_free (url);
@@ -310,6 +313,7 @@ mail_delete (GtkButton *button, gpointer data)
len = dialog->accounts ? g_slist_length ((GSList *) dialog->accounts) : 0;
if (len > 0) {
row = sel >= len ? len - 1 : sel;
+ load_accounts (dialog);
gtk_clist_select_row (dialog->mail_accounts, row, 0);
} else {
dialog->accounts_row = -1;