From dfb793f762502fcc73a91c1e6799ee29cbbf5169 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 13 Apr 2004 16:00:21 +0000 Subject: track the messagelist hidedeleted value since it looks it up when we set 004-04-13 Not Zed * em-folder-view.c (emfv_set_folder): track the messagelist hidedeleted value since it looks it up when we set the folder. * em-folder-browser.c (emfb_hide_deleted): use new method below to propagate change. (emfb_activate): same. * em-folder-view.c (em_folder_view_set_hide_deleted): accessor to set the hide_deleted state, emits a view_changed event. * mail-component.c (view_changed_cb): use VISIBLE rather than TOTAL for the displayed total count. Also deleted if we're not in hide deleted mode. And do spethal things with spethal folders, etc. svn path=/trunk/; revision=25438 --- mail/em-folder-browser.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'mail/em-folder-browser.c') diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c index fb9b2528e1..e09277a09a 100644 --- a/mail/em-folder-browser.c +++ b/mail/em-folder-browser.c @@ -738,10 +738,7 @@ emfb_hide_deleted(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_E gconf = mail_config_get_gconf_client (); gconf_client_set_bool(gconf, "/apps/evolution/mail/display/show_deleted", state[0] == '0', NULL); - if (!(emfv->folder && (emfv->folder->folder_flags & CAMEL_FOLDER_IS_TRASH))) { - message_list_set_hidedeleted(emfv->list, state[0] != '0'); - emfv->hide_deleted = state[0] != '0'; - } + em_folder_view_set_hide_deleted(emfv, state[0] != '0'); } static void @@ -1015,7 +1012,7 @@ emfb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act) if (act) { GConfClient *gconf; - gboolean state; + gboolean state, newstate; char *sstate; gconf = mail_config_get_gconf_client (); @@ -1057,9 +1054,8 @@ emfb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act) state = !gconf_client_get_bool(gconf, "/apps/evolution/mail/display/show_deleted", NULL); bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "state", state ? "1" : "0", NULL); bonobo_ui_component_add_listener(uic, "HideDeleted", emfb_hide_deleted, emfv); - if (!(emfv->folder && (emfv->folder->folder_flags & CAMEL_FOLDER_IS_TRASH))) - message_list_set_hidedeleted (emfv->list, state); - else + em_folder_view_set_hide_deleted(emfv, state); /* <- not sure if this optimal, but it'll do */ + if (emfv->folder == NULL) bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "sensitive", state?"1":"0", NULL); /* FIXME: If we have no folder, we can't do a few of the lookups we need, -- cgit