g_free (txt);
}
-
-
-
static void
foreach_account_append_to_list (gpointer data,
gpointer user_data)
{
/* This is easier than using a struct for the user_data: */
ModestTnyAccountStore *self = modest_runtime_get_account_store();
- GtkWidget *main_window;
GtkWidget *dialog = NULL;
- main_window = (GtkWidget *) modest_window_mgr_get_main_window (modest_runtime_get_window_mgr (),
- FALSE); /* don't create */
- if (!main_window) {
- g_warning ("%s: password was wrong; ignoring because no main window", __FUNCTION__);
- return;
- }
-
if (g_object_get_data (G_OBJECT (account), "connection_specific") != NULL) {
modest_ui_actions_on_smtp_servers (NULL, NULL);
} else {
priv->session = NULL;
}
- camel_shutdown ();
-
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN;
const gchar* server_name = "";
gchar *prompt = NULL;
- gboolean retval;
+ gboolean retval = TRUE;
/* NOTE: account may be NULL in some cases */
g_return_val_if_fail (error, FALSE);
if (error->code == TNY_SERVICE_ERROR_CERTIFICATE)
retval = modest_platform_run_certificate_confirmation_dialog (server_name,
error->message);
- else {
+ else if (error->code == TNY_SERVICE_ERROR_AUTHENTICATE) {
modest_platform_run_information_dialog (NULL, prompt, TRUE);
/* Show the account dialog if it was wrong */
retval = TRUE;
}
+ g_debug ("%s: error code %d (%s", __FUNCTION__, error->code, error->message);
if (prompt)
g_free (prompt);
on_account_disconnect_when_removing, self);
}
+static gboolean
+images_cache_remove_filter (TnyStreamCache *self, const gchar *id, const gchar *account_name)
+{
+ gchar *account_name_with_separator;
+ gboolean result;
+ if (account_name == NULL || account_name[0] == '\0')
+ return FALSE;
+
+ if (id == NULL || id[0] == '\0')
+ return FALSE;
+
+ account_name_with_separator = g_strconcat (account_name, "__", NULL);
+
+ result = (g_str_has_prefix (id, account_name));
+ g_free (account_name_with_separator);
+
+ return result;
+}
+
static void
on_account_removed (ModestAccountMgr *acc_mgr,
const gchar *account,
TnyAccount *store_account = NULL, *transport_account = NULL;
ModestTnyAccountStore *self;
ModestTnyAccountStorePrivate *priv;
+ TnyStreamCache *stream_cache;
self = MODEST_TNY_ACCOUNT_STORE (user_data);
priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE (self);
__FUNCTION__, account);
}
+ /* Remove cached images */
+ stream_cache = modest_runtime_get_images_cache ();
+ tny_stream_cache_remove (stream_cache, (TnyStreamCacheRemoveFilter) images_cache_remove_filter, (gpointer) account);
+
/* If there are no more user accounts then delete the
transport specific SMTP servers */
if (only_local_accounts (self))