diff options
author | Not Zed <NotZed@Ximian.com> | 2004-04-14 00:00:21 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-04-14 00:00:21 +0800 |
commit | dfb793f762502fcc73a91c1e6799ee29cbbf5169 (patch) | |
tree | 5eee47af4eb8f3fc2abcba1f92b3a73aa6adda20 /mail/mail-component.c | |
parent | 8563120ccac076a0baf9cb904c23a87bbb59d960 (diff) | |
download | gsoc2013-evolution-dfb793f762502fcc73a91c1e6799ee29cbbf5169.tar.gz gsoc2013-evolution-dfb793f762502fcc73a91c1e6799ee29cbbf5169.tar.zst gsoc2013-evolution-dfb793f762502fcc73a91c1e6799ee29cbbf5169.zip |
track the messagelist hidedeleted value since it looks it up when we set
004-04-13 Not Zed <NotZed@Ximian.com>
* 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
Diffstat (limited to 'mail/mail-component.c')
-rw-r--r-- | mail/mail-component.c | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/mail/mail-component.c b/mail/mail-component.c index e8b6d3ccf4..f025b79f2a 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -73,8 +73,8 @@ #include <gal/e-table/e-tree.h> #include <gal/e-table/e-tree-memory.h> -#include <camel/camel.h> #include <camel/camel-file-utils.h> +#include <camel/camel-vtrash-folder.h> #include <bonobo/bonobo-control.h> #include <bonobo/bonobo-widget.h> @@ -456,14 +456,40 @@ static void view_changed_cb(EMFolderView *emfv, EInfoLabel *el) { if (emfv->folder) { - char *tmp, *name; - guint32 total, unread; - - camel_object_get(emfv->folder, NULL, CAMEL_FOLDER_NAME, &name, CAMEL_FOLDER_TOTAL, &total, CAMEL_FOLDER_UNREAD, &unread, NULL); - /* Format of text for component information area */ - tmp = g_strdup_printf(_("%d total, %d unread"), total, unread); - e_info_label_set_info(el, name, tmp); - g_free(tmp); + char *name; + guint32 visible, unread, deleted, junked; + GString *tmp = g_string_new(""); + + camel_object_get(emfv->folder, NULL, + CAMEL_FOLDER_NAME, &name, + CAMEL_FOLDER_DELETED, &deleted, + CAMEL_FOLDER_VISIBLE, &visible, + CAMEL_FOLDER_JUNKED, &junked, + CAMEL_FOLDER_UNREAD, &unread, NULL); + + if (CAMEL_IS_VTRASH_FOLDER(emfv->folder)) { + if (((CamelVTrashFolder *)emfv->folder)->type == CAMEL_VTRASH_FOLDER_TRASH) + g_string_append_printf(tmp, _("%d deleted"), deleted); + else + g_string_append_printf(tmp, _("%d junk"), junked); + } else { + if (em_utils_folder_is_drafts(emfv->folder, emfv->folder_uri)) + g_string_append_printf(tmp, _("%d drafts"), visible); + else if (em_utils_folder_is_sent(emfv->folder, emfv->folder_uri)) + g_string_append_printf(tmp, _("%d sent"), visible); + else if (em_utils_folder_is_outbox(emfv->folder, emfv->folder_uri)) + g_string_append_printf(tmp, _("%d unsent"), visible); + else { + if (!emfv->hide_deleted) + visible += deleted; + g_string_append_printf(tmp, _("%d total"), visible); + if (unread) + g_string_append_printf(tmp, _(", %d unread"), unread); + } + } + + e_info_label_set_info(el, name, tmp->str); + g_string_free(tmp, TRUE); camel_object_free(emfv->folder, CAMEL_FOLDER_NAME, name); } else { e_info_label_set_info(el, _("Mail"), ""); |