From 31c42749c183a53952fd21b25b442cfc93ce9a8f Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 7 Apr 2004 21:48:36 +0000 Subject: Fix for bug #56538 2004-04-07 Jeffrey Stedfast Fix for bug #56538 * em-folder-view.c (emfv_set_folder_uri): Don't set the preview empty here. (emfv_set_folder): If the folder is the same as the folder already on the emfv, just return. Otherwise clear the preview and continue setting the folder as normal. svn path=/trunk/; revision=25364 --- mail/ChangeLog | 10 ++++++++++ mail/em-folder-view.c | 43 +++++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 3f10acdc65..135cbb614a 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2004-04-07 Jeffrey Stedfast + + Fix for bug #56538 + + * em-folder-view.c (emfv_set_folder_uri): Don't set the preview + empty here. + (emfv_set_folder): If the folder is the same as the folder already + on the emfv, just return. Otherwise clear the preview and continue + setting the folder as normal. + 2004-04-07 Jeffrey Stedfast * em-account-prefs.c (em_account_prefs_apply): Removed. diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index b1d1e43396..418d8f0446 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -355,27 +355,33 @@ emfv_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) && (em_utils_folder_is_drafts(folder, uri) || em_utils_folder_is_sent(folder, uri) || em_utils_folder_is_outbox(folder, uri))); - + + if (folder == emfv->folder) + return; + + if (emfv->preview) + em_format_format ((EMFormat *) emfv->preview, NULL, NULL, NULL); + message_list_set_folder(emfv->list, folder, uri, isout); g_free(emfv->folder_uri); emfv->folder_uri = g_strdup(uri); - if (folder != emfv->folder) { - if (emfv->folder) { - mail_sync_folder (emfv->folder, NULL, NULL); - camel_object_remove_event(emfv->folder, emfv->priv->folder_changed_id); - camel_object_remove_event(emfv->folder, emfv->priv->message_changed_id); - camel_object_unref(emfv->folder); - } - emfv->folder = folder; - if (folder) { - emfv->priv->folder_changed_id = camel_object_hook_event(folder, "folder_changed", - (CamelObjectEventHookFunc)emfv_folder_changed, emfv); - emfv->priv->message_changed_id = camel_object_hook_event(folder, "message_changed", - (CamelObjectEventHookFunc)emfv_message_changed, emfv); - camel_object_ref(folder); - } + + if (emfv->folder) { + mail_sync_folder (emfv->folder, NULL, NULL); + camel_object_remove_event(emfv->folder, emfv->priv->folder_changed_id); + camel_object_remove_event(emfv->folder, emfv->priv->message_changed_id); + camel_object_unref(emfv->folder); } + emfv->folder = folder; + if (folder) { + emfv->priv->folder_changed_id = camel_object_hook_event(folder, "folder_changed", + (CamelObjectEventHookFunc)emfv_folder_changed, emfv); + emfv->priv->message_changed_id = camel_object_hook_event(folder, "message_changed", + (CamelObjectEventHookFunc)emfv_message_changed, emfv); + camel_object_ref(folder); + } + emfv_enable_menus(emfv); } @@ -383,16 +389,13 @@ static void emfv_got_folder(char *uri, CamelFolder *folder, void *data) { EMFolderView *emfv = data; - + em_folder_view_set_folder(emfv, folder, uri); } static void emfv_set_folder_uri(EMFolderView *emfv, const char *uri) { - if (emfv->preview) - em_format_format((EMFormat *)emfv->preview, NULL, NULL, NULL); - mail_get_folder(uri, 0, emfv_got_folder, emfv, mail_thread_new); } -- cgit