From bf4a0dab77e39d4178d4f55dfce4c2839ba31a3e Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 14 Jan 2003 22:24:27 +0000 Subject: Call mail_config_save_accounts (). 2003-01-14 Jeffrey Stedfast * mail-account-gui.c (mail_account_gui_save): Call mail_config_save_accounts (). * mail-config.c (mail_config_save_accounts): New function to save accounts without having to re-load them. svn path=/trunk/; revision=19464 --- mail/mail-config.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'mail/mail-config.c') diff --git a/mail/mail-config.c b/mail/mail-config.c index 6017da17b6..ae2391b8f8 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -78,6 +78,7 @@ typedef struct { gboolean corrupt; GSList *accounts; + guint accounts_notify_id; GHashTable *threaded_hash; @@ -631,6 +632,17 @@ accounts_save (void) gconf_client_suggest_sync (config->gconf, NULL); } +void +mail_config_save_accounts (void) +{ + gconf_client_notify_remove (config->gconf, config->accounts_notify_id); + + accounts_save (); + + config->accounts_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/accounts", + accounts_changed, NULL, NULL, NULL); +} + /* Config struct routines */ void mail_config_init (void) @@ -644,8 +656,8 @@ mail_config_init (void) gconf_client_add_dir (config->gconf, "/apps/evolution/mail/accounts", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - gconf_client_notify_add (config->gconf, "/apps/evolution/mail/accounts", - accounts_changed, NULL, NULL, NULL); + config->accounts_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/accounts", + accounts_changed, NULL, NULL, NULL); config_read (); } @@ -1198,7 +1210,7 @@ mail_config_add_account (MailConfigAccount *account) { config->accounts = g_slist_append (config->accounts, account); - accounts_save (); + mail_config_save_accounts (); } const GSList * @@ -1222,7 +1234,7 @@ mail_config_remove_account (MailConfigAccount *account) config->accounts = g_slist_remove (config->accounts, account); account_destroy (account); - accounts_save (); + mail_config_save_accounts (); return config->accounts; } -- cgit