Fix part of Bug 361145: Evolution hangs when formatting message.

(from upstream git 184befc100ba2c553ad8ea5c87eba91daf500bf4)
This commit is contained in:
ajacoutot 2009-11-30 13:27:25 +00:00
parent 017316bf81
commit a6b02df54b
3 changed files with 88 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.52 2009/11/19 15:15:47 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.53 2009/11/30 13:27:25 ajacoutot Exp $
SHARED_ONLY= Yes
@ -6,7 +6,7 @@ COMMENT= data backends for the Evolution mail/PIM suite
GNOME_PROJECT= evolution-data-server
GNOME_VERSION= 2.28.1
PKGNAME= ${DISTNAME}p0
PKGNAME= ${DISTNAME}p1
CATEGORIES= databases

View File

@ -0,0 +1,70 @@
$OpenBSD: patch-camel_camel-folder-summary_c,v 1.1 2009/11/30 13:27:25 ajacoutot Exp $
Bug 361145 - Evolution hangs when formatting message - fixes part of it.
Upstream git 184befc100ba2c553ad8ea5c87eba91daf500bf4
--- camel/camel-folder-summary.c.orig Sun Oct 18 01:08:43 2009
+++ camel/camel-folder-summary.c Mon Nov 30 13:43:53 2009
@@ -4985,7 +4985,7 @@ camel_message_info_dump (CamelMessageInfo *mi)
printf("From: %s\n", camel_message_info_from(mi));
printf("UID: %s\n", camel_message_info_uid(mi));
printf("Flags: %04x\n", camel_message_info_flags(mi));
- /*camel_content_info_dump(mi->content, 0);*/
+ camel_content_info_dump(((CamelMessageInfoBase *) mi)->content, 0);
}
static void
@@ -5054,3 +5054,53 @@ camel_folder_summary_get_need_preview (CamelFolderSumm
return _PRIVATE(summary)->need_preview;
}
+static gboolean
+compare_strings (const gchar *str1, const gchar *str2)
+{
+ if (str1 && str2 && !g_ascii_strcasecmp (str1, str2))
+ return TRUE;
+ else if (!str1 && !str2)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+static gboolean
+match_content_type (CamelContentType *info_ctype, CamelContentType *ctype)
+{
+ const gchar *name1, *name2;
+
+ if (!compare_strings (info_ctype->type, ctype->type))
+ return FALSE;
+ if (!compare_strings (info_ctype->subtype, ctype->subtype))
+ return FALSE;
+
+ name1 = camel_content_type_param (info_ctype, "name");
+ name2 = camel_content_type_param (ctype, "name");
+ if (!compare_strings (name1, name2))
+ return FALSE;
+
+ return TRUE;
+}
+
+CamelMessageContentInfo *
+camel_folder_summary_guess_content_info (CamelMessageInfo *mi, CamelContentType *ctype)
+{
+ CamelMessageInfoBase *bmi = (CamelMessageInfoBase *) mi;
+ CamelMessageContentInfo *ci = bmi->content;
+
+ while (ci) {
+ CamelMessageContentInfo *child = ci;
+
+ do {
+ if (match_content_type (child->type, ctype))
+ return child;
+
+ child = child->next;
+ } while (child != NULL);
+
+ ci = ci->childs;
+ }
+
+ return NULL;
+}

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-camel_camel-folder-summary_h,v 1.1 2009/11/30 13:27:25 ajacoutot Exp $
Bug 361145 - Evolution hangs when formatting message - fixes part of it.
Upstream git 184befc100ba2c553ad8ea5c87eba91daf500bf4
--- camel/camel-folder-summary.h.orig Sun Oct 18 01:08:43 2009
+++ camel/camel-folder-summary.h Mon Nov 30 13:43:55 2009
@@ -475,6 +475,8 @@ void camel_folder_summary_set_need_preview (CamelFolde
void camel_folder_summary_add_preview (CamelFolderSummary *s, CamelMessageInfo *info);
gboolean camel_folder_summary_get_need_preview (CamelFolderSummary *summary);
+CamelMessageContentInfo * camel_folder_summary_guess_content_info (CamelMessageInfo *mi, CamelContentType *ctype);
+
/* debugging functions */
void camel_content_info_dump (CamelMessageContentInfo *ci, gint depth);