aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-05-04 03:39:09 +0800
committerMilan Crha <mcrha@redhat.com>2010-05-04 03:39:09 +0800
commit0fb409b6c5c18c43b49bf18f4a52c9883f6e2ab2 (patch)
tree0f475fbc722e34717efa08d47df594268819f2b1
parent90dcf3eb7ecc879f00c1ef8166b6aa667efc2556 (diff)
downloadgsoc2013-evolution-0fb409b6c5c18c43b49bf18f4a52c9883f6e2ab2.tar
gsoc2013-evolution-0fb409b6c5c18c43b49bf18f4a52c9883f6e2ab2.tar.gz
gsoc2013-evolution-0fb409b6c5c18c43b49bf18f4a52c9883f6e2ab2.tar.bz2
gsoc2013-evolution-0fb409b6c5c18c43b49bf18f4a52c9883f6e2ab2.tar.lz
gsoc2013-evolution-0fb409b6c5c18c43b49bf18f4a52c9883f6e2ab2.tar.xz
gsoc2013-evolution-0fb409b6c5c18c43b49bf18f4a52c9883f6e2ab2.tar.zst
gsoc2013-evolution-0fb409b6c5c18c43b49bf18f4a52c9883f6e2ab2.zip
Bug #611560 - 'Mark as junk' should be disabled in junk folder
-rw-r--r--mail/e-mail-reader.c6
-rw-r--r--mail/e-mail-reader.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index d238d500a9..53d45fd2e5 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -2314,7 +2314,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;
@@ -2758,6 +2758,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;
@@ -2770,6 +2771,7 @@ e_mail_reader_check_state (EMailReader *reader)
if (folder != NULL) {
store = CAMEL_STORE (folder->parent_store);
store_supports_vjunk = (store->flags & CAMEL_STORE_VJUNK);
+ is_junk_folder = (folder->folder_flags & CAMEL_FOLDER_IS_JUNK) != 0;
}
drafts_or_outbox =
@@ -2885,6 +2887,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);
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index a79d7f5274..b724d6e19b 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -75,7 +75,8 @@ enum {
E_MAIL_READER_SELECTION_HAS_UNDELETED = 1 << 12,
E_MAIL_READER_SELECTION_HAS_UNIMPORTANT = 1 << 13,
E_MAIL_READER_SELECTION_HAS_UNREAD = 1 << 14,
- E_MAIL_READER_SELECTION_IS_MAILING_LIST = 1 << 15
+ E_MAIL_READER_SELECTION_IS_MAILING_LIST = 1 << 15,
+ E_MAIL_READER_FOLDER_IS_JUNK = 1 << 16
};
struct _EMailReaderIface {