aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-04-08 19:56:03 +0800
committerMilan Crha <mcrha@redhat.com>2010-04-08 19:56:03 +0800
commit5df72deec71e159ff4aa4fa9d55695c806a37c29 (patch)
tree0e943a0fb8102b019d4bbdcae53c7ca16820384b
parenta629756a400180bb1b2764a276aebabdd78770d1 (diff)
downloadgsoc2013-evolution-5df72deec71e159ff4aa4fa9d55695c806a37c29.tar.gz
gsoc2013-evolution-5df72deec71e159ff4aa4fa9d55695c806a37c29.tar.zst
gsoc2013-evolution-5df72deec71e159ff4aa4fa9d55695c806a37c29.zip
Bug #614325 - Shrink/expand To,Cc header images is missing
-rw-r--r--mail/e-mail-display.c4
-rw-r--r--mail/em-format-html.c68
2 files changed, 23 insertions, 49 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 70789c0d47..86ed222f04 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -239,12 +239,12 @@ mail_display_link_clicked (GtkHTML *html,
if (!(flags & EM_FORMAT_HTML_HEADER_CC))
flags |= EM_FORMAT_HTML_HEADER_CC;
else
- flags |= EM_FORMAT_HTML_HEADER_CC;
+ flags &= ~EM_FORMAT_HTML_HEADER_CC;
} else if (strcmp (uri, "##BCC##") == 0) {
if (!(flags & EM_FORMAT_HTML_HEADER_BCC))
flags |= EM_FORMAT_HTML_HEADER_BCC;
else
- flags |= EM_FORMAT_HTML_HEADER_BCC;
+ flags &= ~EM_FORMAT_HTML_HEADER_BCC;
}
priv->formatter->header_wrap_flags = flags;
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 26c6f92ff3..ad47742ba8 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -1480,17 +1480,22 @@ efh_url_requested(GtkHTML *html, const gchar *url, GtkHTMLStream *handle, EMForm
} else if (g_ascii_strncasecmp(url, "http:", 5) == 0 || g_ascii_strncasecmp(url, "https:", 6) == 0) {
d(printf(" adding job, get %s\n", url));
job = em_format_html_job_new(efh, emfh_gethttp, g_strdup(url));
- } else if (g_ascii_strncasecmp(url, "/", 1) == 0) {
+ } else if (g_str_has_prefix (url, "file://")) {
gchar *data = NULL;
gsize length = 0;
gboolean status;
+ gchar *path;
+
+ path = g_filename_from_uri (url, NULL, NULL);
+ g_return_if_fail (path != NULL);
- status = g_file_get_contents (url, &data, &length, NULL);
+ status = g_file_get_contents (path, &data, &length, NULL);
if (status)
gtk_html_stream_write (handle, data, length);
- gtk_html_stream_close(handle, status? GTK_HTML_STREAM_OK : GTK_HTML_STREAM_ERROR);
+ gtk_html_stream_close (handle, status ? GTK_HTML_STREAM_OK : GTK_HTML_STREAM_ERROR);
g_free (data);
+ g_free (path);
} else {
d(printf("HTML Includes reference to unknown uri '%s'\n", url));
gtk_html_stream_close(handle, GTK_HTML_STREAM_ERROR);
@@ -2295,74 +2300,43 @@ efh_format_address (EMFormatHTML *efh, GString *out, struct _camel_header_addres
/* Let us add a '...' if we have more addresses */
if (limit > 0 && wrap && a && (i>(limit-1))) {
-
- gchar * evolution_imagesdir = g_filename_to_uri(EVOLUTION_IMAGESDIR, NULL, NULL);
+ gchar *evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL);
if (!strcmp (field, _("To"))) {
-
g_string_append (out, "<a href=\"##TO##\">...</a>");
-#ifdef G_OS_WIN32
- str = g_strdup_printf ("<a href=\"##TO##\">+</a> ");
-#else
- str = g_strdup_printf ("<a href=\"##TO##\"><img src=\"%s/plus.png\" /></a> ", evolution_imagesdir);
-#endif
- g_free(evolution_imagesdir);
-
- return str;
+ str = g_strdup_printf ("<a href=\"##TO##\"><img src=\"%s/plus.png\"></a> ", evolution_imagesdir);
}
else if (!strcmp (field, _("Cc"))) {
g_string_append (out, "<a href=\"##CC##\">...</a>");
-#ifdef G_OS_WIN32
- str = g_strdup_printf ("<a href=\"##CC##\">+</a> ");
-#else
- str = g_strdup_printf ("<a href=\"##CC##\"><img src=\"%s/plus.png\" /></a> ", evolution_imagesdir);
-#endif
- g_free(evolution_imagesdir);
-
- return str;
+ str = g_strdup_printf ("<a href=\"##CC##\"><img src=\"%s/plus.png\"></a> ", evolution_imagesdir);
}
else if (!strcmp (field, _("Bcc"))) {
g_string_append (out, "<a href=\"##BCC##\">...</a>");
-#ifdef G_OS_WIN32
- str = g_strdup_printf ("<a href=\"##BCC##\">+</a> ");
-#else
- str = g_strdup_printf ("<a href=\"##BCC##\"><img src=\"%s/plus.png\" /></a> ", evolution_imagesdir);
-#endif
- g_free(evolution_imagesdir);
+ str = g_strdup_printf ("<a href=\"##BCC##\"><img src=\"%s/plus.png\"></a> ", evolution_imagesdir);
+ }
+ g_free (evolution_imagesdir);
+
+ if (str)
return str;
- }
}
}
if (limit > 0 && i>(limit)) {
-
- gchar * evolution_imagesdir = g_filename_to_uri(EVOLUTION_IMAGESDIR, NULL, NULL);
+ gchar *evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL);
if (!strcmp (field, _("To"))) {
-#ifdef G_OS_WIN32
- str = g_strdup_printf ("<a href=\"##TO##\">-</a> ");
-#else
- str = g_strdup_printf ("<a href=\"##TO##\"><img src=\"%s/minus.png\" /></a> ", evolution_imagesdir);
-#endif
+ str = g_strdup_printf ("<a href=\"##TO##\"><img src=\"%s/minus.png\"></a> ", evolution_imagesdir);
}
else if (!strcmp (field, _("Cc"))) {
-#ifdef G_OS_WIN32
- str = g_strdup_printf ("<a href=\"##CC##\">-</a> ");
-#else
- str = g_strdup_printf ("<a href=\"##CC##\"><img src=\"%s/minus.png\" /></a> ", evolution_imagesdir);
-#endif
+ str = g_strdup_printf ("<a href=\"##CC##\"><img src=\"%s/minus.png\"></a> ", evolution_imagesdir);
}
else if (!strcmp (field, _("Bcc"))) {
-#ifdef G_OS_WIN32
- str = g_strdup_printf ("<a href=\"##BCC##\">-</a> ");
-#else
- str = g_strdup_printf ("<a href=\"##BCC##\"><img src=\"%s/minus.png\" /></a> ", evolution_imagesdir);
-#endif
+ str = g_strdup_printf ("<a href=\"##BCC##\"><img src=\"%s/minus.png\"></a> ", evolution_imagesdir);
}
- g_free(evolution_imagesdir);
+ g_free (evolution_imagesdir);
}
return str;