From a1beb5dc60b7b9877a45e978889d9734e9d3b99f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 20 Jan 2012 22:10:06 -0500 Subject: 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. --- mail/e-mail-backend.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mail/e-mail-backend.c') 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 #include +#include #include #include @@ -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); -- cgit v1.2.3