[Commits] [SCM] claws branch, master, updated. 3.17.3-109-ga6ece75
ticho at claws-mail.org
ticho at claws-mail.org
Fri Mar 1 14:53:30 CET 2019
The branch, master has been updated
via a6ece75c6330d9b9f2fe486e205d77c4e186fefa (commit)
from 4e9e7d734f3dc03ff9c64d8dc4c448bea58225bb (commit)
Summary of changes:
src/plugins/litehtml_viewer/lh_viewer.c | 26 ++++----------------------
1 file changed, 4 insertions(+), 22 deletions(-)
- Log -----------------------------------------------------------------
commit a6ece75c6330d9b9f2fe486e205d77c4e186fefa
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Fri Mar 1 14:52:22 2019 +0100
Simplify Litehtml plugin's show_mimepart
diff --git a/src/plugins/litehtml_viewer/lh_viewer.c b/src/plugins/litehtml_viewer/lh_viewer.c
index fe5727f..93dd02c 100644
--- a/src/plugins/litehtml_viewer/lh_viewer.c
+++ b/src/plugins/litehtml_viewer/lh_viewer.c
@@ -83,36 +83,18 @@ static gchar *get_utf8_string(const gchar *string) {
return utf8;
}
-static void lh_show_mimepart(MimeViewer *_viewer, const gchar *infole,
+static void lh_show_mimepart(MimeViewer *_viewer, const gchar *infile,
MimeInfo *partinfo)
{
debug_print("LH: show_mimepart\n");
LHViewer *viewer = (LHViewer *)_viewer;
+ gchar *utf8 = procmime_get_part_as_string(partinfo);
- gchar *msgfile = procmime_get_tmp_file_name(partinfo);
- debug_print("LH: msgfile '%s'\n", msgfile);
-
- if (procmime_get_part(msgfile, partinfo) < 0) {
- debug_print("LH: couldn't get MIME part file\n");
- g_free(msgfile);
- return;
- }
-
- gchar *contents, *utf8;
- gsize length;
- GError *error = NULL;
- if (!g_file_get_contents(msgfile, &contents, &length, &error)) {
- g_warning("LiteHTML viewer: couldn't read contents of file '%s': %s",
- msgfile, error->message);
- g_clear_error(&error);
+ if (utf8 == NULL) {
+ g_warning("LH: couldn't get MIME part file\n");
return;
- } else {
- utf8 = get_utf8_string(contents);
- g_free(contents);
}
- g_free(msgfile);
-
lh_widget_open_html(viewer->widget, utf8);
g_free(utf8);
}
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list