procmime_get_part_as_inputstream doesn't touch error, so remove it
authorColin Leroy <colin@colino.net>
Sun, 7 Jul 2019 08:31:01 +0000 (10:31 +0200)
committerColin Leroy <colin@colino.net>
Sun, 7 Jul 2019 08:31:01 +0000 (10:31 +0200)
src/image_viewer.c
src/plugins/litehtml_viewer/lh_widget.cpp
src/procmime.c
src/procmime.h
src/textview.c

index a9eea66..c37fd22 100644 (file)
@@ -82,10 +82,9 @@ static void image_viewer_load_image(ImageViewer *imageviewer)
        if (imageviewer->mimeinfo == NULL)
                return;
 
-       stream = procmime_get_part_as_inputstream(imageviewer->mimeinfo, &error);
-       if (error != NULL) {
-               g_warning("Couldn't get image MIME part: %s\n", error->message);
-               g_error_free(error);
+       stream = procmime_get_part_as_inputstream(imageviewer->mimeinfo);
+       if (stream == NULL) {
+               g_warning("Couldn't get image MIME part");
                return;
        }
 
index 8e8e808..30b6fb8 100644 (file)
@@ -454,14 +454,9 @@ GdkPixbuf *lh_widget::get_local_image(const litehtml::tstring url) const
                        GInputStream *stream;
                        GError *error = NULL;
 
-                       stream = procmime_get_part_as_inputstream(p, &error);
-                       if (error != NULL || stream == NULL) {
-                               if (error != NULL) {
-                                       g_warning("Couldn't get image MIME part: %s\n", error->message);
-                                       g_error_free(error);
-                               } else {
-                                       g_warning("Could not decode MIME part\n");
-                               }
+                       stream = procmime_get_part_as_inputstream(p);
+                       if (stream == NULL) {
+                               g_warning("Could not decode MIME part\n");
                                return NULL;
                        }
 
index a5961b7..a146339 100644 (file)
@@ -2719,8 +2719,7 @@ void *procmime_get_part_as_string(MimeInfo *mimeinfo,
 
 /* Returns an open GInputStream. The caller should just
  * read mimeinfo->length bytes from it and then release it. */
-GInputStream *procmime_get_part_as_inputstream(MimeInfo *mimeinfo,
-               GError **error)
+GInputStream *procmime_get_part_as_inputstream(MimeInfo *mimeinfo)
 {
        cm_return_val_if_fail(mimeinfo != NULL, NULL);
 
index ac73447..5749e6f 100644 (file)
@@ -243,8 +243,7 @@ gboolean procmime_scan_text_content(MimeInfo *mimeinfo,
                gpointer cb_data);
 void *procmime_get_part_as_string(MimeInfo *mimeinfo,
                gboolean null_terminate);
-GInputStream *procmime_get_part_as_inputstream(MimeInfo *mimeinfo,
-               GError **error);
+GInputStream *procmime_get_part_as_inputstream(MimeInfo *mimeinfo);
 
 #ifdef __cplusplus
 }
index ee3c213..88c0aa1 100644 (file)
@@ -722,10 +722,9 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo)
 
                        START_TIMING("inserting image");
 
-                       stream = procmime_get_part_as_inputstream(mimeinfo, &error);
-                       if (error != NULL) {
-                               g_warning("Can't get the image file: %s", error->message);
-                               g_error_free(error);
+                       stream = procmime_get_part_as_inputstream(mimeinfo);
+                       if (stream == NULL) {
+                               g_warning("Can't get the image file");
                                END_TIMING();
                                return;
                        }