diff options
author | Dan Winship <danw@src.gnome.org> | 2000-12-29 03:29:09 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-12-29 03:29:09 +0800 |
commit | 87d3886d23295d8dc8ce02a717696af927d8833a (patch) | |
tree | 4fcdc6cbf374cb4536578b1cb5add8814d20e065 /composer/e-msg-composer-attachment-bar.c | |
parent | 22876b6aa8f2e00c61e70352336ad00250dcec33 (diff) | |
download | gsoc2013-evolution-87d3886d23295d8dc8ce02a717696af927d8833a.tar.gz gsoc2013-evolution-87d3886d23295d8dc8ce02a717696af927d8833a.tar.zst gsoc2013-evolution-87d3886d23295d8dc8ce02a717696af927d8833a.zip |
Use CamelContentType instead of GMimeContentField.
* e-msg-composer.c (handle_multipart_alternative,
handle_multipart, e_msg_composer_new_with_message): Use
CamelContentType instead of GMimeContentField.
* e-msg-composer-attachment.c (e_msg_composer_attachment_edit):
* e-msg-composer-attachment-bar.c (update, attach_to_multipart):
Use CamelContentType, and use the header_content_type_* functions
rather than operating on the structure by hand.
svn path=/trunk/; revision=7188
Diffstat (limited to 'composer/e-msg-composer-attachment-bar.c')
-rw-r--r-- | composer/e-msg-composer-attachment-bar.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index 7eeb601237..ebab16a971 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -236,22 +236,17 @@ update (EMsgComposerAttachmentBar *bar) EMsgComposerAttachment *attachment; const gchar *desc; gchar *size_string, *label, *mime_type; - GMimeContentField *content_type; + CamelContentType *content_type; GdkPixbuf *pixbuf; - gboolean image = FALSE; + gboolean image; attachment = p->data; content_type = camel_mime_part_get_content_type (attachment->body); - - mime_type = g_strdup_printf ("%s/%s", content_type->type, - content_type->subtype); + mime_type = header_content_type_format (content_type); /* Get the image out of the attachment and create a thumbnail for it */ - if (strcmp (content_type->type, "image") == 0) - image = TRUE; - else - image = FALSE; + image = header_content_type_is (content_type, "image", "*"); if (image && attachment->pixbuf_cache == NULL) { CamelDataWrapper *wrapper; @@ -718,11 +713,11 @@ static void attach_to_multipart (CamelMultipart *multipart, EMsgComposerAttachment *attachment) { - GMimeContentField *content_type; + CamelContentType *content_type; content_type = camel_mime_part_get_content_type (attachment->body); - if (!g_strcasecmp (content_type->type, "text")) { + if (header_content_type_is (content_type, "text", "*")) { CamelStream *stream; GByteArray *array; guchar *text; @@ -739,7 +734,7 @@ attach_to_multipart (CamelMultipart *multipart, camel_mime_part_set_encoding (attachment->body, CAMEL_MIME_PART_ENCODING_7BIT); camel_object_unref (CAMEL_OBJECT (stream)); - } else if (g_strcasecmp (content_type->type, "message") != 0) { + } else if (!header_content_type_is (content_type, "message", "*")) { camel_mime_part_set_encoding (attachment->body, CAMEL_MIME_PART_ENCODING_BASE64); } |