aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-01-21 11:10:06 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-01-21 11:35:39 +0800
commita1beb5dc60b7b9877a45e978889d9734e9d3b99f (patch)
treebd0a984e8ce27808fae83e34095c5db431119b8c
parent31c51717f5b1c6154b8c4c67ee7f54c014f9abcc (diff)
downloadgsoc2013-evolution-a1beb5dc60b7b9877a45e978889d9734e9d3b99f.tar.gz
gsoc2013-evolution-a1beb5dc60b7b9877a45e978889d9734e9d3b99f.tar.zst
gsoc2013-evolution-a1beb5dc60b7b9877a45e978889d9734e9d3b99f.zip
EMailBackend: Make sure all background jobs have descriptions.
All background jobs should appear in the task bar with a description. Some CamelServices (esp. imapx) are submitting lots of background jobs but never pushing a status message on its CamelOperation. This commit is to flush them out so we can find and fix them, and also so we can clearly see what's *really* going on in the background. All background jobs are now given an initial generic description which should never appear in the user interface. The callback function must call camel_operation_push_message() to override it or else it's a bug.
-rw-r--r--mail/e-mail-backend.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 9e32b654d7..646b203aa1 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -30,6 +30,7 @@
#include <string.h>
#include <glib/gstdio.h>
+#include <glib/gi18n-lib.h>
#include <libedataserver/e-data-server-util.h>
#include <shell/e-shell.h>
@@ -632,6 +633,12 @@ mail_backend_job_started_cb (CamelSession *session,
priv = E_MAIL_BACKEND_GET_PRIVATE (shell_backend);
+ /* Make sure this operation shows up in the user interface.
+ * This message should get overridden, if not it's a bug in
+ * whatever CamelService submitted this. */
+ camel_operation_push_message (
+ cancellable, _("Unknown background operation"));
+
activity = e_activity_new ();
e_activity_set_cancellable (activity, cancellable);
e_shell_backend_add_activity (shell_backend, activity);
@@ -654,6 +661,9 @@ mail_backend_job_finished_cb (CamelSession *session,
priv = E_MAIL_BACKEND_GET_PRIVATE (shell_backend);
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ /* Pop the generic "background operation" message. */
+ camel_operation_pop_message (cancellable);
+
activity = g_hash_table_lookup (priv->jobs, cancellable);
description = e_activity_get_text (activity);