aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-memo-shell-view-actions.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-04-13 02:54:15 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-04-13 07:12:25 +0800
commit6172096d30099361bd5e94891ac84f3155525584 (patch)
tree5af44901e62581d36292699ddd3bf0a2e4a39498 /modules/calendar/e-memo-shell-view-actions.c
parente093e2600240243f7d6112894767cf9a827280fa (diff)
downloadgsoc2013-evolution-6172096d30099361bd5e94891ac84f3155525584.tar
gsoc2013-evolution-6172096d30099361bd5e94891ac84f3155525584.tar.gz
gsoc2013-evolution-6172096d30099361bd5e94891ac84f3155525584.tar.bz2
gsoc2013-evolution-6172096d30099361bd5e94891ac84f3155525584.tar.lz
gsoc2013-evolution-6172096d30099361bd5e94891ac84f3155525584.tar.xz
gsoc2013-evolution-6172096d30099361bd5e94891ac84f3155525584.tar.zst
gsoc2013-evolution-6172096d30099361bd5e94891ac84f3155525584.zip
Remove e_cal_model_get_client_for_source().
Was not thread-safe because it did not reference the return value. The function was only used to implement the Refresh action on the sidebar menu. e_client_selector_ref_cached_client() works better for this anyway. (cherry picked from commit 1df4952769b3211b90aecb3a359d8ae484fd1363)
Diffstat (limited to 'modules/calendar/e-memo-shell-view-actions.c')
-rw-r--r--modules/calendar/e-memo-shell-view-actions.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c
index 0e0d28e885..5e30e24fcf 100644
--- a/modules/calendar/e-memo-shell-view-actions.c
+++ b/modules/calendar/e-memo-shell-view-actions.c
@@ -294,32 +294,29 @@ static void
action_memo_list_refresh_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
- EMemoShellContent *memo_shell_content;
EMemoShellSidebar *memo_shell_sidebar;
ESourceSelector *selector;
- ECalClient *client;
- ECalModel *model;
+ EClient *client = NULL;
ESource *source;
GError *error = NULL;
- memo_shell_content = memo_shell_view->priv->memo_shell_content;
memo_shell_sidebar = memo_shell_view->priv->memo_shell_sidebar;
-
- model = e_memo_shell_content_get_memo_model (memo_shell_content);
selector = e_memo_shell_sidebar_get_selector (memo_shell_sidebar);
source = e_source_selector_ref_primary_selection (selector);
- g_return_if_fail (source != NULL);
- client = e_cal_model_get_client_for_source (model, source);
- if (client == NULL) {
+ if (source != NULL) {
+ client = e_client_selector_ref_cached_client (
+ E_CLIENT_SELECTOR (selector), source);
g_object_unref (source);
- return;
}
- g_return_if_fail (e_client_check_refresh_supported (E_CLIENT (client)));
+ if (client == NULL)
+ return;
- e_client_refresh_sync (E_CLIENT (client), NULL, &error);
+ g_return_if_fail (e_client_check_refresh_supported (client));
+
+ e_client_refresh_sync (client, NULL, &error);
if (error != NULL) {
g_warning (
@@ -329,7 +326,7 @@ action_memo_list_refresh_cb (GtkAction *action,
g_error_free (error);
}
- g_object_unref (source);
+ g_object_unref (client);
}
static void