aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2008-04-28 13:35:59 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2008-04-28 13:35:59 +0800
commit87307d86390edb84adbe686073c00a8294ecb827 (patch)
treead1c5a7cb312cc17d4792d817de7cda3029e98bc /plugins
parent39bab1f871f0ca5133d31c82487cd9da2caa04f2 (diff)
downloadgsoc2013-evolution-87307d86390edb84adbe686073c00a8294ecb827.tar
gsoc2013-evolution-87307d86390edb84adbe686073c00a8294ecb827.tar.gz
gsoc2013-evolution-87307d86390edb84adbe686073c00a8294ecb827.tar.bz2
gsoc2013-evolution-87307d86390edb84adbe686073c00a8294ecb827.tar.lz
gsoc2013-evolution-87307d86390edb84adbe686073c00a8294ecb827.tar.xz
gsoc2013-evolution-87307d86390edb84adbe686073c00a8294ecb827.tar.zst
gsoc2013-evolution-87307d86390edb84adbe686073c00a8294ecb827.zip
** Fix for BNC bug #382687
2008-04-28 Srinivasa Ragavan <sragavan@novell.com> ** Fix for BNC bug #382687 * plugins/itip-formatter/itip-formatter.c: Don't download contents in main thread, which causes deadlock svn path=/trunk/; revision=35425
Diffstat (limited to 'plugins')
-rw-r--r--plugins/itip-formatter/ChangeLog7
-rw-r--r--plugins/itip-formatter/itip-formatter.c26
2 files changed, 22 insertions, 11 deletions
diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog
index ab9127e883..7972237286 100644
--- a/plugins/itip-formatter/ChangeLog
+++ b/plugins/itip-formatter/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-28 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for BNC bug #382687
+
+ * plugins/itip-formatter/itip-formatter.c: Don't download contents in
+ main thread, which causes deadlock
+
2008-03-27 Milan Crha <mcrha@redhat.com>
** Fix for bug #523541
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index cd7199920b..9369efaf59 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -1351,8 +1351,6 @@ set_itip_error (struct _itip_puri *pitip, GtkContainer *container, const char *p
static gboolean
extract_itip_data (struct _itip_puri *pitip, GtkContainer *container)
{
- CamelDataWrapper *content;
- CamelStream *mem;
icalproperty *prop;
icalcomponent_kind kind = ICAL_NO_COMPONENT;
icalcomponent *tz_comp;
@@ -1362,12 +1360,8 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container)
ECalComponent *comp;
char *my_address;
- content = camel_medium_get_content_object ((CamelMedium *) pitip->part);
- mem = camel_stream_mem_new ();
- camel_data_wrapper_decode_to_stream (content, mem);
- if (((CamelStreamMem *) mem)->buffer->len == 0) {
- camel_object_unref (mem);
+ if (!pitip->vcalendar) {
set_itip_error (pitip, container,
_("The calendar attached is not valid"),
_("The message claims to contain a calendar, but the calendar is not a valid iCalendar."));
@@ -1375,10 +1369,6 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container)
return FALSE;
}
- pitip->vcalendar = g_strndup ((char *)((CamelStreamMem *) mem)->buffer->data, ((CamelStreamMem *) mem)->buffer->len);
-
- camel_object_unref (mem);
-
pitip->top_level = e_cal_util_new_top_level ();
pitip->main_comp = icalparser_parse_string (pitip->vcalendar);
@@ -2241,6 +2231,8 @@ format_itip (EPlugin *ep, EMFormatHookTarget *target)
GConfClient *gconf;
char *classid;
struct _itip_puri *puri;
+ CamelDataWrapper *content;
+ CamelStream *mem;
classid = g_strdup_printf("itip:///%s", ((EMFormat *) target->format)->part_id->str);
@@ -2257,6 +2249,18 @@ format_itip (EPlugin *ep, EMFormatHookTarget *target)
puri->puri.free = puri_free;
g_object_unref (gconf);
+ /* This is non-gui thread. Download the part for using in the main thread */
+ content = camel_medium_get_content_object ((CamelMedium *) target->part);
+ mem = camel_stream_mem_new ();
+ camel_data_wrapper_decode_to_stream (content, mem);
+
+ if (((CamelStreamMem *) mem)->buffer->len == 0)
+ puri->vcalendar = NULL;
+ else
+ puri->vcalendar = g_strndup ((char *)((CamelStreamMem *) mem)->buffer->data, ((CamelStreamMem *) mem)->buffer->len);
+ camel_object_unref (mem);
+
+
camel_stream_printf (target->stream, "<table border=0 width=\"100%%\" cellpadding=3><tr>");
camel_stream_printf (target->stream, "<td valign=top><object classid=\"%s\"></object></td><td width=100%% valign=top>", classid);
camel_stream_printf (target->stream, "</td></tr></table>");