[evolution/gnome-2-28] Bug #596566 - Crash on quit with composer window opened
- From: Milan Crha <mcrha src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution/gnome-2-28] Bug #596566 - Crash on quit with composer window opened
- Date: Wed, 18 Nov 2009 11:24:49 +0000 (UTC)
commit bd2c2a77bb891c2b269c7027820085dd6dbf5672
Author: Milan Crha <mcrha redhat com>
Date: Wed Nov 18 12:24:10 2009 +0100
Bug #596566 - Crash on quit with composer window opened
composer/e-composer-autosave.c | 3 +++
composer/e-msg-composer.c | 25 +++++++++++++++++++------
composer/e-msg-composer.h | 4 +++-
mail/mail-component.c | 7 +++++--
4 files changed, 30 insertions(+), 9 deletions(-)
---
diff --git a/composer/e-composer-autosave.c b/composer/e-composer-autosave.c
index bc4c92d..f160a69 100644
--- a/composer/e-composer-autosave.c
+++ b/composer/e-composer-autosave.c
@@ -473,6 +473,9 @@ e_composer_autosave_snapshot_finish (EMsgComposer *composer,
g_simple_async_result_propagate_error (simple, error);
g_object_unref (simple);
+ if (e_msg_composer_is_exiting (composer))
+ e_msg_composer_close (composer);
+
return success;
}
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 64f565d..3bdec69 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -3931,12 +3931,12 @@ e_msg_composer_is_exiting (EMsgComposer *composer)
void
e_msg_composer_request_close (EMsgComposer *composer)
{
- g_return_val_if_fail (composer != NULL, FALSE);
+ g_return_if_fail (composer != NULL);
composer->priv->application_exiting = TRUE;
}
-gboolean
+void
e_msg_composer_request_close_all (void)
{
GSList *iter, *next;
@@ -3960,9 +3960,20 @@ e_msg_composer_request_close_all (void)
e_composer_autosave_snapshot_async (composer,
(GAsyncReadyCallback) e_composer_autosave_snapshot_finish,
NULL);
- gtk_action_activate (ACTION (CLOSE));
}
+}
+
+void
+e_msg_composer_close (EMsgComposer *composer)
+{
+ g_return_if_fail (composer != NULL);
+ gtk_action_activate (ACTION (CLOSE));
+}
+
+gboolean
+e_msg_composer_all_closed (void)
+{
return (all_composers == NULL);
}
@@ -4195,14 +4206,16 @@ e_save_spell_languages (GList *spell_languages)
}
}
-void e_msg_composer_set_mail_sent (EMsgComposer *composer, gboolean mail_sent)
+void
+e_msg_composer_set_mail_sent (EMsgComposer *composer, gboolean mail_sent)
{
- g_return_val_if_fail (composer != NULL, FALSE);
+ g_return_if_fail (composer != NULL);
composer->priv->mail_sent = mail_sent;
}
-gboolean e_msg_composer_get_mail_sent (EMsgComposer *composer)
+gboolean
+e_msg_composer_get_mail_sent (EMsgComposer *composer)
{
g_return_val_if_fail (composer != NULL, FALSE);
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index 93db807..1d8560c 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -138,7 +138,9 @@ void e_msg_composer_add_message_attachments
gboolean just_inlines);
void e_msg_composer_request_close (EMsgComposer *composer);
-gboolean e_msg_composer_request_close_all(void);
+void e_msg_composer_request_close_all(void);
+void e_msg_composer_close (EMsgComposer *composer);
+gboolean e_msg_composer_all_closed (void);
EMsgComposer * e_msg_composer_load_from_file (const gchar *filename);
void e_msg_composer_check_autosave (GtkWindow *parent);
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 95e14ea..faccc04 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -829,8 +829,7 @@ impl_requestQuit(PortableServer_Servant servant, CORBA_Environment *ev)
CamelFolder *folder;
guint32 unsent;
- if (!e_msg_composer_request_close_all())
- return FALSE;
+ e_msg_composer_request_close_all ();
folder = mc_default_folders[MAIL_COMPONENT_FOLDER_OUTBOX].folder;
if (folder != NULL
@@ -921,6 +920,10 @@ impl_quit(PortableServer_Servant servant, CORBA_Environment *ev)
if (mc->priv->quit_count > 0 || mc->priv->mail_sync_in_progress > 0)
return FALSE;
+ /* messages are autosaved, there is no prompt for cancelling */
+ if (!e_msg_composer_all_closed ())
+ return FALSE;
+
mail_cancel_all();
mc->priv->quit_state = MC_QUIT_THREADS;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]