From 81c667cb3b2f54effd51ba05ba0f15d2ffed4705 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 7 Jun 2007 15:27:18 +0000 Subject: [PATCH] 2007-06-07 Murray Cumming * src/modest-tny-account-store.c: (get_server_accounts): Create the local folders account only once, not once for each outbox, and not only when there are some outboxes. pmo-trunk-r2109 --- ChangeLog2 | 6 ++++++ src/modest-tny-account-store.c | 19 +++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog2 b/ChangeLog2 index 184e858..a9c0e7e 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,5 +1,11 @@ 2007-06-07 Murray Cumming + * src/modest-tny-account-store.c: (get_server_accounts): + Create the local folders account only once, not once for each outbox, and + not only when there are some outboxes. + +2007-06-07 Murray Cumming + * src/widgets/modest-folder-view.c: (update_model): Comment out some code that is causing a crash at startup. Sergio says that he is fixing this. diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 7733aa8..f2e4314 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -775,6 +775,11 @@ get_server_accounts (TnyAccountStore *self, TnyList *list, TnyAccountType type) create_per_account_local_outbox_folders (self); } + /* Also add the local folder pseudo-account: */ + TnyAccount *tny_account = + modest_tny_account_new_for_local_folders (priv->account_mgr, + priv->session, NULL); + /* Add them to the TnyList: */ if (priv->store_accounts_outboxes) { GSList *iter = NULL; @@ -787,24 +792,18 @@ get_server_accounts (TnyAccountStore *self, TnyList *list, TnyAccountType type) accounts = g_slist_append (accounts, outbox_account); } - - /* Also add the local folder pseudo-account: */ - TnyAccount *tny_account = - modest_tny_account_new_for_local_folders (priv->account_mgr, - priv->session, NULL); /* Add a merged folder, merging all the per-account outbox folders: */ modest_tny_local_folders_account_add_merged_outbox_folders ( MODEST_TNY_LOCAL_FOLDERS_ACCOUNT (tny_account), priv->store_accounts_outboxes); - if (list) - tny_list_prepend (list, G_OBJECT(tny_account)); - accounts = g_slist_append (accounts, tny_account); /* cache it */ - - /* We have finished with this temporary list, so free it: */ account_list_free (priv->store_accounts_outboxes); priv->store_accounts_outboxes = NULL; } + + if (list) + tny_list_prepend (list, G_OBJECT(tny_account)); + accounts = g_slist_append (accounts, tny_account); /* cache it */ } if (type == TNY_ACCOUNT_TYPE_STORE) { -- 1.7.9.5