diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-04-13 03:55:53 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-04-13 03:55:53 +0800 |
commit | 51e5ae5524c778309800530e1e25fdf74f2226da (patch) | |
tree | cb4b49e313d0ac80d9b47c3f2ffe6e097fe08442 /plugins | |
parent | 742b2d946553f3317a7cecc21f735441c37e4478 (diff) | |
download | gsoc2013-evolution-51e5ae5524c778309800530e1e25fdf74f2226da.tar.gz gsoc2013-evolution-51e5ae5524c778309800530e1e25fdf74f2226da.tar.zst gsoc2013-evolution-51e5ae5524c778309800530e1e25fdf74f2226da.zip |
Adapt to Camel API changes.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/groupwise-features/install-shared.c | 14 | ||||
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 17 | ||||
-rw-r--r-- | plugins/mail-to-task/mail-to-task.c | 13 |
3 files changed, 26 insertions, 18 deletions
diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index b82027a946..c3be10312c 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -186,8 +186,9 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) const gchar *name; const gchar *email; CamelMimeMessage *msg = (CamelMimeMessage *) target->message; - CamelStreamMem *content; + CamelStream *stream; CamelDataWrapper *dw; + GByteArray *byte_array; gchar *start_message; if (!msg) @@ -205,9 +206,10 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) return; } - content = (CamelStreamMem *)camel_stream_mem_new(); - camel_data_wrapper_write_to_stream(dw, (CamelStream *)content); - camel_stream_write((CamelStream *)content, "", 1); + byte_array = g_byte_array_new (); + stream = camel_stream_mem_new_with_byte_array (byte_array); + camel_data_wrapper_write_to_stream (dw, stream); + camel_stream_write (stream, "", 1); from_addr = camel_mime_message_get_from ((CamelMimeMessage *)target->message); if (from_addr && camel_internet_address_get(from_addr, 0, &name, &email)) { @@ -218,7 +220,7 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) "Message from '%s'\n\n\n" "%s\n\n\n" "Click 'Apply' to install the shared folder\n\n"), - name, name, content->buffer->data); + name, name, byte_array->data); page = gtk_label_new (start_message); gtk_label_set_line_wrap (GTK_LABEL (page), TRUE); @@ -244,7 +246,7 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) } else g_warning ("Could not get the sender name"); - camel_object_unref(content); + camel_object_unref (stream); } } diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index ddec723c99..6a85f94ead 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -2524,7 +2524,8 @@ format_itip (EPlugin *ep, EMFormatHookTarget *target) gchar *classid; struct _itip_puri *puri; CamelDataWrapper *content; - CamelStream *mem; + CamelStream *stream; + GByteArray *byte_array; classid = g_strdup_printf("itip:///%s", ((EMFormat *) target->format)->part_id->str); @@ -2550,14 +2551,18 @@ format_itip (EPlugin *ep, EMFormatHookTarget *target) /* This is non-gui thread. Download the part for using in the main thread */ content = camel_medium_get_content ((CamelMedium *) target->part); - mem = camel_stream_mem_new (); - camel_data_wrapper_decode_to_stream (content, mem); - if (((CamelStreamMem *) mem)->buffer->len == 0) + byte_array = g_byte_array_new (); + stream = camel_stream_mem_new_with_byte_array (byte_array); + camel_data_wrapper_decode_to_stream (content, stream); + + if (byte_array->len == 0) puri->vcalendar = NULL; else - puri->vcalendar = g_strndup ((gchar *)((CamelStreamMem *) mem)->buffer->data, ((CamelStreamMem *) mem)->buffer->len); - camel_object_unref (mem); + puri->vcalendar = g_strndup ( + (gchar *) byte_array->data, byte_array->len); + + camel_object_unref (stream); 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); diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 0ac562d92d..cebf779ee6 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -171,10 +171,11 @@ static void set_description (ECalComponent *comp, CamelMimeMessage *message) { CamelDataWrapper *content; - CamelStream *mem; + CamelStream *stream; CamelContentType *type; CamelMimePart *mime_part = CAMEL_MIME_PART (message); ECalComponentText text; + GByteArray *byte_array; GSList sl; gchar *str, *convert_str = NULL; gsize bytes_read, bytes_written; @@ -200,11 +201,11 @@ set_description (ECalComponent *comp, CamelMimeMessage *message) if (!camel_content_type_is (type, "text", "plain")) return; - mem = camel_stream_mem_new (); - camel_data_wrapper_decode_to_stream (content, mem); - - str = g_strndup ((const gchar *)((CamelStreamMem *) mem)->buffer->data, ((CamelStreamMem *) mem)->buffer->len); - camel_object_unref (mem); + byte_array = g_byte_array_new (); + stream = camel_stream_mem_new_with_byte_array (byte_array); + camel_data_wrapper_decode_to_stream (content, stream); + str = g_strndup ((gchar *) byte_array->data, byte_array->len); + camel_object_unref (stream); /* convert to UTF-8 string */ if (str && content->mime_type->params && content->mime_type->params->value) { |