2007-06-07 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Thu, 7 Jun 2007 15:27:18 +0000 (15:27 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Thu, 7 Jun 2007 15:27:18 +0000 (15:27 +0000)
* 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
src/modest-tny-account-store.c

index 184e858..a9c0e7e 100644 (file)
@@ -1,5 +1,11 @@
 2007-06-07  Murray Cumming  <murrayc@murrayc.com>
 
+       * 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  <murrayc@murrayc.com>
+
        * 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.
 
index 7733aa8..f2e4314 100644 (file)
@@ -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) {