aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part-utils.c
diff options
context:
space:
mode:
authorbertrand <bertrand@helixcode.com>2000-02-16 18:44:35 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-02-16 18:44:35 +0800
commitf926f10e86aee8df632613d9c5b5022e6b8597ca (patch)
tree67361fd4b7f622fe6f660b47f65d65d4877259bd /camel/camel-mime-part-utils.c
parent0dfd58ef202c72905903b9df0aec462ffbd7441d (diff)
downloadgsoc2013-evolution-f926f10e86aee8df632613d9c5b5022e6b8597ca.tar
gsoc2013-evolution-f926f10e86aee8df632613d9c5b5022e6b8597ca.tar.gz
gsoc2013-evolution-f926f10e86aee8df632613d9c5b5022e6b8597ca.tar.bz2
gsoc2013-evolution-f926f10e86aee8df632613d9c5b5022e6b8597ca.tar.lz
gsoc2013-evolution-f926f10e86aee8df632613d9c5b5022e6b8597ca.tar.xz
gsoc2013-evolution-f926f10e86aee8df632613d9c5b5022e6b8597ca.tar.zst
gsoc2013-evolution-f926f10e86aee8df632613d9c5b5022e6b8597ca.zip
this routine replaces the _read_part routine and does not store the part
2000-02-15 bertrand <bertrand@helixcode.com> * camel/camel-multipart.c (_localize_part): this routine replaces the _read_part routine and does not store the part in a buffer. (_set_input_stream): use the set_input_stream instead of the construct_from_stream. each bodypart is given an input stream. * camel/camel-mime-part-utils.c: include the data-wrapper-repository header. (camel_mime_part_construct_content_from_stream): use the set_input_stream instead of the construct_from_stream method. * camel/camel-seekable-substream.c (_set_bounds): cur position is set to 0 not to inf_bound. Sync svn path=/trunk/; revision=1790
Diffstat (limited to 'camel/camel-mime-part-utils.c')
-rw-r--r--camel/camel-mime-part-utils.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
index 463aa7cb3c..427132df75 100644
--- a/camel/camel-mime-part-utils.c
+++ b/camel/camel-mime-part-utils.c
@@ -30,10 +30,18 @@
#include "camel-log.h"
#include "gmime-utils.h"
#include "camel-simple-data-wrapper.h"
-
+#include "data-wrapper-repository.h"
+
#include "camel-mime-part-utils.h"
+
+/* declare this function because it is public
+ but it must not be called except here */
+void camel_mime_part_set_content_type (CamelMimePart *mime_part,
+ gchar *content_type);
+
+
void
camel_mime_part_construct_headers_from_stream (CamelMimePart *mime_part,
CamelStream *stream)
@@ -86,6 +94,8 @@ camel_mime_part_construct_content_from_stream (CamelMimePart *mime_part,
"parsing content\n");
content_type = camel_mime_part_get_content_type (mime_part);
+ /* here we should have a mime type */
+ g_assert (content_type);
if (content_type)
mime_type = gmime_content_field_get_mime_type (content_type);
@@ -114,11 +124,17 @@ camel_mime_part_construct_content_from_stream (CamelMimePart *mime_part,
g_free (mime_type);
+ /*
+ * create the content object data wrapper with the type
+ * returned by the data wrapper repository
+ */
content_object = CAMEL_DATA_WRAPPER (gtk_type_new (content_object_type));
camel_data_wrapper_set_mime_type_field (content_object,
camel_mime_part_get_content_type (mime_part));
camel_medium_set_content_object ( CAMEL_MEDIUM (mime_part), content_object);
- camel_data_wrapper_construct_from_stream (content_object, stream);
+
+ /* set the input stream for the content object */
+ camel_data_wrapper_set_input_stream (content_object, stream);
/*
* the object is referenced in the set_content_object method,
@@ -127,10 +143,10 @@ camel_mime_part_construct_content_from_stream (CamelMimePart *mime_part,
gtk_object_unref (GTK_OBJECT (content_object));
- CAMEL_LOG_FULL_DEBUG ("CamelMimePartUtils::construct_from_stream "
+ CAMEL_LOG_FULL_DEBUG ("CamelMimePartUtils::construct_content_from_stream "
"content parsed\n");
- CAMEL_LOG_FULL_DEBUG ("CamelMimePartUtils:: Leaving _construct_from_stream\n");
+ CAMEL_LOG_FULL_DEBUG ("CamelMimePartUtils:: Leaving _construct_content_from_stream\n");
}