aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/e-mail-sidebar.c6
-rw-r--r--mail/e-mail-sidebar.h3
-rw-r--r--modules/mail/e-mail-shell-view.c5
3 files changed, 12 insertions, 2 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 {
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index afd7501d92..9929d8ae0e 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -828,6 +828,7 @@ mail_shell_view_update_actions (EShellView *shell_view)
gboolean folder_is_outbox;
gboolean folder_is_store;
gboolean folder_is_trash;
+ gboolean folder_is_virtual;
gboolean folder_has_unread_rec = FALSE;
gboolean folder_tree_and_message_list_agree = TRUE;
gboolean store_is_subscribable;
@@ -864,6 +865,8 @@ mail_shell_view_update_actions (EShellView *shell_view)
(state & E_MAIL_SIDEBAR_FOLDER_IS_STORE);
folder_is_trash =
(state & E_MAIL_SIDEBAR_FOLDER_IS_TRASH);
+ folder_is_virtual =
+ (state & E_MAIL_SIDEBAR_FOLDER_IS_VIRTUAL);
store_is_subscribable =
(state & E_MAIL_SIDEBAR_STORE_IS_SUBSCRIBABLE);
@@ -962,7 +965,7 @@ mail_shell_view_update_actions (EShellView *shell_view)
gtk_action_set_sensitive (action, sensitive);
action = ACTION (MAIL_FOLDER_EXPUNGE);
- sensitive = !folder_is_store && uri != NULL;
+ sensitive = !folder_is_store && !folder_is_virtual && uri != NULL;
gtk_action_set_sensitive (action, sensitive);
action = ACTION (MAIL_FOLDER_MOVE);