[evolution-data-server] Bug 361145 - Evolution hangs when formatting message - fixes part of it.
- From: Chenthill Palanisamy <pchen src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 361145 - Evolution hangs when formatting message - fixes part of it.
- Date: Tue, 24 Nov 2009 15:15:15 +0000 (UTC)
commit 184befc100ba2c553ad8ea5c87eba91daf500bf4
Author: Chenthill Palanisamy <pchenthill novell com>
Date: Tue Nov 24 20:01:19 2009 +0530
Bug 361145 - Evolution hangs when formatting message - fixes part of it.
camel/camel-folder-summary.c | 52 +++++++++++++++++++++++++++++++++++++++++-
camel/camel-folder-summary.h | 2 +
2 files changed, 53 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 060c3a3..3e22be1 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -4978,7 +4978,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
@@ -5047,3 +5047,53 @@ camel_folder_summary_get_need_preview (CamelFolderSummary *summary)
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;
+}
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index 9f771cb..aa9a2fd 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -475,6 +475,8 @@ void camel_folder_summary_set_need_preview (CamelFolderSummary *summary, gboolea
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]