diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-02-27 08:01:09 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-02-27 08:01:09 +0800 |
commit | 22ac1344f7dff17a6761e2c2826baa37dad864fd (patch) | |
tree | 72fdf2b1022a2dba2463f17dc4a0cd26794b62e5 /mail/mail-display.c | |
parent | 9001aaa2f36f58125c46ccedaad4043213c5767a (diff) | |
download | gsoc2013-evolution-22ac1344f7dff17a6761e2c2826baa37dad864fd.tar.gz gsoc2013-evolution-22ac1344f7dff17a6761e2c2826baa37dad864fd.tar.zst gsoc2013-evolution-22ac1344f7dff17a6761e2c2826baa37dad864fd.zip |
Get the Content-Base if the header exists and use gtk_html_set_base to set
2002-02-26 Jeffrey Stedfast <fejj@ximian.com>
* mail-format.c (handle_text_html): Get the Content-Base if the
header exists and use gtk_html_set_base to set this base url.
* mail-display.c (on_link_clicked): No longer need to calculate
the full url. This is now handled by GtkHTML.
(on_set_base): Removed.
(on_url_requested): No longer need to calculate the full url.
(mail_display_initialize_gtkhtml): Don't connect to the set_base
signal anymore. We don't care.
* mail-display.h: No longer need base_url (it was broken anyway).
svn path=/trunk/; revision=15850
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r-- | mail/mail-display.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c index 81a9fce492..1a1f454828 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -219,16 +219,6 @@ mail_display_jump_to_anchor (MailDisplay *md, const char *url) static void on_link_clicked (GtkHTML *html, const char *url, MailDisplay *md) { - char *full_url; - - if (md->base_url) { - full_url = alloca (strlen (md->base_url) + strlen (url) + 2); - sprintf (full_url, "%s%s%s", md->base_url, - *url == '/' ? "" : "/", url); - - url = full_url; - } - if (!g_strncasecmp (url, "news:", 5) || !g_strncasecmp (url, "nntp:", 5)) g_warning ("Can't handle news URLs yet."); @@ -275,7 +265,7 @@ static void save_cb (GtkWidget *widget, gpointer user_data) { CamelMimePart *part = gtk_object_get_data (GTK_OBJECT (user_data), "CamelMimePart"); - + save_part (part); } @@ -1126,22 +1116,6 @@ ebook_callback (EBook *book, const gchar *addr, ECard *card, gpointer data) } static void -on_set_base (GtkHTML *html, const char *base_url, gpointer user_data) -{ - MailDisplay *md = user_data; - size_t len; - - g_free (md->base_url); - - /* strip the trailing '/' if there is one */ - len = strlen (base_url); - if (base_url[len - 1] == '/') - md->base_url = g_strndup (base_url, len - 1); - else - md->base_url = g_strdup (base_url); -} - -static void on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle, gpointer user_data) { @@ -1149,7 +1123,6 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle, GHashTable *urls; CamelMedium *medium; GByteArray *ba; - char *full_url; urls = g_datalist_get_data (md->data, "part_urls"); g_return_if_fail (urls != NULL); @@ -1193,14 +1166,6 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle, urls = g_datalist_get_data (md->data, "data_urls"); g_return_if_fail (urls != NULL); - if (md->base_url) { - full_url = alloca (strlen (md->base_url) + strlen (url) + 2); - sprintf (full_url, "%s%s%s", md->base_url, - *url == '/' ? "" : "/", url); - - url = full_url; - } - /* See if it's some piece of cached data */ ba = g_hash_table_lookup (urls, url); if (ba) { @@ -1608,7 +1573,6 @@ mail_display_init (GtkObject *object) mail_display->idle_id = 0; mail_display->selection = NULL; mail_display->charset = NULL; - mail_display->base_url = NULL; mail_display->current_message = NULL; mail_display->data = NULL; @@ -1626,7 +1590,6 @@ mail_display_destroy (GtkObject *object) g_free (mail_display->charset); g_free (mail_display->selection); - g_free (mail_display->base_url); g_datalist_clear (mail_display->data); g_free (mail_display->data); @@ -2242,9 +2205,6 @@ mail_display_initialize_gtkhtml (MailDisplay *mail_display, GtkHTML *html) gtk_html_set_editable (GTK_HTML (html), FALSE); - gtk_signal_connect (GTK_OBJECT (html), "set_base", - GTK_SIGNAL_FUNC (on_set_base), - mail_display); gtk_signal_connect (GTK_OBJECT (html), "url_requested", GTK_SIGNAL_FUNC (on_url_requested), mail_display); |