[evolution/f20] Add upstream patches for GNOME bugs #724023, #722041 and #722698 as suggested in bug #1070443

Milan Crha mcrha at fedoraproject.org
Thu Feb 27 09:23:23 UTC 2014


commit 6f48425bbb382a996188012844245609b1bcad2b
Author: Milan Crha <mcrha at redhat.com>
Date:   Thu Feb 27 10:24:43 2014 +0100

    Add upstream patches for GNOME bugs #724023, #722041 and #722698
    as suggested in bug #1070443

 ...-Run-EMailFormatter-in-the-main-UI-thread.patch |   73 +++++++++++++++++
 ...NNTP-Messages-are-silently-dropped-from-O.patch |   82 ++++++++++++++++++++
 0003-Bug-722698-Crash-creating-a-new-folder.patch  |   44 +++++++++++
 evolution.spec                                     |   13 +++-
 4 files changed, 211 insertions(+), 1 deletions(-)
---
diff --git a/0001-Bug-724023-Run-EMailFormatter-in-the-main-UI-thread.patch b/0001-Bug-724023-Run-EMailFormatter-in-the-main-UI-thread.patch
new file mode 100644
index 0000000..7f0d8d1
--- /dev/null
+++ b/0001-Bug-724023-Run-EMailFormatter-in-the-main-UI-thread.patch
@@ -0,0 +1,73 @@
+From 37a95e0e6b74fa9fe1692c788983142d8d4774d4 Mon Sep 17 00:00:00 2001
+From: Milan Crha <mcrha at redhat.com>
+Date: Mon, 10 Feb 2014 15:59:24 +0100
+Subject: [PATCH 2/7] Bug #724023 - Run EMailFormatter in the main/UI thread
+
+Any GtkWidget creation or manipulation should be done exclusively
+from the main/UI thread, thus make sure it is done that way.
+Of course, evolution can freeze for a little time (depends on the message
+size), until its formatting is done. It's unnoticeable with usual messages.
+---
+ em-format/e-mail-part-attachment-bar.c | 17 ++++++++++++-----
+ mail/e-mail-request.c                  |  9 ++++++---
+ 2 files changed, 18 insertions(+), 8 deletions(-)
+
+diff --git a/em-format/e-mail-part-attachment-bar.c b/em-format/e-mail-part-attachment-bar.c
+index 5cebd9b..57f49be 100644
+--- a/em-format/e-mail-part-attachment-bar.c
++++ b/em-format/e-mail-part-attachment-bar.c
+@@ -60,12 +60,7 @@ e_mail_part_attachment_bar_class_init (EMailPartAttachmentBarClass *class)
+ static void
+ e_mail_part_attachment_bar_init (EMailPartAttachmentBar *part)
+ {
+-	GtkTreeModel *tree_model;
+-
+ 	part->priv = E_MAIL_PART_ATTACHMENT_BAR_GET_PRIVATE (part);
+-
+-	tree_model = e_attachment_store_new ();
+-	part->priv->store = E_ATTACHMENT_STORE (tree_model);
+ }
+ 
+ EMailPart *
+@@ -84,6 +79,18 @@ e_mail_part_attachment_bar_get_store (EMailPartAttachmentBar *part)
+ {
+ 	g_return_val_if_fail (E_IS_MAIL_PART_ATTACHMENT_BAR (part), NULL);
+ 
++	if (!part->priv->store) {
++		GtkTreeModel *tree_model;
++
++		/* Create the store only on demand. The EMailParser runs in a dedicated
++		   thread, but the EAttachmentStore is a GtkWidget descendant, which should
++		   be manipulated only from the main/UI thread, thus postpone its creating
++		   until it's really needed, which might be during the EMailFormatter run,
++		   which runs from the main/UI thread. */
++		tree_model = e_attachment_store_new ();
++		part->priv->store = E_ATTACHMENT_STORE (tree_model);
++	}
++
+ 	return part->priv->store;
+ }
+ 
+diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c
+index bfbedc3..615bce3 100644
+--- a/mail/e-mail-request.c
++++ b/mail/e-mail-request.c
+@@ -365,9 +365,12 @@ mail_request_send_async (SoupRequest *request,
+ 			simple, handle_contact_photo_request,
+ 			G_PRIORITY_DEFAULT, cancellable);
+ 	} else {
+-		g_simple_async_result_run_in_thread (
+-			simple, handle_mail_request,
+-			G_PRIORITY_DEFAULT, cancellable);
++		/* Process e-mail mail requests in this thread, which should be
++		   the main/UI thread, because any EMailFormatter can create
++		   GtkWidget-s, or manipulate with them, which should be always
++		   done in the main/UI thread. */
++		handle_mail_request (simple, G_OBJECT (request), cancellable);
++		g_simple_async_result_complete_in_idle (simple);
+ 	}
+ 
+ 	g_object_unref (simple);
+-- 
+1.9.0
+
diff --git a/0002-Bug-722041-NNTP-Messages-are-silently-dropped-from-O.patch b/0002-Bug-722041-NNTP-Messages-are-silently-dropped-from-O.patch
new file mode 100644
index 0000000..2fc1da0
--- /dev/null
+++ b/0002-Bug-722041-NNTP-Messages-are-silently-dropped-from-O.patch
@@ -0,0 +1,82 @@
+From 9de8f573e9eba07a096c7f97f97bb5ac876278c8 Mon Sep 17 00:00:00 2001
+From: Milan Crha <mcrha at redhat.com>
+Date: Mon, 10 Feb 2014 17:57:28 +0100
+Subject: [PATCH 3/7] Bug #722041 - NNTP Messages are silently dropped from
+ Outbox
+
+---
+ libemail-engine/mail-ops.c | 20 ++++++++------------
+ 1 file changed, 8 insertions(+), 12 deletions(-)
+
+diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c
+index 4f3dbd3..4db5dae 100644
+--- a/libemail-engine/mail-ops.c
++++ b/libemail-engine/mail-ops.c
+@@ -682,22 +682,18 @@ mail_send_message (struct _send_queue_msg *m,
+ 	info = camel_message_info_new (NULL);
+ 	camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, ~0);
+ 
+-	for (header = xev; header; header = header->next) {
++	for (header = xev; header && !local_error; header = header->next) {
+ 		gchar *uri;
+ 
+ 		if (strcmp (header->name, "X-Evolution-PostTo") != 0)
+ 			continue;
+ 
+-		/* TODO: don't lose errors */
+-
+ 		uri = g_strstrip (g_strdup (header->value));
+-		/* FIXME Not passing a GCancellable or GError here. */
+ 		folder = e_mail_session_uri_to_folder_sync (
+-			m->session, uri, 0, NULL, NULL);
++			m->session, uri, 0, cancellable, &local_error);
+ 		if (folder != NULL) {
+-			/* FIXME Not passing a GCancellable or GError here. */
+ 			camel_folder_append_message_sync (
+-				folder, message, info, NULL, NULL, NULL);
++				folder, message, info, NULL, cancellable, &local_error);
+ 			g_object_unref (folder);
+ 			folder = NULL;
+ 		}
+@@ -707,7 +703,7 @@ mail_send_message (struct _send_queue_msg *m,
+ 	/* post process */
+ 	mail_tool_restore_xevolution_headers (message, xev);
+ 
+-	if (driver) {
++	if (local_error == NULL && driver) {
+ 		camel_filter_driver_filter_message (
+ 			driver, message, info, NULL, NULL,
+ 			NULL, "", cancellable, &local_error);
+@@ -735,10 +731,9 @@ mail_send_message (struct _send_queue_msg *m,
+ 		}
+ 	}
+ 
+-	if (provider == NULL
+-	    || !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)) {
++	if (local_error == NULL && (provider == NULL
++	    || !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER))) {
+ 		CamelFolder *local_sent_folder;
+-		GError *local_error = NULL;
+ 
+ 		local_sent_folder = e_mail_session_get_local_folder (
+ 			m->session, E_MAIL_LOCAL_FOLDER_SENT);
+@@ -798,6 +793,7 @@ mail_send_message (struct _send_queue_msg *m,
+ 					_("Failed to append to "
+ 					"local 'Sent' folder: %s"),
+ 					local_error->message);
++				g_clear_error (&local_error);
+ 			}
+ 		}
+ 	}
+@@ -836,7 +832,7 @@ mail_send_message (struct _send_queue_msg *m,
+ 		camel_folder_synchronize_sync (queue, FALSE, NULL, NULL);
+ 	}
+ 
+-	if (err->len > 0) {
++	if (local_error == NULL && err->len > 0) {
+ 		/* set the culmulative exception report */
+ 		g_set_error (
+ 			&local_error, CAMEL_ERROR,
+-- 
+1.9.0
+
diff --git a/0003-Bug-722698-Crash-creating-a-new-folder.patch b/0003-Bug-722698-Crash-creating-a-new-folder.patch
new file mode 100644
index 0000000..1c72b61
--- /dev/null
+++ b/0003-Bug-722698-Crash-creating-a-new-folder.patch
@@ -0,0 +1,44 @@
+From 5e4b28e2fae285fa632ab189707489e0df8d79aa Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio at redhat.com>
+Date: Tue, 21 Jan 2014 15:48:54 +0100
+Subject: [PATCH 5/7] Bug #722698 - Crash creating a new folder
+
+---
+ mail/em-folder-tree.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
+index b15041a..cd7f67e 100644
+--- a/mail/em-folder-tree.c
++++ b/mail/em-folder-tree.c
+@@ -1108,15 +1108,27 @@ folder_tree_dispose (GObject *object)
+ {
+ 	EMFolderTreePrivate *priv;
+ 	GtkTreeModel *model;
++	GtkTreeSelection *selection;
+ 
+ 	priv = EM_FOLDER_TREE_GET_PRIVATE (object);
+ 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (object));
++	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (object));
+ 
+ 	if (priv->loaded_row_id != 0) {
+ 		g_signal_handler_disconnect (model, priv->loaded_row_id);
+ 		priv->loaded_row_id = 0;
+ 	}
+ 
++	if (priv->loading_row_id != 0) {
++		g_signal_handler_disconnect (model, priv->loading_row_id);
++		priv->loading_row_id = 0;
++	}
++
++	if (priv->selection_changed_handler_id != 0) {
++		g_signal_handler_disconnect (selection, priv->selection_changed_handler_id);
++		priv->selection_changed_handler_id = 0;
++	}
++
+ 	if (priv->autoscroll_id != 0) {
+ 		g_source_remove (priv->autoscroll_id);
+ 		priv->autoscroll_id = 0;
+-- 
+1.9.0
+
diff --git a/evolution.spec b/evolution.spec
index ee00eb2..5ccdbd1 100644
--- a/evolution.spec
+++ b/evolution.spec
@@ -31,7 +31,7 @@
 
 Name: evolution
 Version: 3.10.4
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: Applications/Productivity
 Summary: Mail and calendar client for GNOME
 License: GPLv2+ and GFDL
@@ -51,6 +51,11 @@ Patch01: evolution-1.4.4-ldap-x86_64-hack.patch
 # RH bug #589555
 Patch02: evolution-2.30.1-help-contents.patch
 
+# set of patches from RH bug #1070443
+Patch03: 0001-Bug-724023-Run-EMailFormatter-in-the-main-UI-thread.patch
+Patch04: 0002-Bug-722041-NNTP-Messages-are-silently-dropped-from-O.patch
+Patch05: 0003-Bug-722698-Crash-creating-a-new-folder.patch
+
 ## Dependencies ###
 
 Requires: gnome-icon-theme >= %{gnome_icon_theme_version}
@@ -201,6 +206,9 @@ This package contains the plugin to import Microsoft Personal Storage Table
 %setup -q -n evolution-%{version}
 %patch01 -p1 -b .ldaphack
 %patch02 -p1 -b .help-contents
+%patch03 -p1 -b .ui-thread
+%patch04 -p1 -b .nntp-dropped
+%patch05 -p1 -b .new-folder-crash
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -530,6 +538,9 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %changelog
+* Thu Feb 27 2014 Michael Kuhn <suraia at ikkoku.de> - 3.10.4-2
+- Add upstream patches for GNOME bugs #724023, #722041 and #722698
+
 * Mon Feb 10 2014 Milan Crha <mcrha at redhat.com> - 3.10.4-1
 - Update to 3.10.4
 


More information about the scm-commits mailing list