diff options
author | Milan Crha <mcrha@redhat.com> | 2010-07-14 16:57:56 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-07-14 16:57:56 +0800 |
commit | 5ff9e8dc50e289e49a2177cf032be627c7c5ae85 (patch) | |
tree | 6cb59484455157d2b9683589477fa29848975633 /calendar/gui | |
parent | 517358b1d51eebaa7d4ad502201e68cb2c7d3349 (diff) | |
download | gsoc2013-evolution-5ff9e8dc50e289e49a2177cf032be627c7c5ae85.tar.gz gsoc2013-evolution-5ff9e8dc50e289e49a2177cf032be627c7c5ae85.tar.zst gsoc2013-evolution-5ff9e8dc50e289e49a2177cf032be627c7c5ae85.zip |
Bug #612178 - Do not access CamelStreamMem::buffer directly
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 0b1701de6f..d6d13d5c01 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -2917,7 +2917,8 @@ comp_editor_get_mime_attach_list (CompEditor *editor) EAttachment *attachment; CamelDataWrapper *wrapper; CamelMimePart *mime_part; - CamelStreamMem *mstream; + CamelStream *mem_stream; + GByteArray *mem_bytes; guchar *buffer = NULL; const gchar *desc, *disp; gint column_id; @@ -2934,15 +2935,16 @@ comp_editor_get_mime_attach_list (CompEditor *editor) cal_mime_attach = g_malloc0 (sizeof (struct CalMimeAttach)); wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); - mstream = (CamelStreamMem *) camel_stream_mem_new (); + mem_bytes = g_byte_array_new (); + mem_stream = camel_stream_mem_new_with_byte_array (mem_bytes); - camel_data_wrapper_decode_to_stream (wrapper, (CamelStream *) mstream); - buffer = g_memdup (mstream->buffer->data, mstream->buffer->len); + camel_data_wrapper_decode_to_stream (wrapper, mem_stream); + buffer = g_memdup (mem_bytes->data, mem_bytes->len); camel_mime_part_set_content_id (mime_part, NULL); cal_mime_attach->encoded_data = (gchar *)buffer; - cal_mime_attach->length = mstream->buffer->len; + cal_mime_attach->length = mem_bytes->len; cal_mime_attach->filename = g_strdup (camel_mime_part_get_filename (mime_part)); desc = camel_mime_part_get_description (mime_part); if (!desc || *desc == '\0') @@ -2957,7 +2959,7 @@ comp_editor_get_mime_attach_list (CompEditor *editor) attach_list = g_slist_append (attach_list, cal_mime_attach); - camel_object_unref (mstream); + camel_object_unref (mem_stream); } |