From eff89404e4956f1b61c77d56341cf6423e7543dc Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 2 Oct 2003 05:34:36 +0000 Subject: zero out last_part if we're clearing. Uh, this fixes, but shouldn't, part 2003-10-02 Not Zed * em-format-html.c (efh_format_timeout): zero out last_part if we're clearing. Uh, this fixes, but shouldn't, part of #49034. The problem is the 'last part' logic is based on the address, which can quite easily be repeated for different messages. * em-folder-view.c (emfv_list_message_selected): reverted jeff's patch for #48618, use a much simpler method. * em-message-browser.c (emmb_destroy): hook onto destroy handler, we need to destroy the messagelist ourselves, since we dont attach it to any parent window. svn path=/trunk/; revision=22785 --- mail/ChangeLog | 14 ++++++++++++ mail/em-folder-view.c | 58 ++++++++++++----------------------------------- mail/em-format-html.c | 1 + mail/em-message-browser.c | 14 ++++++++++++ 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index cb716bbcd3..3cc81eb481 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,17 @@ +2003-10-02 Not Zed + + * em-format-html.c (efh_format_timeout): zero out last_part if + we're clearing. Uh, this fixes, but shouldn't, part of #49034. + The problem is the 'last part' logic is based on the address, + which can quite easily be repeated for different messages. + + * em-folder-view.c (emfv_list_message_selected): reverted jeff's + patch for #48618, use a much simpler method. + + * em-message-browser.c (emmb_destroy): hook onto destroy handler, + we need to destroy the messagelist ourselves, since we dont attach + it to any parent window. + 2003-10-01 Not Zed * em-format-html.c (efh_init): turn off blocking writes. diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index cbe1fc913a..29a2b51ccd 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -106,9 +106,8 @@ static const EMFolderViewEnable emfv_enable_map[]; struct _EMFolderViewPrivate { guint seen_id; guint setting_notify_id; - - char *loaded_uid; - char *loading_uid; + + char *displayed_uid; /* only used to stop re-loads, don't use it to represent any selection state */ CamelObjectHookID folder_changed_id; @@ -179,10 +178,7 @@ emfv_finalise(GObject *o) g_slist_free(emfv->ui_files); g_slist_free(emfv->enable_map); - - g_free (p->loaded_uid); - g_free (p->loading_uid); - + g_free(p); ((GObjectClass *)emfv_parent)->finalize(o); @@ -1588,16 +1584,8 @@ static void emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data) { EMFolderView *emfv = data; - - g_free (emfv->priv->loaded_uid); - if (emfv->priv->loading_uid && !strcmp (emfv->priv->loading_uid, uid)) { - emfv->priv->loaded_uid = emfv->priv->loading_uid; - emfv->priv->loading_uid = NULL; - } else { - emfv->priv->loaded_uid = g_strdup (uid); - } - - em_format_format((EMFormat *) emfv->preview, (struct _CamelMedium *)msg); + + em_format_format((EMFormat *)emfv->preview, (struct _CamelMedium *)msg); if (emfv->priv->seen_id) g_source_remove(emfv->priv->seen_id); @@ -1605,11 +1593,11 @@ emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeM if (msg && emfv->mark_seen) { if (emfv->mark_seen_timeout > 0) { struct mst_t *mst; - + mst = g_new (struct mst_t, 1); mst->emfv = emfv; mst->uid = g_strdup (uid); - + emfv->priv->seen_id = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, emfv->mark_seen_timeout, (GSourceFunc)do_mark_seen, mst, (GDestroyNotify)mst_free); } else { @@ -1622,35 +1610,19 @@ static void emfv_list_message_selected(MessageList *ml, const char *uid, EMFolderView *emfv) { /* FIXME: ui stuff based on messageinfo, if available */ + if (emfv->preview_active) { - if (uid != NULL) { - if (emfv->priv->loading_uid != NULL) { - if (!strcmp (emfv->priv->loading_uid, uid)) - return; - } else if (emfv->priv->loaded_uid != NULL) { - if (!strcmp (emfv->priv->loaded_uid, uid)) - return; + if (uid) { + if (emfv->priv->displayed_uid == NULL || strcmp(emfv->priv->displayed_uid, uid) != 0) { + g_free(emfv->priv->displayed_uid); + emfv->priv->displayed_uid = g_strdup(uid); + mail_get_message(emfv->folder, uid, emfv_list_done_message_selected, emfv, mail_thread_new); } - - g_free (emfv->priv->loading_uid); - emfv->priv->loading_uid = g_strdup (uid); - - mail_get_message(emfv->folder, uid, emfv_list_done_message_selected, emfv, mail_thread_new); } else { - g_free (emfv->priv->loaded_uid); - emfv->priv->loaded_uid = NULL; - - g_free (emfv->priv->loading_uid); - emfv->priv->loading_uid = NULL; - + g_free(emfv->priv->displayed_uid); + emfv->priv->displayed_uid = NULL; em_format_format((EMFormat *)emfv->preview, NULL); } - } else { - g_free (emfv->priv->loaded_uid); - emfv->priv->loaded_uid = NULL; - - g_free (emfv->priv->loading_uid); - emfv->priv->loading_uid = NULL; } emfv_enable_menus(emfv); diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 63f7f7f695..6d38eda3f5 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -1192,6 +1192,7 @@ efh_format_timeout(struct _format_msg *m) hstream = gtk_html_begin(efh->html); gtk_html_stream_close(hstream, GTK_HTML_STREAM_OK); mail_msg_free(m); + p->last_part = NULL; } else { /*hstream = gtk_html_begin(efh->html);*/ hstream = NULL; diff --git a/mail/em-message-browser.c b/mail/em-message-browser.c index 68636a2d37..f7eb7ecd49 100644 --- a/mail/em-message-browser.c +++ b/mail/em-message-browser.c @@ -88,10 +88,24 @@ emmb_finalise(GObject *o) ((GObjectClass *)emmb_parent)->finalize(o); } +static void +emmb_destroy(GtkObject *o) +{ + EMMessageBrowser *emmb = (EMMessageBrowser *)o; + + if (emmb->view.list) { + gtk_widget_destroy(emmb->view.list); + emmb->view.list = NULL; + } + + ((GtkObjectClass *)emmb_parent)->destroy(o); +} + static void emmb_class_init(GObjectClass *klass) { klass->finalize = emmb_finalise; + ((GtkObjectClass *)klass)->destroy = emmb_destroy; ((EMFolderViewClass *)klass)->set_message = emmb_set_message; ((EMFolderViewClass *)klass)->activate = emmb_activate; } -- cgit v1.2.3