X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-tny-account-store.c;h=9c91ea0c300db42e8e095cb1cd5a0d691340b95a;hb=bc04644421a5bbf12abbf6f8bb2600b901e675b4;hp=9ed5db905974f89798d0e37383911c3ef19717ca;hpb=eec4b19f682dc36d0dcafd63b6058b979a98a1fc;p=modest diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 9ed5db9..9c91ea0 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -554,8 +554,11 @@ show_wrong_password_dialog (TnyAccount *account) gboolean created_dialog = FALSE; if (!found || !dialog) { + ModestAccountSettings *settings; dialog = modest_account_settings_dialog_new (); - modest_account_settings_dialog_set_account_name (dialog, modest_account_name); + settings = modest_account_mgr_load_account_settings (priv->account_mgr, modest_account_name); + modest_account_settings_dialog_set_account (dialog, settings); + g_object_unref (settings); modest_account_settings_dialog_switch_to_user_info (dialog); modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), GTK_WINDOW (dialog)); @@ -1201,6 +1204,8 @@ get_tny_account_by (TnyList *accounts, gboolean found = FALSE; TnyAccount *retval = NULL; + g_return_val_if_fail (accounts && TNY_IS_LIST(accounts), NULL); + iter = tny_list_create_iterator (accounts); while (!tny_iterator_is_done (iter) && !found) { TnyAccount *tmp_account = NULL; @@ -1337,14 +1342,16 @@ TnyAccount* modest_tny_account_store_get_smtp_specific_transport_account_for_open_connection (ModestTnyAccountStore *self, const gchar *account_name) { + TnyDevice *device; + + g_return_val_if_fail (self && MODEST_IS_TNY_ACCOUNT_STORE(self), NULL); + g_return_val_if_fail (account_name, NULL); + /* Get the current connection: */ - TnyDevice *device = modest_runtime_get_device (); + device = modest_runtime_get_device (); if (!tny_device_is_online (device)) return NULL; - - g_return_val_if_fail (self, NULL); - #ifdef MODEST_HAVE_CONIC g_return_val_if_fail (TNY_IS_MAEMO_CONIC_DEVICE (device), NULL); @@ -1654,14 +1661,6 @@ on_account_disconnect_when_removing (TnyCamelAccount *account, self = MODEST_TNY_ACCOUNT_STORE (user_data); priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE (self); - if (canceled || err) { - /* The account was not cancelled */ - } else { - /* Clear the cache if it's an store account */ - if (TNY_IS_STORE_ACCOUNT (account)) - tny_store_account_delete_cache (TNY_STORE_ACCOUNT (account)); - } - /* Remove it from the list of accounts */ if (TNY_IS_STORE_ACCOUNT (account)) tny_list_remove (priv->store_accounts, (GObject *) account); @@ -1674,6 +1673,10 @@ on_account_disconnect_when_removing (TnyCamelAccount *account, /* Unref the extra reference added by get_server_account */ g_object_unref (account); + + /* Clear the cache if it's an store account */ + if (TNY_IS_STORE_ACCOUNT (account)) + tny_store_account_delete_cache (TNY_STORE_ACCOUNT (account)); } static void