From 728677a50b2f8f0fd7e8d70f5502e6d36f679a2f Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 30 Jan 2004 22:16:48 +0000 Subject: Fixes for bug #53348 2004-01-30 Jeffrey Stedfast Fixes for bug #53348 * mail-account-gui.c (mail_account_gui_save): Only add the new store to the mail-component if the mail-component doesn't already know about it (ie. only if we are adding a new account). * em-folder-tree-model.c (em_folder_tree_model_add_store): Hash our store-info based on account here. (em_folder_tree_model_init): Listen for account_changed/account_removed signals. (em_folder_tree_model_finalize): Disconnect above handlers. (account_changed): Tear down the account store node and replace it with the new store (assuming it belongs in the tree after the changes). (account_removed): Remove the account store from the tree. svn path=/trunk/; revision=24551 --- mail/mail-account-gui.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'mail/mail-account-gui.c') diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c index b24ac827d5..6e35041438 100644 --- a/mail/mail-account-gui.c +++ b/mail/mail-account-gui.c @@ -2046,15 +2046,6 @@ mail_account_gui_save (MailAccountGui *gui) if (!mail_config_find_account (account)) { /* this is a new account so add it to our account-list */ is_new = TRUE; - } else if (account->source->url) { - /* this means the account was edited - if the old and - new source urls are not identical, replace the old - store with the new store */ -#define sources_equal(old,new) (new->url && !strcmp (old->url, new->url)) - if (!sources_equal (account->source, new->source)) { - /* Remove the old store from the folder-tree */ - mail_component_remove_store_by_uri (mail_component_peek (), account->source->url); - } } /* update the old account with the new settings */ @@ -2063,17 +2054,17 @@ mail_account_gui_save (MailAccountGui *gui) if (is_new) { mail_config_add_account (account); + + /* if the account provider is something we can stick + in the folder-tree and not added by some other + component, then get the CamelStore and add it to + the folder-tree */ + if (is_storage && account->enabled) + mail_get_store (account->source->url, NULL, add_new_store, account); } else { e_account_list_change (mail_config_get_accounts (), account); } - /* if the account provider is something we can stick - in the folder-tree and not added by some other - component, then get the CamelStore and add it to - the folder-tree */ - if (is_storage && account->enabled) - mail_get_store (account->source->url, NULL, add_new_store, account); - if (gtk_toggle_button_get_active (gui->default_account)) mail_config_set_default_account (account); -- cgit v1.2.3