aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libemail-engine/mail-folder-cache.c13
-rw-r--r--mail/mail-send-recv.c13
2 files changed, 12 insertions, 14 deletions
diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c
index 2c832f501b..71dd237799 100644
--- a/libemail-engine/mail-folder-cache.c
+++ b/libemail-engine/mail-folder-cache.c
@@ -830,6 +830,7 @@ update_folders (CamelStore *store,
CamelFolderInfo *fi;
StoreInfo *si;
GError *error = NULL;
+ gboolean free_fi = TRUE;
fi = camel_store_get_folder_info_finish (store, result, &error);
@@ -857,14 +858,10 @@ update_folders (CamelStore *store,
si->first_update = FALSE;
}
- if (fi != NULL) {
- gboolean free_fi = TRUE;
-
- if (ud->done != NULL)
- free_fi = ud->done (ud->cache, store, fi, ud->data);
- if (free_fi)
- camel_store_free_folder_info (store, fi);
- }
+ if (ud->done != NULL)
+ free_fi = ud->done (ud->cache, store, fi, ud->data);
+ if (fi && free_fi)
+ camel_store_free_folder_info (store, fi);
if (ud->cancellable != NULL)
g_object_unref (ud->cancellable);
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 1670cf04c2..3657cfdfda 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -1008,17 +1008,18 @@ refresh_folders_exec (struct _refresh_folders_msg *m,
m->folders->pdata[i], 0,
cancellable, &local_error);
if (folder) {
- /* FIXME Not passing a GError here. */
- camel_folder_synchronize_sync (
- folder, FALSE, cancellable, NULL);
- camel_folder_refresh_info_sync (folder, cancellable, NULL);
+ if (camel_folder_synchronize_sync (folder, FALSE, cancellable, &local_error))
+ camel_folder_refresh_info_sync (folder, cancellable, &local_error);
g_object_unref (folder);
- } else if (local_error != NULL) {
+ }
+
+ if (local_error != NULL) {
g_warning ("Failed to refresh folders: %s", local_error->message);
g_clear_error (&local_error);
}
- if (g_cancellable_is_cancelled (m->info->cancellable))
+ if (g_cancellable_is_cancelled (m->info->cancellable) ||
+ g_cancellable_is_cancelled (cancellable))
break;
if (m->info->state != SEND_CANCELLED)