aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-reader.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-05-04 03:36:50 +0800
committerMilan Crha <mcrha@redhat.com>2010-05-04 03:36:50 +0800
commit7636175248e8b6a8fa73244327f52230415cbaa6 (patch)
tree7c50705aaeee16f673dae02ae21482597666680c /mail/e-mail-reader.c
parente1b44a9c3e8db677b58723cb9738ce626a7a08da (diff)
downloadgsoc2013-evolution-7636175248e8b6a8fa73244327f52230415cbaa6.tar.gz
gsoc2013-evolution-7636175248e8b6a8fa73244327f52230415cbaa6.tar.zst
gsoc2013-evolution-7636175248e8b6a8fa73244327f52230415cbaa6.zip
Bug #611560 - 'Mark as junk' should be disabled in junk folder
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r--mail/e-mail-reader.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index fb863b1452..5729486201 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -2303,7 +2303,7 @@ mail_reader_update_actions (EMailReader *reader)
action_name = "mail-mark-junk";
sensitive = selection_has_not_junk_messages;
action = e_mail_reader_get_action (reader, action_name);
- gtk_action_set_sensitive (action, sensitive);
+ gtk_action_set_sensitive (action, sensitive && !(state & E_MAIL_READER_FOLDER_IS_JUNK));
action_name = "mail-mark-notjunk";
sensitive = selection_has_junk_messages;
@@ -2721,6 +2721,7 @@ e_mail_reader_check_state (EMailReader *reader)
gboolean drafts_or_outbox;
gboolean store_supports_vjunk = FALSE;
gboolean is_mailing_list;
+ gboolean is_junk_folder = FALSE;
guint32 state = 0;
guint ii;
@@ -2733,6 +2734,7 @@ e_mail_reader_check_state (EMailReader *reader)
if (folder != NULL) {
store = camel_folder_get_parent_store (folder);
store_supports_vjunk = (store->flags & CAMEL_STORE_VJUNK);
+ is_junk_folder = (folder->folder_flags & CAMEL_FOLDER_IS_JUNK) != 0;
}
drafts_or_outbox =
@@ -2850,6 +2852,8 @@ e_mail_reader_check_state (EMailReader *reader)
state |= E_MAIL_READER_SELECTION_HAS_UNREAD;
if (is_mailing_list)
state |= E_MAIL_READER_SELECTION_IS_MAILING_LIST;
+ if (is_junk_folder)
+ state |= E_MAIL_READER_FOLDER_IS_JUNK;
em_utils_uids_free (uids);