aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-cal-shell-sidebar.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-27 17:31:32 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:33 +0800
commitf286e88fae02a7da640ab1637130b00d3c366c08 (patch)
treeff984d9a12656e6c4c2b54177b2cb561ecc13cf1 /modules/calendar/e-cal-shell-sidebar.c
parent46c1bea8ee46a4aa3fdf3759b819342413c2cf69 (diff)
downloadgsoc2013-evolution-f286e88fae02a7da640ab1637130b00d3c366c08.tar
gsoc2013-evolution-f286e88fae02a7da640ab1637130b00d3c366c08.tar.gz
gsoc2013-evolution-f286e88fae02a7da640ab1637130b00d3c366c08.tar.bz2
gsoc2013-evolution-f286e88fae02a7da640ab1637130b00d3c366c08.tar.lz
gsoc2013-evolution-f286e88fae02a7da640ab1637130b00d3c366c08.tar.xz
gsoc2013-evolution-f286e88fae02a7da640ab1637130b00d3c366c08.tar.zst
gsoc2013-evolution-f286e88fae02a7da640ab1637130b00d3c366c08.zip
Bug #653154 - Crash when constructing calendar view
Diffstat (limited to 'modules/calendar/e-cal-shell-sidebar.c')
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 8e3010ddb7..e33a7dcd06 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -164,6 +164,24 @@ cal_shell_sidebar_backend_error_cb (ECalShellSidebar *cal_shell_sidebar,
}
static void
+cal_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+{
+ ECalClient *client = E_CAL_CLIENT (source_object);
+ ECalShellSidebar *cal_shell_sidebar = user_data;
+ gchar *capabilities = NULL;
+
+ g_return_if_fail (client != NULL);
+ g_return_if_fail (cal_shell_sidebar != NULL);
+
+ e_client_retrieve_capabilities_finish (E_CLIENT (client), result, &capabilities, NULL);
+ g_free (capabilities);
+
+ cal_shell_sidebar_emit_status_message (cal_shell_sidebar, _("Loading calendars"));
+ cal_shell_sidebar_emit_client_added (cal_shell_sidebar, client);
+ cal_shell_sidebar_emit_status_message (cal_shell_sidebar, NULL);
+}
+
+static void
cal_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
@@ -171,7 +189,6 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
- const gchar *message;
GError *error = NULL;
shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
@@ -224,10 +241,8 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result
g_clear_error (&error);
- message = _("Loading calendars");
- cal_shell_sidebar_emit_status_message (cal_shell_sidebar, message);
- cal_shell_sidebar_emit_client_added (cal_shell_sidebar, client);
- cal_shell_sidebar_emit_status_message (cal_shell_sidebar, NULL);
+ /* to have them ready for later use */
+ e_client_retrieve_capabilities (E_CLIENT (client), NULL, cal_shell_sidebar_retrieve_capabilies_cb, cal_shell_sidebar);
}
static void