diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-02-17 03:57:16 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-02-17 07:57:11 +0800 |
commit | a67574e9e1d2bcf1608c16d332f68665ef0198fd (patch) | |
tree | 66c5ab0dceea0c9914a8708af632145e5c0c3ed1 /modules/calendar | |
parent | 4b690101e0d26b89de96bb3fa9dc2a25e89272eb (diff) | |
download | gsoc2013-evolution-a67574e9e1d2bcf1608c16d332f68665ef0198fd.tar.gz gsoc2013-evolution-a67574e9e1d2bcf1608c16d332f68665ef0198fd.tar.zst gsoc2013-evolution-a67574e9e1d2bcf1608c16d332f68665ef0198fd.zip |
ECalShellSidebar: Use EClientCache to determine refresh support.
In cal_shell_sidebar_check_state(), determine whether the selected
source supports refresh by way of e_client_cache_ref_cached_client()
and e_client_check_refresh_supported().
Diffstat (limited to 'modules/calendar')
-rw-r--r-- | modules/calendar/e-cal-shell-sidebar.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index f3f5e0801e..49245a3c31 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -687,7 +687,7 @@ cal_shell_sidebar_check_state (EShellSidebar *shell_sidebar) if (source != NULL) { EClient *client; ESource *collection; - const gchar *uid; + EClientCache *client_cache; has_primary_source = TRUE; is_writable = e_source_get_writable (source); @@ -702,12 +702,17 @@ cal_shell_sidebar_check_state (EShellSidebar *shell_sidebar) g_object_unref (collection); } - uid = e_source_get_uid (source); - client = g_hash_table_lookup ( - cal_shell_sidebar->priv->client_table, uid); - refresh_supported = - client != NULL && - e_client_check_refresh_supported (client); + client_cache = cal_shell_sidebar_ref_client_cache ( + E_CAL_SHELL_SIDEBAR (shell_sidebar)); + client = e_client_cache_ref_cached_client ( + client_cache, source, E_SOURCE_EXTENSION_CALENDAR); + g_object_unref (client_cache); + + if (client != NULL) { + refresh_supported = + e_client_check_refresh_supported (client); + g_object_unref (client); + } g_object_unref (source); } |