aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-12-04 01:32:46 +0800
committerMilan Crha <mcrha@redhat.com>2012-12-04 01:32:46 +0800
commit01a3fd26cdcbafa04e0d67d2be5d8dfb91a2c09b (patch)
tree9efee7e79e9bfd7d90dc51122d645b90fd46fedd /mail
parent2e07947a51153a9c8feddd9e28e81b8affa368ec (diff)
downloadgsoc2013-evolution-01a3fd26cdcbafa04e0d67d2be5d8dfb91a2c09b.tar
gsoc2013-evolution-01a3fd26cdcbafa04e0d67d2be5d8dfb91a2c09b.tar.gz
gsoc2013-evolution-01a3fd26cdcbafa04e0d67d2be5d8dfb91a2c09b.tar.bz2
gsoc2013-evolution-01a3fd26cdcbafa04e0d67d2be5d8dfb91a2c09b.tar.lz
gsoc2013-evolution-01a3fd26cdcbafa04e0d67d2be5d8dfb91a2c09b.tar.xz
gsoc2013-evolution-01a3fd26cdcbafa04e0d67d2be5d8dfb91a2c09b.tar.zst
gsoc2013-evolution-01a3fd26cdcbafa04e0d67d2be5d8dfb91a2c09b.zip
Bug #687503 - Improve error message »Failed to refresh folders«
Diffstat (limited to 'mail')
-rw-r--r--mail/mail-send-recv.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 7d4ebdaa1b..3118bf7a72 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -1046,18 +1046,33 @@ refresh_folders_exec (struct _refresh_folders_msg *m,
E_MAIL_SESSION (m->info->session),
m->folders->pdata[i], 0,
cancellable, &local_error);
- if (folder) {
- if (camel_folder_synchronize_sync (folder, FALSE, cancellable, &local_error))
- camel_folder_refresh_info_sync (folder, cancellable, &local_error);
- g_object_unref (folder);
- }
+ if (folder && camel_folder_synchronize_sync (folder, FALSE, cancellable, &local_error))
+ camel_folder_refresh_info_sync (folder, cancellable, &local_error);
if (local_error != NULL) {
- if (!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_warning ("Failed to refresh folder: %s: %s", (const gchar *) m->folders->pdata[i], local_error->message);
+ if (!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ const gchar *account_name = NULL, *full_name;
+
+ if (folder) {
+ CamelStore *store = camel_folder_get_parent_store (folder);
+
+ account_name = camel_service_get_display_name (CAMEL_SERVICE (store));
+ full_name = camel_folder_get_full_name (folder);
+ } else
+ full_name = (const gchar *) m->folders->pdata[i];
+
+ g_warning ("Failed to refresh folder '%s%s%s': %s",
+ account_name ? account_name : "",
+ account_name ? ": " : "",
+ full_name, local_error->message);
+ }
+
g_clear_error (&local_error);
}
+ if (folder)
+ g_object_unref (folder);
+
if (g_cancellable_is_cancelled (m->info->cancellable) ||
g_cancellable_is_cancelled (cancellable))
break;