[evolution/f16] Add patch for RH bug #799489 (set composer dirty on failed send)

Milan Crha mcrha at fedoraproject.org
Wed Mar 7 07:41:24 UTC 2012


commit 28c507358dd150bd5346e02843a33e8a15229cb1
Author: Milan Crha <mcrha at redhat.com>
Date:   Wed Mar 7 08:41:05 2012 +0100

    Add patch for RH bug #799489 (set composer dirty on failed send)

 evolution-3.2.3-composer-dirty.patch |  128 ++++++++++++++++++++++++++++++++++
 evolution.spec                       |    9 ++-
 2 files changed, 136 insertions(+), 1 deletions(-)
---
diff --git a/evolution-3.2.3-composer-dirty.patch b/evolution-3.2.3-composer-dirty.patch
new file mode 100644
index 0000000..4887c41
--- /dev/null
+++ b/evolution-3.2.3-composer-dirty.patch
@@ -0,0 +1,128 @@
+diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
+index 9f32d8c..c9f41d5 100644
+--- a/composer/e-msg-composer.c
++++ b/composer/e-msg-composer.c
+@@ -3518,6 +3518,10 @@ msg_composer_send_cb (EMsgComposer *composer,
+ 
+ 	g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
+ 
++	/* The callback can set editor 'changed' if anything failed. */
++	editor = GTKHTML_EDITOR (composer);
++	gtkhtml_editor_set_changed (editor, FALSE);
++
+ 	g_signal_emit (
+ 		composer, signals[SEND], 0,
+ 		message, context->activity);
+@@ -3525,10 +3529,6 @@ msg_composer_send_cb (EMsgComposer *composer,
+ 	g_object_unref (message);
+ 
+ 	async_context_free (context);
+-
+-	/* XXX This should be elsewhere. */
+-	editor = GTKHTML_EDITOR (composer);
+-	gtkhtml_editor_set_changed (editor, FALSE);
+ }
+ 
+ /**
+@@ -3610,6 +3610,10 @@ msg_composer_save_to_drafts_cb (EMsgComposer *composer,
+ 
+ 	g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
+ 
++	/* The callback can set editor 'changed' if anything failed. */
++	editor = GTKHTML_EDITOR (composer);
++	gtkhtml_editor_set_changed (editor, FALSE);
++
+ 	g_signal_emit (
+ 		composer, signals[SAVE_TO_DRAFTS],
+ 		0, message, context->activity);
+@@ -3617,10 +3621,6 @@ msg_composer_save_to_drafts_cb (EMsgComposer *composer,
+ 	g_object_unref (message);
+ 
+ 	async_context_free (context);
+-
+-	/* XXX This should be elsewhere. */
+-	editor = GTKHTML_EDITOR (composer);
+-	gtkhtml_editor_set_changed (editor, FALSE);
+ }
+ 
+ /**
+diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
+index 23c1755..ef5476f 100644
+--- a/mail/em-composer-utils.c
++++ b/mail/em-composer-utils.c
+@@ -510,11 +510,13 @@ composer_send_completed (EMailSession *session,
+                          AsyncContext *context)
+ {
+ 	GError *error = NULL;
++	gboolean set_changed = FALSE;
+ 
+ 	e_mail_session_send_to_finish (session, result, &error);
+ 
+ 	if (e_activity_handle_cancellation (context->activity, error)) {
+ 		g_error_free (error);
++		set_changed = TRUE;
+ 		goto exit;
+ 	}
+ 
+@@ -549,6 +551,7 @@ composer_send_completed (EMailSession *session,
+ 		if (response == GTK_RESPONSE_ACCEPT)  /* Save to Outbox */
+ 			e_msg_composer_save_to_outbox (context->composer);
+ 		g_error_free (error);
++		set_changed = TRUE;
+ 		goto exit;
+ 	}
+ 
+@@ -561,6 +564,9 @@ composer_send_completed (EMailSession *session,
+ 		gtk_widget_destroy, context->composer);
+ 
+ exit:
++	if (set_changed)
++		gtkhtml_editor_set_changed (GTKHTML_EDITOR (context->composer), TRUE);
++
+ 	async_context_free (context);
+ }
+ 
+@@ -649,9 +655,11 @@ composer_save_to_drafts_complete (EMailSession *session,
+ 	e_mail_session_handle_draft_headers_finish (session, result, &error);
+ 
+ 	if (e_activity_handle_cancellation (context->activity, error)) {
++		gtkhtml_editor_set_changed (GTKHTML_EDITOR (context->composer), TRUE);
+ 		g_error_free (error);
+ 
+ 	} else if (error != NULL) {
++		gtkhtml_editor_set_changed (GTKHTML_EDITOR (context->composer), TRUE);
+ 		g_warning ("%s", error->message);
+ 		g_error_free (error);
+ 
+@@ -688,6 +696,7 @@ composer_save_to_drafts_cleanup (CamelFolder *drafts_folder,
+ 
+ 	if (e_activity_handle_cancellation (context->activity, error)) {
+ 		g_warn_if_fail (context->message_uid == NULL);
++		gtkhtml_editor_set_changed (GTKHTML_EDITOR (context->composer), TRUE);
+ 		async_context_free (context);
+ 		g_error_free (error);
+ 		return;
+@@ -698,6 +707,7 @@ composer_save_to_drafts_cleanup (CamelFolder *drafts_folder,
+ 			alert_sink,
+ 			"mail-composer:save-to-drafts-error",
+ 			error->message, NULL);
++		gtkhtml_editor_set_changed (GTKHTML_EDITOR (context->composer), TRUE);
+ 		async_context_free (context);
+ 		g_error_free (error);
+ 		return;
+@@ -761,6 +771,7 @@ composer_save_to_drafts_got_folder (EMailSession *session,
+ 
+ 	if (e_activity_handle_cancellation (context->activity, error)) {
+ 		g_warn_if_fail (drafts_folder == NULL);
++		gtkhtml_editor_set_changed (GTKHTML_EDITOR (context->composer), TRUE);
+ 		async_context_free (context);
+ 		g_error_free (error);
+ 		return;
+@@ -780,6 +791,7 @@ composer_save_to_drafts_got_folder (EMailSession *session,
+ 			GTK_WINDOW (context->composer),
+ 			"mail:ask-default-drafts", NULL);
+ 		if (response != GTK_RESPONSE_YES) {
++			gtkhtml_editor_set_changed (GTKHTML_EDITOR (context->composer), TRUE);
+ 			async_context_free (context);
+ 			return;
+ 		}
diff --git a/evolution.spec b/evolution.spec
index b89fb9c..c105343 100644
--- a/evolution.spec
+++ b/evolution.spec
@@ -28,7 +28,7 @@
 
 Name: evolution
 Version: 3.2.3
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: Applications/Productivity
 Summary: Mail and calendar client for GNOME
 License: GPLv2+ and GFDL
@@ -50,6 +50,9 @@ Patch11: evolution-2.30.1-help-contents.patch
 # Gnome bug #667346 - build with libpst-0.6.54
 Patch12: evolution-3.2.3-libpst-0.6.54.patch
 
+# Gnome bug #617557/RH bug #799489
+Patch13: evolution-3.2.3-composer-dirty.patch
+
 ## Dependencies ###
 
 Requires(pre): GConf2
@@ -207,6 +210,7 @@ This package contains the plugin to import Microsoft Personal Storage Table
 %patch10 -p1 -b .ldaphack
 %patch11 -p1 -b .help-contents
 %patch12 -p1 -b .libpst-0.6.54
+%patch13 -p1 -b .composer-dirty
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -652,6 +656,9 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %changelog
+* Wed Mar 07 2012 Milan Crha <mcrha at redhat.com> - 3.2.3-2
+- Add patch for RH bug #799489 (set composer dirty on failed send)
+
 * Mon Jan 09 2012 Milan Crha <mcrha at redhat.com> - 3.2.3-1
 - Update to 3.2.3
 - Remove patch for RH bug #757164 (fixed upstream).


More information about the scm-commits mailing list