diff options
-rw-r--r-- | mail/ChangeLog | 11 | ||||
-rw-r--r-- | mail/em-folder-view.c | 2 | ||||
-rw-r--r-- | mail/em-popup.c | 12 | ||||
-rw-r--r-- | mail/mail-folder-cache.c | 7 |
4 files changed, 27 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 25b17da8d7..d705da3c81 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2007-11-05 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #488298 + + * em-folder-view.c: (EMFolderViewEnable emfv_enable_map[]): + Disable "MessageMarkAsNotJunk" if requested by context. + * mail-folder-cache.c: (update_1folder): Do not count junked + messages into "new" messages in drafts and out box. + * em-popup.c: (em_popup_target_new_select): Disable "MarkAsJunk" + and "MarnAsNotJunk" in drafts and out box. + 2007-11-05 Michael Monreal <mmonreal@svn.gnome.org> ** Fix for bug #492102 diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 51088a67e4..aaa3b00024 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -182,7 +182,7 @@ static const EMFolderViewEnable emfv_enable_map[] = { { "MessageMarkAsImportant", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_IMPORTANT }, { "MessageMarkAsUnimportant", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_UNIMPORTANT }, { "MessageMarkAsJunk", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_JUNK }, - { "MessageMarkAsNotJunk", EM_POPUP_SELECT_MANY }, + { "MessageMarkAsNotJunk", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_NOT_JUNK }, { "MessageFollowUpFlag", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_FLAG_FOLLOWUP }, { "MessageFollowUpComplete", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_FLAG_COMPLETED }, { "MessageFollowUpClear", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_FLAG_CLEAR }, diff --git a/mail/em-popup.c b/mail/em-popup.c index 6e0fc4cc6d..63f7291dfe 100644 --- a/mail/em-popup.c +++ b/mail/em-popup.c @@ -178,6 +178,7 @@ em_popup_target_new_select(EMPopup *emp, struct _CamelFolder *folder, const char EMPopupTargetSelect *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_SELECT, sizeof(*t)); CamelStore *store = CAMEL_STORE (folder->parent_store); guint32 mask = ~0; + gboolean draft_or_outbox; int i; const char *tmp; @@ -197,9 +198,8 @@ em_popup_target_new_select(EMPopup *emp, struct _CamelFolder *folder, const char if (em_utils_folder_is_sent(folder, folder_uri)) mask &= ~EM_POPUP_SELECT_EDIT; - if (!(em_utils_folder_is_drafts(folder, folder_uri) - || em_utils_folder_is_outbox(folder, folder_uri)) - && uids->len == 1) + draft_or_outbox = em_utils_folder_is_drafts(folder, folder_uri) || em_utils_folder_is_outbox(folder, folder_uri); + if (!draft_or_outbox && uids->len == 1) mask &= ~EM_POPUP_SELECT_ADD_SENDER; if (uids->len == 1) @@ -221,11 +221,15 @@ em_popup_target_new_select(EMPopup *emp, struct _CamelFolder *folder, const char else mask &= ~EM_POPUP_SELECT_MARK_READ; - if (store->flags & CAMEL_STORE_VJUNK) { + if ((store->flags & CAMEL_STORE_VJUNK) && !draft_or_outbox) { if ((flags & CAMEL_MESSAGE_JUNK)) mask &= ~EM_POPUP_SELECT_NOT_JUNK; else mask &= ~EM_POPUP_SELECT_JUNK; + } else if (draft_or_outbox) { + /* Show none option */ + mask |= EM_POPUP_SELECT_NOT_JUNK; + mask |= EM_POPUP_SELECT_JUNK; } else { /* Show both options */ mask &= ~EM_POPUP_SELECT_NOT_JUNK; diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index bbe1f902f6..46e9446566 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -360,8 +360,15 @@ update_1folder(struct _folder_info *mfi, int new, CamelFolderInfo *info) unread = camel_folder_get_message_count (folder); if (folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX) || folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_DRAFTS)) { + guint32 junked = 0; + if ((deleted = camel_folder_get_deleted_message_count (folder)) > 0) unread -= deleted; + + camel_object_get (folder, NULL, CAMEL_FOLDER_JUNKED, &junked, NULL); + if (junked > 0) + unread -= junked; + } } else { d(printf(" unread count\n")); |