diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-11-14 23:39:55 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-11-14 23:42:02 +0800 |
commit | bb1653f64c0998f3c90d9cf0e7a2183dccd4611f (patch) | |
tree | b1419804cd5af877df35c2a2293fb23a58ce5cfd /modules/addressbook/e-book-shell-sidebar.c | |
parent | e1815361e0a7dc69f5d06a4d623e709eff611464 (diff) | |
download | gsoc2013-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/addressbook/e-book-shell-sidebar.c')
-rw-r--r-- | modules/addressbook/e-book-shell-sidebar.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/addressbook/e-book-shell-sidebar.c b/modules/addressbook/e-book-shell-sidebar.c index fc283e28d7..24a0997173 100644 --- a/modules/addressbook/e-book-shell-sidebar.c +++ b/modules/addressbook/e-book-shell-sidebar.c @@ -126,6 +126,7 @@ book_shell_sidebar_check_state (EShellSidebar *shell_sidebar) EBookShellSidebar *book_shell_sidebar; ESourceSelector *selector; ESource *source; + gboolean can_delete = FALSE; gboolean is_system = FALSE; guint32 state = 0; @@ -135,13 +136,20 @@ book_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_BOOK_SHELL_SIDEBAR_HAS_PRIMARY_SOURCE; + if (can_delete) + state |= E_BOOK_SHELL_SIDEBAR_CAN_DELETE_PRIMARY_SOURCE; if (is_system) state |= E_BOOK_SHELL_SIDEBAR_PRIMARY_SOURCE_IS_SYSTEM; |