[evolution] Do not flush Outbox when mail shell backend not started



commit 744f785a9c70b860a23c9d8982e755caf99c9b2c
Author: Milan Crha <mcrha redhat com>
Date:   Fri Mar 4 10:00:26 2011 +0100

    Do not flush Outbox when mail shell backend not started

 mail/e-mail-backend.c   |    5 ++++-
 shell/e-shell-backend.c |   15 +++++++++++++++
 shell/e-shell-backend.h |    1 +
 3 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index d0631b1..fb2a384 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -280,7 +280,7 @@ mail_backend_prepare_for_quit_cb (EShell *shell,
 static void
 mail_backend_quit_requested_cb (EShell *shell,
                                 EShellQuitReason reason,
-                                EShellBackend *shell_backend)
+                                EShellBackend *mail_shell_backend)
 {
 	CamelFolder *folder;
 	GtkWindow *window;
@@ -301,6 +301,9 @@ mail_backend_quit_requested_cb (EShell *shell,
 		strcmp(e_shell_window_get_active_view((EShellWindow *)window), "mail") != 0)
 		return;
 
+	if (!e_shell_backend_is_started (mail_shell_backend))
+		return;
+
 	/* Check Outbox for any unsent messages. */
 
 	folder = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_OUTBOX);
diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c
index cd67284..03acc0e 100644
--- a/shell/e-shell-backend.c
+++ b/shell/e-shell-backend.c
@@ -508,6 +508,21 @@ e_shell_backend_start (EShellBackend *shell_backend)
 }
 
 /**
+ * e_shell_backend_is_started:
+ * @shell_backend: an #EShellBackend
+ *
+ * Returns whether was shelll_backend already started, by
+ * calling e_shell_backend_start().
+ **/
+gboolean
+e_shell_backend_is_started (EShellBackend *shell_backend)
+{
+	g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), FALSE);
+
+	return shell_backend->priv->started;
+}
+
+/**
  * e_shell_backend_migrate:
  * @shell_backend: an #EShellBackend
  * @major: major part of version to migrate from
diff --git a/shell/e-shell-backend.h b/shell/e-shell-backend.h
index 1810c8c..3364b16 100644
--- a/shell/e-shell-backend.h
+++ b/shell/e-shell-backend.h
@@ -127,6 +127,7 @@ void		e_shell_backend_add_activity	(EShellBackend *shell_backend,
 gboolean	e_shell_backend_is_busy		(EShellBackend *shell_backend);
 void		e_shell_backend_cancel_all	(EShellBackend *shell_backend);
 void		e_shell_backend_start		(EShellBackend *shell_backend);
+gboolean	e_shell_backend_is_started	(EShellBackend *shell_backend);
 gboolean	e_shell_backend_migrate		(EShellBackend *shell_backend,
 						 gint major,
 						 gint minor,



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