aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-11-03 10:40:39 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-11-03 10:40:39 +0800
commit1335b50751b46bde7e458138e2becbd8f7b69b9b (patch)
tree000acd05dea99f413b078dd774eb03b508bacb3e /mail/em-format-html.c
parent26139115b4cadd29b0a7eb35826214cbf0375b92 (diff)
downloadgsoc2013-evolution-1335b50751b46bde7e458138e2becbd8f7b69b9b.tar
gsoc2013-evolution-1335b50751b46bde7e458138e2becbd8f7b69b9b.tar.gz
gsoc2013-evolution-1335b50751b46bde7e458138e2becbd8f7b69b9b.tar.bz2
gsoc2013-evolution-1335b50751b46bde7e458138e2becbd8f7b69b9b.tar.lz
gsoc2013-evolution-1335b50751b46bde7e458138e2becbd8f7b69b9b.tar.xz
gsoc2013-evolution-1335b50751b46bde7e458138e2becbd8f7b69b9b.tar.zst
gsoc2013-evolution-1335b50751b46bde7e458138e2becbd8f7b69b9b.zip
revert jeff's last change - we do actually want to know when we couldn't
2004-11-03 Not Zed <NotZed@Ximian.com> * em-folder-view.c (emfv_list_done_message_selected): revert jeff's last change - we do actually want to know when we couldn't load a message. the crash he was fixing was fixed elsewhere. also fix the unref ordering stuff. * em-format-html.c (efh_format_timeout): removed the fixme i added. 2004-11-01 Not Zed <NotZed@Ximian.com> ** See bug #67496. * em-format-html.c (efh_text_html): use the base on the emformat to calculate our absolute iframe uri. (efh_multipart_related): same as emf_multipart_related. * em-format.c (emf_multipart_related): remove content-location handling, now done in format_part_as. (em_format_part_as): track content-base (& absolute content-location) of all parts here. svn path=/trunk/; revision=27807
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r--mail/em-format-html.c46
1 files changed, 8 insertions, 38 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index e92c18fd75..6925e785e5 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -785,7 +785,7 @@ efh_write_text_html(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
static void
efh_text_html(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info)
{
- const char *location, *base, *tmp;
+ const char *location;
EMFormatPURI *puri;
char *cid = NULL;
@@ -793,43 +793,27 @@ efh_text_html(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFor
"<div style=\"border: solid #%06x 1px; background-color: #%06x;\">\n"
"<!-- text/html -->\n",
efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff);
-
- if ((base = camel_medium_get_header((CamelMedium *)part, "Content-Base"))) {
- char *base_url;
- size_t len;
-
- len = strlen(base);
- if (*base == '"' && *(base + len - 1) == '"') {
- len -= 2;
- base_url = alloca(len + 1);
- memcpy(base_url, base + 1, len);
- base_url[len] = '\0';
- base = base_url;
- }
-
- /* FIXME: set base needs to go on the gtkhtml stream? */
- gtk_html_set_base(efh->html, base);
- }
+ /* TODO: perhaps we don't need to calculate this anymore now base is handled better */
/* calculate our own location string so add_puri doesn't do it
for us. our iframes are special cases, we need to use the
proper base url to access them, but other children parts
shouldn't blindly inherit the container's location. */
- tmp = camel_mime_part_get_content_location(part);
- if (tmp == NULL) {
+ location = camel_mime_part_get_content_location(part);
+ if (location == NULL) {
if (((EMFormat *)efh)->base)
cid = camel_url_to_string(((EMFormat *)efh)->base, 0);
else
cid = g_strdup(((EMFormat *)efh)->part_id->str);
} else {
- if (strchr(tmp, ':') == NULL && ((EMFormat *)efh)->base != NULL) {
+ if (strchr(location, ':') == NULL && ((EMFormat *)efh)->base != NULL) {
CamelURL *uri;
- uri = camel_url_new_with_base(((EMFormat *)efh)->base, tmp);
+ uri = camel_url_new_with_base(((EMFormat *)efh)->base, location);
cid = camel_url_to_string(uri, 0);
camel_url_free(uri);
} else {
- cid = g_strdup(tmp);
+ cid = g_strdup(location);
}
}
@@ -1004,9 +988,8 @@ efh_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, c
CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)part);
CamelMimePart *body_part, *display_part = NULL;
CamelContentType *content_type;
- const char *location, *start;
+ const char *start;
int i, nparts, partidlen, displayid = 0;
- CamelURL *base_save = NULL;
EMFormatPURI *puri;
struct _EMFormatHTMLJob *job;
@@ -1045,13 +1028,6 @@ efh_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, c
return;
}
- /* stack of present location and pending uri's */
- location = camel_mime_part_get_content_location(part);
- if (location) {
- d(printf("setting content location %s\n", location));
- base_save = emf->base;
- emf->base = camel_url_new(location, NULL);
- }
em_format_push_level(emf);
partidlen = emf->part_id->len;
@@ -1079,11 +1055,6 @@ efh_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, c
em_format_html_job_queue((EMFormatHTML *)emf, job);
em_format_pull_level(emf);
-
- if (location) {
- camel_url_free(emf->base);
- emf->base = base_save;
- }
}
static void
@@ -1312,7 +1283,6 @@ efh_format_timeout(struct _format_msg *m)
mail_msg_free(m);
p->last_part = NULL;
} else {
- /*hstream = gtk_html_begin(efh->html);*/
hstream = NULL;
m->estream = (EMHTMLStream *)em_html_stream_new(efh->html, hstream);