evolution r35424 - branches/gnome-2-22/plugins/itip-formatter
- From: sragavan svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r35424 - branches/gnome-2-22/plugins/itip-formatter
- Date: Mon, 28 Apr 2008 06:32:46 +0100 (BST)
Author: sragavan
Date: Mon Apr 28 05:32:46 2008
New Revision: 35424
URL: http://svn.gnome.org/viewvc/evolution?rev=35424&view=rev
Log:
2008-04-28 Srinivasa Ragavan <sragavan novell com>
** Fix for BNC bug #382687
* itip-formatter.c: (extract_itip_data), (format_itip): Don't download on main thread. It can
cause deadlocks.
Modified:
branches/gnome-2-22/plugins/itip-formatter/ChangeLog
branches/gnome-2-22/plugins/itip-formatter/itip-formatter.c
Modified: branches/gnome-2-22/plugins/itip-formatter/itip-formatter.c
==============================================================================
--- branches/gnome-2-22/plugins/itip-formatter/itip-formatter.c (original)
+++ branches/gnome-2-22/plugins/itip-formatter/itip-formatter.c Mon Apr 28 05:32:46 2008
@@ -1348,8 +1348,6 @@
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;
@@ -1359,12 +1357,8 @@
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."));
@@ -1372,10 +1366,6 @@
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);
@@ -2238,6 +2228,8 @@
GConfClient *gconf;
char *classid;
struct _itip_puri *puri;
+ CamelDataWrapper *content;
+ CamelStream *mem;
classid = g_strdup_printf("itip:///%s", ((EMFormat *) target->format)->part_id->str);
@@ -2254,6 +2246,18 @@
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>");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]