aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-12-18 16:24:26 +0800
committerTor Lillqvist <tml@src.gnome.org>2005-12-18 16:24:26 +0800
commit448d624c00f0c4e12917a4d31babd10555b2e8a4 (patch)
treec44c6e6864f1e0cd34455da2e71fc33ca13d61e6 /mail/em-format-html.c
parent2f1a024be76933ba28ab80e76a52ff46358e33dd (diff)
downloadgsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar.gz
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar.bz2
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar.lz
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar.xz
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar.zst
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.zip
em-folder-browser.c em-folder-view.c em-format-html.c
2005-12-18 Tor Lillqvist <tml@novell.com> * em-folder-browser.c * em-folder-view.c * em-format-html.c * em-format-html-display.c * em-mailer-prefs.c * em-message-browser.c * em-migrate.c * em-subscribe-editor.c * em-sync-stream.c * em-utils.c * em-vfolder-editor.c * em-vfolder-rule.c * mail-autofilter.c * mail-component.c * mail-config.c * mail-folder-cache.c: Use gstdio wrappers. Construct pathnames of glade, xml, etspec and png files at run-time. Use g_filename_{to,from}_uri(). * em-folder-browser.c (emfb_init) * em-folder-view.c (emfv_finalise) * em-message-browser.c (emmb_init): As EMFolderView::ui_files now always is a list of filenames constructed with g_build_filename(), use g_free() on each list entry before calling g_slist_free() on the list. * em-folder-tree-model.c (em_folder_tree_model_load_state): Use e_xml_parse_file(). * em-migrate.c: Bypass all the code for upgrading from 1.x on Win32. (emm_setup_initial): Use GDir instead of dirent. * em-sync-stream.c * mail-folder-cache.c: Use pthread_equal() to compare pthread_t values. * em-vfs-stream.c: No EINPROGRESS or ELOOP on Win32. svn path=/trunk/; revision=30854
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r--mail/em-format-html.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index f0a91f92c4..52c3fe9075 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -31,10 +31,20 @@
#include <fcntl.h>
#include <ctype.h>
+#include <glib.h>
+#ifdef G_OS_WIN32
+/* Work around 'DATADIR' and 'interface' lossage in <windows.h> */
+#define DATADIR crap_DATADIR
+#include <windows.h>
+#undef DATADIR
+#undef interface
+#endif
+
#include <libedataserver/e-iconv.h>
#include <libedataserver/e-util.h> /* for e_utf8_strftime, what about e_time_format_time? */
#include <libedataserver/e-time-utils.h>
#include "e-util/e-icon-factory.h"
+#include "e-util/e-util-private.h"
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-embedded.h>
@@ -906,7 +916,7 @@ efh_message_external(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part
if (name == NULL)
goto fail;
- url = g_strdup_printf ("file:///%s", *name == '/' ? name+1:name);
+ url = g_filename_to_uri (name, NULL, NULL);
if (site)
desc = g_strdup_printf(_("Pointer to local file (%s) valid at site \"%s\""), name, site);
else
@@ -1715,10 +1725,17 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
if (rupert && efh->show_rupert) {
char *classid;
CamelMimePart *iconpart;
+ char *pngfile;
classid = g_strdup_printf("icon:///em-format-html/%s/icon/header", emf->part_id->str);
camel_stream_printf(stream, "<td align=\"right\" valign=\"top\"><img width=16 height=16 src=\"%s\"></td>", classid);
- iconpart = em_format_html_file_part((EMFormatHTML *)emf, "image/png", EVOLUTION_ICONSDIR "/monkey-16.png");
+
+ pngfile = g_build_filename (EVOLUTION_ICONSDIR,
+ "monkey-16.png",
+ NULL);
+ iconpart = em_format_html_file_part((EMFormatHTML *)emf, "image/png", pngfile);
+ g_free (pngfile);
+
if (iconpart) {
em_format_add_puri(emf, sizeof(EMFormatPURI), classid, iconpart, efh_write_image);
camel_object_unref(iconpart);