aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2005-07-29 12:05:17 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2005-07-29 12:05:17 +0800
commit5fae90205947e4e468ca89c15698128752602dde (patch)
treed5637374f6baf3edf2f1cf4f4920ac052d2039b4 /widgets/misc/e-attachment.c
parent29bded8a17c8cdde0611bd98f4d39b47a8abd585 (diff)
downloadgsoc2013-evolution-5fae90205947e4e468ca89c15698128752602dde.tar.gz
gsoc2013-evolution-5fae90205947e4e468ca89c15698128752602dde.tar.zst
gsoc2013-evolution-5fae90205947e4e468ca89c15698128752602dde.zip
used ref instead of copying the entire mime part. Also commited
2005-07-29 Srinivasa Ragavan <sragavan@novell.com> * e-attachment.c: (e_attachment_new_from_mime_part) used ref instead of copying the entire mime part. Also commited (2005-07-15 Diego Gonzalez <diego@pemas.net>) patch svn path=/trunk/; revision=29921
Diffstat (limited to 'widgets/misc/e-attachment.c')
-rw-r--r--widgets/misc/e-attachment.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index c813e9965a..8dc2a089af 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -505,31 +505,13 @@ EAttachment *
e_attachment_new_from_mime_part (CamelMimePart *part)
{
EAttachment *new;
- CamelMimePart *mime_part;
- CamelStream *stream;
g_return_val_if_fail (CAMEL_IS_MIME_PART (part), NULL);
- stream = camel_stream_mem_new ();
- if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (part), stream) == -1) {
- camel_object_unref (stream);
- return NULL;
- }
-
- camel_stream_reset (stream);
- mime_part = camel_mime_part_new ();
-
- if (camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (mime_part), stream) == -1) {
- camel_object_unref (mime_part);
- camel_object_unref (stream);
- return NULL;
- }
-
- camel_object_unref (stream);
-
new = g_object_new (E_TYPE_ATTACHMENT, NULL);
new->editor_gui = NULL;
- new->body = mime_part;
+ camel_object_ref (part);
+ new->body = part;
new->guessed_type = FALSE;
new->is_available_local = TRUE;
new->size = 0;