[balsa] message: GMimeContentType is a GObject subclass



commit 77ded4634e9593f967ae7c2c0d660a19f5d8bf45
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Mar 6 14:48:12 2022 -0500

    message: GMimeContentType is a GObject subclass
    
    so just hold a reference to it in LibBalsaMessageHeaders.

 libbalsa/message.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/libbalsa/message.c b/libbalsa/message.c
index e101117a0..d9ff792ab 100644
--- a/libbalsa/message.c
+++ b/libbalsa/message.c
@@ -1029,23 +1029,14 @@ lb_message_headers_basic_from_gmime(LibBalsaMessageHeaders *headers,
             headers->date = g_date_time_to_unix(datetime);
     }
 
-    if (headers->to_list == NULL)
+    if (headers->to_list == NULL) {
         headers->to_list =
             lb_message_recipients(mime_msg, GMIME_ADDRESS_TYPE_TO);
+    }
 
     if (headers->content_type == NULL) {
-        /* If we could:
-         * headers->content_type =
-         *     g_mime_content_type_copy
-         *         (g_mime_object_get_content_type(mime_msg->mime_part));
-         */
-        GMimeContentType *content_type;
-        gchar *str;
-
-        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_parse(libbalsa_parser_options(), str);
-        g_free(str);
+        g_set_object(&headers->content_type,
+                     g_mime_object_get_content_type(mime_msg->mime_part));
     }
 }
 


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