aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-memo-shell-sidebar.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-11-14 23:39:55 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-11-14 23:42:02 +0800
commitbb1653f64c0998f3c90d9cf0e7a2183dccd4611f (patch)
treeb1419804cd5af877df35c2a2293fb23a58ce5cfd /modules/calendar/e-memo-shell-sidebar.c
parente1815361e0a7dc69f5d06a4d623e709eff611464 (diff)
downloadgsoc2013-evolution-bb1653f64c0998f3c90d9cf0e7a2183dccd4611f.tar.gz
gsoc2013-evolution-bb1653f64c0998f3c90d9cf0e7a2183dccd4611f.tar.zst
gsoc2013-evolution-bb1653f64c0998f3c90d9cf0e7a2183dccd4611f.zip
BugĀ 600397 - Delete option enabled for undeletable ESource
Diffstat (limited to 'modules/calendar/e-memo-shell-sidebar.c')
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 33a2226c00..6da89988c8 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -453,6 +453,7 @@ memo_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
EMemoShellSidebar *memo_shell_sidebar;
ESourceSelector *selector;
ESource *source;
+ gboolean can_delete = FALSE;
gboolean is_system = FALSE;
guint32 state = 0;
@@ -462,13 +463,20 @@ memo_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
if (source != NULL) {
const gchar *uri;
+ const gchar *delete;
uri = e_source_peek_relative_uri (source);
is_system = (uri == NULL || strcmp (uri, "system") == 0);
+
+ can_delete = !is_system;
+ delete = e_source_get_property (source, "delete");
+ can_delete &= (delete == NULL || strcmp (delete, "no") != 0);
}
if (source != NULL)
state |= E_MEMO_SHELL_SIDEBAR_HAS_PRIMARY_SOURCE;
+ if (can_delete)
+ state |= E_MEMO_SHELL_SIDEBAR_CAN_DELETE_PRIMARY_SOURCE;
if (is_system)
state |= E_MEMO_SHELL_SIDEBAR_PRIMARY_SOURCE_IS_SYSTEM;