aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-02-07 22:07:12 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-02-07 22:32:54 +0800
commit5795e22cb7a67056948f81e1faca2dcecb9333de (patch)
tree759b3a7a16b24d26180d667904c0038ffe4f9908 /mail
parent0972cb0671b13783594ba9ad92c604e27e479152 (diff)
downloadgsoc2013-evolution-5795e22cb7a67056948f81e1faca2dcecb9333de.tar
gsoc2013-evolution-5795e22cb7a67056948f81e1faca2dcecb9333de.tar.gz
gsoc2013-evolution-5795e22cb7a67056948f81e1faca2dcecb9333de.tar.bz2
gsoc2013-evolution-5795e22cb7a67056948f81e1faca2dcecb9333de.tar.lz
gsoc2013-evolution-5795e22cb7a67056948f81e1faca2dcecb9333de.tar.xz
gsoc2013-evolution-5795e22cb7a67056948f81e1faca2dcecb9333de.tar.zst
gsoc2013-evolution-5795e22cb7a67056948f81e1faca2dcecb9333de.zip
Bug 418520 - Disable Folder -> Expunge in virtual folders
Expunging from a virtual folder actually expunges one or more real folders, which the user may not be aware of and can lead to unintended message removal. I feel it's safest to just disable Folder -> Expunge for any virtual folder, be it Junk, Trash, or a Search Folder. Note that File -> Empty Trash is still always enabled.
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-sidebar.c6
-rw-r--r--mail/e-mail-sidebar.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/mail/e-mail-sidebar.c b/mail/e-mail-sidebar.c
index b247adaf6a..d347125814 100644
--- a/mail/e-mail-sidebar.c
+++ b/mail/e-mail-sidebar.c
@@ -345,6 +345,7 @@ mail_sidebar_check_state (EMailSidebar *sidebar)
gboolean is_outbox = FALSE;
gboolean is_store;
gboolean is_trash = FALSE;
+ gboolean is_virtual = FALSE;
guint32 folder_flags = 0;
guint32 state = 0;
@@ -376,6 +377,9 @@ mail_sidebar_check_state (EMailSidebar *sidebar)
folder_type = (folder_flags & CAMEL_FOLDER_TYPE_MASK);
is_trash |= (folder_type == CAMEL_FOLDER_TYPE_TRASH);
+ /* Is this a virtual folder (junk/trash/search)? */
+ is_virtual |= (folder_flags & CAMEL_FOLDER_VIRTUAL);
+
allows_children = !(is_junk || is_trash);
/* Don't allow deletion of special local folders. */
@@ -405,6 +409,8 @@ mail_sidebar_check_state (EMailSidebar *sidebar)
state |= E_MAIL_SIDEBAR_FOLDER_IS_STORE;
if (is_trash)
state |= E_MAIL_SIDEBAR_FOLDER_IS_TRASH;
+ if (is_virtual)
+ state |= E_MAIL_SIDEBAR_FOLDER_IS_VIRTUAL;
if (CAMEL_IS_SUBSCRIBABLE (store))
state |= E_MAIL_SIDEBAR_STORE_IS_SUBSCRIBABLE;
diff --git a/mail/e-mail-sidebar.h b/mail/e-mail-sidebar.h
index bdde4c1090..922e58c8b8 100644
--- a/mail/e-mail-sidebar.h
+++ b/mail/e-mail-sidebar.h
@@ -58,7 +58,8 @@ enum {
E_MAIL_SIDEBAR_FOLDER_IS_OUTBOX = 1 << 3,
E_MAIL_SIDEBAR_FOLDER_IS_STORE = 1 << 4,
E_MAIL_SIDEBAR_FOLDER_IS_TRASH = 1 << 5,
- E_MAIL_SIDEBAR_STORE_IS_SUBSCRIBABLE = 1 << 6
+ E_MAIL_SIDEBAR_FOLDER_IS_VIRTUAL = 1 << 6,
+ E_MAIL_SIDEBAR_STORE_IS_SUBSCRIBABLE = 1 << 7
};
struct _EMailSidebar {