aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-memo-shell-sidebar.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-27 17:31:32 +0800
committerMilan Crha <mcrha@redhat.com>2011-06-27 17:31:32 +0800
commit46eec90c098d5b239035568ae5c25ae9127a8373 (patch)
treecda1ef61bbea5fa05d836a6507cb080ecb6e68fb /modules/calendar/e-memo-shell-sidebar.c
parenta6b861d9574f81cc7ca07bc1dc94749b80980ca2 (diff)
downloadgsoc2013-evolution-46eec90c098d5b239035568ae5c25ae9127a8373.tar.gz
gsoc2013-evolution-46eec90c098d5b239035568ae5c25ae9127a8373.tar.zst
gsoc2013-evolution-46eec90c098d5b239035568ae5c25ae9127a8373.zip
Bug #653154 - Crash when constructing calendar view
Diffstat (limited to 'modules/calendar/e-memo-shell-sidebar.c')
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 5a28611652..213179cc3a 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -159,6 +159,24 @@ memo_shell_sidebar_backend_error_cb (EMemoShellSidebar *memo_shell_sidebar,
}
static void
+memo_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+{
+ ECalClient *client = E_CAL_CLIENT (source_object);
+ EMemoShellSidebar *memo_shell_sidebar = user_data;
+ gchar *capabilities = NULL;
+
+ g_return_if_fail (client != NULL);
+ g_return_if_fail (memo_shell_sidebar != NULL);
+
+ e_client_retrieve_capabilities_finish (E_CLIENT (client), result, &capabilities, NULL);
+ g_free (capabilities);
+
+ memo_shell_sidebar_emit_status_message (memo_shell_sidebar, _("Loading memos"));
+ memo_shell_sidebar_emit_client_added (memo_shell_sidebar, client);
+ memo_shell_sidebar_emit_status_message (memo_shell_sidebar, NULL);
+}
+
+static void
memo_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
@@ -166,7 +184,6 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
- const gchar *message;
GError *error = NULL;
shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
@@ -219,10 +236,8 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
g_clear_error (&error);
- message = _("Loading memos");
- memo_shell_sidebar_emit_status_message (memo_shell_sidebar, message);
- memo_shell_sidebar_emit_client_added (memo_shell_sidebar, client);
- memo_shell_sidebar_emit_status_message (memo_shell_sidebar, NULL);
+ /* to have them ready for later use */
+ e_client_retrieve_capabilities (E_CLIENT (client), NULL, memo_shell_sidebar_retrieve_capabilies_cb, memo_shell_sidebar);
}
static void