aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-display.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-11-28 05:41:18 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-11-28 05:41:18 +0800
commitba58d14fae68c551073dd4bc97179551eeecd098 (patch)
tree04dd451b65e16835ab57c02cd6028e711f24a4e1 /mail/mail-display.c
parent8b80096cad750de0a00b252730aa019a69314813 (diff)
downloadgsoc2013-evolution-ba58d14fae68c551073dd4bc97179551eeecd098.tar.gz
gsoc2013-evolution-ba58d14fae68c551073dd4bc97179551eeecd098.tar.zst
gsoc2013-evolution-ba58d14fae68c551073dd4bc97179551eeecd098.zip
merged from evoution-1-0-branch
2001-11-25 Not Zed <NotZed@Ximian.com> * mail-config.c (config_read): Enable news accounts that exist always, since no gui for it. 2001-11-20 Jeffrey Stedfast <fejj@ximian.com> * message-list.c (message_list_select): 'n' shouldn't wrap if 'p' doesn't. * mail-format.c (format_mime_part): Make sure the mime-type is non-NULL before passing it off to mail_lookup_handler(). 2001-11-20 Not Zed <NotZed@Ximian.com> * folder-browser-ui.c: Disable search if no message loaded/viewed. Also for #14348. * folder-browser.c: Disable "Add sender to addressbook" if we dont have a message loaded (it wont work). For #14348. 2001-11-20 Jeffrey Stedfast <fejj@ximian.com> * mail-display.c (load_content_loaded): Make sure the mail-display object is still "alive" before accessing any of it's data. svn path=/trunk/; revision=14796
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r--mail/mail-display.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 552f4db3ca..47709c1897 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -1116,7 +1116,7 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
struct _load_content_msg {
struct _mail_msg msg;
-
+
MailDisplay *display;
GtkHTMLStream *handle;
@@ -1146,10 +1146,10 @@ try_part_urls (struct _load_content_msg *m)
{
GHashTable *urls;
CamelMedium *medium;
-
+
urls = g_datalist_get_data (m->display->data, "part_urls");
g_return_val_if_fail (urls != NULL, FALSE);
-
+
/* See if it refers to a MIME part (cid: or http:) */
medium = g_hash_table_lookup (urls, m->url);
if (medium) {
@@ -1167,11 +1167,11 @@ try_part_urls (struct _load_content_msg *m)
html_stream = mail_stream_gtkhtml_new (m->display->html, m->handle);
camel_data_wrapper_write_to_stream (data, html_stream);
camel_object_unref (CAMEL_OBJECT (html_stream));
-
+
gtk_html_end (m->display->html, m->handle, GTK_HTML_STREAM_OK);
return TRUE;
}
-
+
return FALSE;
}
@@ -1180,10 +1180,10 @@ try_data_urls (struct _load_content_msg *m)
{
GHashTable *urls;
GByteArray *ba;
-
+
urls = g_datalist_get_data (m->display->data, "data_urls");
ba = g_hash_table_lookup (urls, m->url);
-
+
printf ("url: %s data: %p len: %d\n", m->url, ba, ba ? ba->len : -1);
if (ba) {
if (ba->len) {
@@ -1193,7 +1193,7 @@ try_data_urls (struct _load_content_msg *m)
gtk_html_end (m->display->html, m->handle, GTK_HTML_STREAM_OK);
return TRUE;
}
-
+
return FALSE;
}
@@ -1201,7 +1201,10 @@ static void
load_content_loaded (struct _mail_msg *mm)
{
struct _load_content_msg *m = (struct _load_content_msg *)mm;
-
+
+ if (GTK_OBJECT_DESTROYED (m->display))
+ return;
+
if (m->display->current_message == m->message) {
if (m->handle) {
printf ("handle: %p orig: %d actual: %d\n", m->handle,
@@ -1220,7 +1223,7 @@ static void
load_content_free (struct _mail_msg *mm)
{
struct _load_content_msg *m = (struct _load_content_msg *)mm;
-
+
g_free (m->url);
gtk_object_unref (GTK_OBJECT (m->display));
camel_object_unref (CAMEL_OBJECT (m->message));
@@ -1243,7 +1246,7 @@ stream_write_or_redisplay_when_loaded (MailDisplay *md,
{
struct _load_content_msg *m;
GHashTable *loading;
-
+
loading = g_datalist_get_data (md->data, "loading");
if (loading) {
if (g_hash_table_lookup (loading, key))
@@ -1254,18 +1257,18 @@ stream_write_or_redisplay_when_loaded (MailDisplay *md,
(GDestroyNotify)g_hash_table_destroy);
}
g_hash_table_insert (loading, (gpointer)key, GINT_TO_POINTER (1));
-
+
m = mail_msg_new (&load_content_op, NULL, sizeof (*m));
m->display = md;
+ gtk_object_ref (GTK_OBJECT (m->display));
m->handle = handle;
m->url = g_strdup (url);
m->redisplay_counter = md->redisplay_counter;
- gtk_object_ref (GTK_OBJECT (m->display));
m->message = md->current_message;
camel_object_ref (CAMEL_OBJECT (m->message));
m->callback = callback;
m->data = data;
-
+
e_thread_put (mail_thread_queued, (EMsg *)m);
return;
}
@@ -1469,7 +1472,8 @@ mail_display_destroy (GtkObject *object)
g_datalist_clear (mail_display->data);
g_free (mail_display->data);
-
+ mail_display->data = NULL;
+
if (mail_display->idle_id)
gtk_timeout_remove(mail_display->idle_id);