aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
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
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')
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c25
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c25
-rw-r--r--modules/calendar/e-task-shell-sidebar.c25
3 files changed, 60 insertions, 15 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
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
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index b37ab6dec6..04d2c25342 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -159,6 +159,24 @@ task_shell_sidebar_backend_error_cb (ETaskShellSidebar *task_shell_sidebar,
}
static void
+task_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+{
+ ECalClient *client = E_CAL_CLIENT (source_object);
+ ETaskShellSidebar *task_shell_sidebar = user_data;
+ gchar *capabilities = NULL;
+
+ g_return_if_fail (client != NULL);
+ g_return_if_fail (task_shell_sidebar != NULL);
+
+ e_client_retrieve_capabilities_finish (E_CLIENT (client), result, &capabilities, NULL);
+ g_free (capabilities);
+
+ task_shell_sidebar_emit_status_message (task_shell_sidebar, _("Loading tasks"));
+ task_shell_sidebar_emit_client_added (task_shell_sidebar, client);
+ task_shell_sidebar_emit_status_message (task_shell_sidebar, NULL);
+}
+
+static void
task_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
@@ -166,7 +184,6 @@ task_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 (task_shell_sidebar);
@@ -219,10 +236,8 @@ task_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
g_clear_error (&error);
- message = _("Loading tasks");
- task_shell_sidebar_emit_status_message (task_shell_sidebar, message);
- task_shell_sidebar_emit_client_added (task_shell_sidebar, client);
- task_shell_sidebar_emit_status_message (task_shell_sidebar, NULL);
+ /* to have them ready for later use */
+ e_client_retrieve_capabilities (E_CLIENT (client), NULL, task_shell_sidebar_retrieve_capabilies_cb, task_shell_sidebar);
}
static void