* Remove a g_return_if_fail in _selected_msg_sent_in_progress because
[modest] / src / modest-tny-account-store.c
index bd08cb1..0bc71a9 100644 (file)
@@ -324,7 +324,7 @@ on_account_removed (ModestAccountMgr *acc_mgr,
 {
        ModestTnyAccountStore *self = MODEST_TNY_ACCOUNT_STORE(user_data);
        TnyAccount *store_account;
-
+       
        /* Clear the account cache */
        store_account =
                modest_tny_account_store_get_server_account (self,
@@ -333,8 +333,9 @@ on_account_removed (ModestAccountMgr *acc_mgr,
        if (store_account) {
                tny_store_account_delete_cache (TNY_STORE_ACCOUNT (store_account));
                g_object_unref (store_account);
-       }
-
+       } else
+               g_printerr ("modest: cannot find server account for %s", account);
+       
        /* FIXME: make this more finegrained; changes do not
         * really affect _all_ accounts, and some do not
         * affect tny accounts at all (such as 'last_update')
@@ -352,11 +353,10 @@ on_account_changed (ModestAccountMgr *acc_mgr, const gchar *account,
 {
        ModestTnyAccountStore *self = MODEST_TNY_ACCOUNT_STORE(user_data);
        
-       #if 0
        /* Ignore the change if it's a change in the last_updated value */
-       if (g_str_has_suffix (key, MODEST_ACCOUNT_LAST_UPDATED))
+       if (g_slist_length ((GSList *)keys) == 1 &&
+           g_str_has_suffix ((const gchar *) keys->data, MODEST_ACCOUNT_LAST_UPDATED))
                return;
-       #endif
 
        /* FIXME: make this more finegrained; changes do not really affect _all_
         * accounts, and some do not affect tny accounts at all (such as 'last_update')
@@ -806,11 +806,13 @@ get_server_accounts  (TnyAccountStore *self, TnyList *list, TnyAccountType type)
                                g_object_ref (outbox_account);
                                accounts = g_slist_append (accounts, outbox_account);
                        }
+               }
+               
+               /* 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);
                        
-                       /* 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 (priv->store_accounts_outboxes) {
                        /* We have finished with this temporary list, so free it: */
                        account_list_free (priv->store_accounts_outboxes);
                        priv->store_accounts_outboxes = NULL;
@@ -971,7 +973,7 @@ modest_tny_account_store_alert (TnyAccountStore *self, TnyAlertType type,
                         * This is just so the testers can give us more information: */
                        /* prompt = _("Modest account not yet fully configured."); */
                        prompt = g_strdup_printf(
-                               "%s\n (Internal error message, often very misleading:\n%s", 
+                               "%s\n (Internal error message, often very misleading):\n%s", 
                                _("Incorrect Account Settings"), 
                                error->message);
                                
@@ -1174,10 +1176,10 @@ modest_tny_account_store_get_server_account (ModestTnyAccountStore *self,
                }
        } else {
                ModestAccountData *account_data;
-
                account_data = modest_account_mgr_get_account_data (priv->account_mgr, account_name);
                if (!account_data) {
-                       g_printerr ("modest: %s: cannot get account data for account '%s'\n", __FUNCTION__, account_name);
+                       g_printerr ("modest: %s: cannot get account data for account '%s'\n", __FUNCTION__,
+                                   account_name);
                        return NULL;
                }
 
@@ -1278,14 +1280,16 @@ modest_tny_account_store_get_transport_account_for_open_connection (ModestTnyAcc
        return account;
 }
 
-gboolean modest_tny_account_is_virtual_local_folders (TnyAccount *self)
+gboolean
+modest_tny_account_is_virtual_local_folders (TnyAccount *self)
 {
        /* We should make this more sophisticated if we ever use ModestTnyLocalFoldersAccount 
         * for anything else. */
        return MODEST_IS_TNY_LOCAL_FOLDERS_ACCOUNT (self);
 }
 
-TnyAccount* modest_tny_account_store_get_local_folders_account (TnyAccountStore *self)
+TnyAccount*
+modest_tny_account_store_get_local_folders_account (TnyAccountStore *self)
 {
        TnyAccount *account = NULL;
        ModestTnyAccountStorePrivate *priv;