From 79d07ca8cad15d7ec6e3d37e261ddc6d401374a8 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 16 Jul 2001 19:06:55 +0000 Subject: prototype outbox_folder so we can check if a folder is it. 2001-07-16 Peter Williams * mail-folder-cache.c (outbox_folder): prototype outbox_folder so we can check if a folder is it. (make_folder_name): If the folder is the outbox, display the count of total messages as "unsent". (make_folder_status): If the folder is the outbox, display "unsent" instead of "total" svn path=/trunk/; revision=11132 --- mail/mail-folder-cache.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'mail/mail-folder-cache.c') diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 8e66866e7a..621a8b873c 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -39,8 +39,6 @@ #define ld(x) #define d(x) -/* is args... portable at all? */ - /* Structures */ typedef enum mail_folder_info_flags { @@ -92,6 +90,8 @@ static GStaticMutex folders_lock = G_STATIC_MUTEX_INIT; static GNOME_Evolution_ShellView shell_view = CORBA_OBJECT_NIL; static FolderBrowser *folder_browser = NULL; +extern CamelFolder *outbox_folder; + /* Private functions */ /* call this with the folders locked */ @@ -139,7 +139,13 @@ make_folder_name (mail_folder_info *mfi) work = g_string_new (mfi->name); - if (mfi->flags & MAIL_FIF_UNREAD_VALID && mfi->unread) + /* the way the logic is now, an outbox folder simply doesn't have + * its unread count displayed. Makes sense to me at the moment. */ + + if (mfi->flags & MAIL_FIF_FOLDER_VALID && mfi->folder == outbox_folder) { + if (mfi->flags & MAIL_FIF_TOTAL_VALID) + g_string_sprintfa (work, " (%d unsent)", mfi->total); + } else if (mfi->flags & MAIL_FIF_UNREAD_VALID && mfi->unread) g_string_sprintfa (work, " (%d)", mfi->unread); ret = work->str; @@ -175,7 +181,11 @@ make_folder_status (mail_folder_info *mfi) if (mfi->flags & MAIL_FIF_TOTAL_VALID) { if (set_one) work = g_string_append (work, _(", ")); - g_string_sprintfa (work, _("%d total"), mfi->total); + + if (mfi->flags & MAIL_FIF_FOLDER_VALID && mfi->folder == outbox_folder) + g_string_sprintfa (work, _("%d unsent"), mfi->total); + else + g_string_sprintfa (work, _("%d total"), mfi->total); } ret = work->str; -- cgit v1.2.3