[balsa/gmime3: 13/55] g_mime_content_type_new_from_string()



commit 361c2182eb9e939393e741bf3fc657177cc20ded
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Nov 20 19:35:08 2019 -0800

    g_mime_content_type_new_from_string()
    
    has been replaced by g_mime_content_type_parse() and now takes a
    GMimeParserOptions argument.

 libbalsa/body.c         | 2 +-
 libbalsa/mailbox_imap.c | 2 +-
 libbalsa/message.c      | 4 ++--
 libbalsa/rfc3156.c      | 2 +-
 src/balsa-message.c     | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/libbalsa/body.c b/libbalsa/body.c
index 0ce8585af..a70a6c461 100644
--- a/libbalsa/body.c
+++ b/libbalsa/body.c
@@ -305,7 +305,7 @@ libbalsa_message_body_get_parameter(LibBalsaMessageBody * body,
        type = g_mime_object_get_content_type(body->mime_part);
        res = g_strdup(g_mime_content_type_get_parameter(type, param));
     } else if (body->content_type) {
-       type = g_mime_content_type_new_from_string(body->content_type);
+       type = g_mime_content_type_parse(libbalsa_parser_options(), body->content_type);
        res = g_strdup(g_mime_content_type_get_parameter(type, param));
        g_object_unref(type);
     }
diff --git a/libbalsa/mailbox_imap.c b/libbalsa/mailbox_imap.c
index 8724c81bb..8114dd86e 100644
--- a/libbalsa/mailbox_imap.c
+++ b/libbalsa/mailbox_imap.c
@@ -2567,7 +2567,7 @@ lbm_imap_get_msg_part(LibBalsaMessage * msg, LibBalsaMessageBody * part,
 
     if (!part->mime_part) {
         GMimeContentType *type =
-            g_mime_content_type_new_from_string(part->content_type);
+            g_mime_content_type_parse(libbalsa_parser_options(), part->content_type);
         if (g_mime_content_type_is_type(type, "multipart", "*")) {
             if (g_mime_content_type_is_type(type, "multipart", "signed"))
                 part->mime_part =
diff --git a/libbalsa/message.c b/libbalsa/message.c
index 16fa61b3d..7659a4967 100644
--- a/libbalsa/message.c
+++ b/libbalsa/message.c
@@ -1039,7 +1039,7 @@ lb_message_headers_basic_from_gmime(LibBalsaMessageHeaders *headers,
         g_return_if_fail(headers->content_type == NULL);
         content_type          = g_mime_object_get_content_type(mime_msg->mime_part);
         str                   = g_mime_content_type_get_mime_type(content_type);
-        headers->content_type = g_mime_content_type_new_from_string(str);
+        headers->content_type = g_mime_content_type_parse(libbalsa_parser_options(), str);
         g_free(str);
     }
 }
@@ -1275,7 +1275,7 @@ lbmsg_set_header(LibBalsaMessage *message,
         libbalsa_message_set_references_from_string(message, value);
     } else if ((message->headers->content_type == NULL) &&
                (g_ascii_strcasecmp(name, "Content-Type") == 0)) {
-        message->headers->content_type = g_mime_content_type_new_from_string(value);
+        message->headers->content_type = g_mime_content_type_parse(libbalsa_parser_options(), value);
     } else if ((message->headers->dispnotify_to == NULL) &&
                (g_ascii_strcasecmp(name, "Disposition-Notification-To") == 0)) {
         message->headers->dispnotify_to = internet_address_list_parse(libbalsa_parser_options(), value);
diff --git a/libbalsa/rfc3156.c b/libbalsa/rfc3156.c
index 438aa0de2..1aec1a5ce 100644
--- a/libbalsa/rfc3156.c
+++ b/libbalsa/rfc3156.c
@@ -68,7 +68,7 @@ body_is_type(LibBalsaMessageBody * body, const gchar * type,
        retval = g_mime_content_type_is_type(content_type, type, sub_type);
     } else {
        GMimeContentType *content_type =
-           g_mime_content_type_new_from_string(body->content_type);
+           g_mime_content_type_parse(libbalsa_parser_options(), body->content_type);
        retval = g_mime_content_type_is_type(content_type, type, sub_type);
        g_object_unref(content_type);
     }
diff --git a/src/balsa-message.c b/src/balsa-message.c
index e1b7670c5..fd33e926f 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -2113,7 +2113,7 @@ add_multipart_mixed(BalsaMessage * balsa_message, LibBalsaMessageBody * body,
         retval = add_body(balsa_message, body, container);
         for (body = body->next; body; body = body->next) {
            GMimeContentType *type =
-               g_mime_content_type_new_from_string(body->content_type);
+               g_mime_content_type_parse(libbalsa_parser_options(), body->content_type);
 
             if (libbalsa_message_body_is_inline(body) ||
                balsa_message->force_inline ||
@@ -2141,7 +2141,7 @@ add_multipart(BalsaMessage *balsa_message, LibBalsaMessageBody *body,
     if (!body->parts)
        return body;
 
-    type=g_mime_content_type_new_from_string(body->content_type);
+    type = g_mime_content_type_parse(libbalsa_parser_options(), body->content_type);
 
     if (g_mime_content_type_is_type(type, "multipart", "related")) {
         /* add the compound object root part */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]