[evolution] EMailBackend: Make sure all background jobs have descriptions.



commit a1beb5dc60b7b9877a45e978889d9734e9d3b99f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Jan 20 22:10:06 2012 -0500

    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 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 9e32b65..646b203 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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]