From 6d0d9bb37a0a1575f4e537a52f0f53fd06638103 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 5 Aug 2005 05:59:50 +0000 Subject: Fixes the bug #312410. 2005-08-05 Srinivasa Ragavan * em-format-html-display.c (efhd_init) (efhd_complete) (efhd_message_add_bar): Fixes the bug #312410. svn path=/trunk/; revision=29996 --- mail/ChangeLog | 5 +++++ mail/em-format-html-display.c | 20 +++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index f7a39e876e..54bfcc5678 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2005-08-05 Srinivasa Ragavan + + * em-format-html-display.c (efhd_init) (efhd_complete) (efhd_message_add_bar): + Fixes the bug #312410. + 2005-08-04 Srinivasa Ragavan * em-utls.c (emu_update_save_path): Killed a warning. diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index a1da4532a8..72adbae97a 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -114,7 +114,6 @@ struct _EMFormatHTMLDisplayPrivate { GtkWidget *down; GtkWidget *save; gboolean show_bar; - gboolean bar_added; GHashTable *files; }; @@ -277,8 +276,7 @@ efhd_init(GObject *o) #undef efh efhd->priv->show_bar = FALSE; - efhd->priv->bar_added = FALSE; - efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + efhd->priv->files = NULL; } static void @@ -679,6 +677,11 @@ efhd_complete(EMFormat *emf) if (efhd->priv->search_dialog) efhd_update_matches(efhd); + + if (efhd->priv->files) { + g_hash_table_destroy (efhd->priv->files); + efhd->priv->files = NULL; + } } /* ********************************************************************** */ @@ -1045,12 +1048,6 @@ static void efhd_format_clone(EMFormat *emf, CamelFolder *folder, const char *ui efhd->priv->show_bar = FALSE; } - efhd->priv->attachment_bar = NULL; - efhd->priv->bar_added = FALSE; - if (efhd->priv->files) - g_hash_table_destroy(efhd->priv->files); - efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); - ((EMFormatClass *)efhd_parent)->format_clone(emf, folder, uid, msg, src); } @@ -1954,10 +1951,11 @@ efhd_message_add_bar(EMFormat *emf, CamelStream *stream, CamelMimePart *part, co EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *) emf; const char *classid = "attachment-bar"; - if (efhd->priv->bar_added) + if (efhd->priv->files) return; - efhd->priv->bar_added = TRUE; + efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + em_format_html_add_pobject((EMFormatHTML *)emf, sizeof(EMFormatHTMLPObject), classid, part, efhd_add_bar); camel_stream_printf(stream, "", classid); } -- cgit v1.2.3