diff options
author | Milan Crha <mcrha@redhat.com> | 2010-04-08 19:55:10 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-04-08 19:55:10 +0800 |
commit | d9deaf9bbc7fd9d0c72d5cf9b1981e3a56ed1162 (patch) | |
tree | 74fecc4aed66f48f6f36c463fe8259d66c46a889 /mail | |
parent | 230002baad84470d68a5275a3b650668a1e72138 (diff) | |
download | gsoc2013-evolution-d9deaf9bbc7fd9d0c72d5cf9b1981e3a56ed1162.tar.gz gsoc2013-evolution-d9deaf9bbc7fd9d0c72d5cf9b1981e3a56ed1162.tar.zst gsoc2013-evolution-d9deaf9bbc7fd9d0c72d5cf9b1981e3a56ed1162.zip |
Bug #614325 - Shrink/expand To,Cc header images is missing
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-display.c | 4 | ||||
-rw-r--r-- | mail/em-format-html.c | 68 |
2 files changed, 23 insertions, 49 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 9f9569dd8a..fda1f3a034 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -255,12 +255,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 2a09d713a9..f89c89a6b9 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -1474,17 +1474,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); @@ -2291,74 +2296,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; |