[balsa/gmime3: 8/49] g_mime_content_type_new_from_string()



commit 220b99379ec37e8b560acea8259b6d037fc459e0
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 d3ca9396d..e3689be5a 100644
--- a/libbalsa/body.c
+++ b/libbalsa/body.c
@@ -304,7 +304,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 2f605a9e3..de7ad47d1 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 887ed879e..99e967336 100644
--- a/libbalsa/message.c
+++ b/libbalsa/message.c
@@ -1017,7 +1017,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);
     }
 }
@@ -1253,7 +1253,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 54715d771..24b8d5c73 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 727e73295..0c2052eae 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -2145,7 +2145,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 ||
@@ -2173,7 +2173,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]