aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@inria.fr>1999-06-23 00:12:27 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-06-23 00:12:27 +0800
commit7f81757d52326126f88e898241dc40c1668f5164 (patch)
treece4f1671ce7d1280f8b1a375c15bbc79bd87cad9 /camel/camel-mime-part.c
parent5deed2f193e7ab91f159f1a764b78578861044cd (diff)
downloadgsoc2013-evolution-7f81757d52326126f88e898241dc40c1668f5164.tar.gz
gsoc2013-evolution-7f81757d52326126f88e898241dc40c1668f5164.tar.zst
gsoc2013-evolution-7f81757d52326126f88e898241dc40c1668f5164.zip
moved all the content-type stuff here. (camel_data_wrapper_init):
1999-06-22 bertrand <Bertrand.Guiheneuf@inria.fr> * camel/camel-data-wrapper.c (_get_content_type): moved all the content-type stuff here. (camel_data_wrapper_init): initialize the instance content-type field. * camel/camel-mime-part.c (_parse_header_pair): parse Content-Type stuff in header. (_write_to_stream): write the content type stuff to the stream. svn path=/trunk/; revision=985
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c44
1 files changed, 7 insertions, 37 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 489e6d0d27..8e187a8eac 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -68,8 +68,6 @@ static void _set_content_languages (CamelMimePart *mime_part, GList *content_lan
static GList *_get_content_languages (CamelMimePart *mime_part);
static void _set_header_lines (CamelMimePart *mime_part, GList *header_lines);
static GList *_get_header_lines (CamelMimePart *mime_part);
-static void _set_content_type (CamelMimePart *mime_part, GString *content_type);
-static GString *_get_content_type (CamelMimePart *mime_part);
static CamelDataWrapper *_get_content_object(CamelMimePart *mime_part);
static void _write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
@@ -122,8 +120,6 @@ camel_mime_part_class_init (CamelMimePartClass *camel_mime_part_class)
camel_mime_part_class->get_header_lines=_get_header_lines;
camel_mime_part_class->parse_header_pair = _parse_header_pair;
camel_mime_part_class->get_content_object = _get_content_object;
- camel_mime_part_class->set_content_type = _set_content_type;
- camel_mime_part_class->get_content_type = _get_content_type;
@@ -137,7 +133,6 @@ camel_mime_part_init (gpointer object, gpointer klass)
CamelMimePart *camel_mime_part = CAMEL_MIME_PART (object);
camel_mime_part->headers = g_hash_table_new (g_string_hash, g_string_equal_for_hash);
- camel_mime_part->content_type_field = gmime_content_field_new (NULL, NULL);
}
@@ -497,34 +492,6 @@ camel_mime_part_get_content_object(CamelMimePart *mime_part)
}
-static void
-_set_content_type (CamelMimePart *mime_part, GString *content_type)
-{
- g_assert (content_type);
- gmime_content_field_construct_from_string (mime_part->content_type_field, content_type);
-}
-
-void
-camel_mime_part_set_content_type (CamelMimePart *mime_part, GString *content_type)
-{
- CMP_CLASS(mime_part)->set_content_type (mime_part, content_type);
-}
-
-static GString *
-_get_content_type (CamelMimePart *mime_part)
-{
- GString *mime_type;
-
- mime_type = gmime_content_field_get_mime_type (mime_part->content_type_field);
- return mime_type;
-}
-
-static GString *
-camel_mime_part_get_content_type (CamelMimePart *mime_part)
-{
- return CMP_CLASS(mime_part)->get_content_type (mime_part);
-}
-
/**********************************************************************/
@@ -570,8 +537,6 @@ _write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
CAMEL_LOG (FULL_DEBUG, "Entering CamelMimePart::write_to_stream\n");
- CAMEL_LOG (FULL_DEBUG, "CamelMimePart::write_to_stream writing content-type\n");
- gmime_content_field_write_to_stream(data_wrapper->content_type, stream);
CAMEL_LOG (FULL_DEBUG, "CamelMimePart::write_to_stream writing content-disposition\n");
gmime_content_field_write_to_stream(mp->disposition, stream);
CAMEL_LOG (FULL_DEBUG, "CamelMimePart::write_to_stream writing content-transfer-encoding\n");
@@ -583,9 +548,14 @@ _write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
CAMEL_LOG (FULL_DEBUG, "CamelMimePart::write_to_stream writing content-id\n");
WHPT (stream, "Content-id", mp->content_id);
CAMEL_LOG (FULL_DEBUG, "CamelMimePart::write_to_stream writing content-languages\n");
- write_header_with_glist_to_stream (stream, "Content-Language", mp->content_languages);
+ write_header_with_glist_to_stream (stream, "Content-Language", mp->content_languages,", ");
+
CAMEL_LOG (FULL_DEBUG, "CamelMimePart::write_to_stream writing other headers\n");
write_header_table_to_stream (stream, mp->headers);
+
+ CAMEL_LOG (FULL_DEBUG, "CamelMimePart::write_to_stream writing content-type\n");
+ gmime_content_field_write_to_stream(data_wrapper->content_type, stream);
+
camel_stream_write_string(stream,"\n");
if (mp->content) camel_data_wrapper_write_to_stream (mp->content, stream);
@@ -656,7 +626,7 @@ _parse_header_pair (CamelMimePart *mime_part, GString *header_name, GString *hea
"CamelMimePart::parse_header_pair found HEADER_CONTENT_TYPE: %s\n",
header_value->str );
- /* CMP_CLASS(mime_part)->set_content_MD5 (mime_part, header_value); */
+ gmime_content_field_construct_from_string (CAMEL_DATA_WRAPPER(mime_part)->content_type, header_value);
header_handled = TRUE;
break;