aboutsummaryrefslogtreecommitdiffstats
path: root/modules/addressbook/e-book-shell-sidebar.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-04-22 02:52:23 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-04-22 05:07:15 +0800
commit7950d6a0c6efd6c4d48afd99c138f38952bdd1bb (patch)
tree3a8fd7957dd29441120d2db18ccb1cc23f5935f2 /modules/addressbook/e-book-shell-sidebar.c
parent397b15ff4aa5afd1d5c7e0a093a33616624401cf (diff)
downloadgsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.gz
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.bz2
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.lz
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.xz
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.zst
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.zip
Adapt to libedataserver[ui] changes.
Diffstat (limited to 'modules/addressbook/e-book-shell-sidebar.c')
-rw-r--r--modules/addressbook/e-book-shell-sidebar.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/addressbook/e-book-shell-sidebar.c b/modules/addressbook/e-book-shell-sidebar.c
index af28f8bbb1..d47dbd75f9 100644
--- a/modules/addressbook/e-book-shell-sidebar.c
+++ b/modules/addressbook/e-book-shell-sidebar.c
@@ -151,25 +151,30 @@ book_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
ESource *source;
gboolean can_delete = FALSE;
gboolean is_system = FALSE;
+ gboolean has_primary_source = FALSE;
guint32 state = 0;
book_shell_sidebar = E_BOOK_SHELL_SIDEBAR (shell_sidebar);
selector = e_book_shell_sidebar_get_selector (book_shell_sidebar);
- source = e_source_selector_get_primary_selection (selector);
+ source = e_source_selector_ref_primary_selection (selector);
if (source != NULL) {
const gchar *uri;
const gchar *delete;
+ has_primary_source = TRUE;
+
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);
+
+ g_object_unref (source);
}
- if (source != NULL)
+ if (has_primary_source)
state |= E_BOOK_SHELL_SIDEBAR_HAS_PRIMARY_SOURCE;
if (can_delete)
state |= E_BOOK_SHELL_SIDEBAR_CAN_DELETE_PRIMARY_SOURCE;