aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-07-09 20:29:51 +0800
committerMilan Crha <mcrha@redhat.com>2010-07-09 20:29:51 +0800
commit03d626856b294bc98919ac244e04e9b8821a681d (patch)
tree62433e158f1791aa6b9222ecbe05d164c4703f6c /modules/calendar
parent6d4ce8571ff62a3e489999d2feeac1691e06c59a (diff)
downloadgsoc2013-evolution-03d626856b294bc98919ac244e04e9b8821a681d.tar
gsoc2013-evolution-03d626856b294bc98919ac244e04e9b8821a681d.tar.gz
gsoc2013-evolution-03d626856b294bc98919ac244e04e9b8821a681d.tar.bz2
gsoc2013-evolution-03d626856b294bc98919ac244e04e9b8821a681d.tar.lz
gsoc2013-evolution-03d626856b294bc98919ac244e04e9b8821a681d.tar.xz
gsoc2013-evolution-03d626856b294bc98919ac244e04e9b8821a681d.tar.zst
gsoc2013-evolution-03d626856b294bc98919ac244e04e9b8821a681d.zip
Bug #623204 - Be able to report detailed errors from backends
Diffstat (limited to 'modules/calendar')
-rw-r--r--modules/calendar/e-cal-attachment-handler.c10
-rw-r--r--modules/calendar/e-cal-shell-backend.c22
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c24
-rw-r--r--modules/calendar/e-memo-shell-backend.c12
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c24
-rw-r--r--modules/calendar/e-task-shell-backend.c12
-rw-r--r--modules/calendar/e-task-shell-sidebar.c24
7 files changed, 64 insertions, 64 deletions
diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c
index ce811bf79f..9025bc713f 100644
--- a/modules/calendar/e-cal-attachment-handler.c
+++ b/modules/calendar/e-cal-attachment-handler.c
@@ -138,7 +138,7 @@ attachment_handler_update_objects (ECal *client,
static void
attachment_handler_import_event (ECal *client,
- ECalendarStatus status,
+ const GError *error,
EAttachment *attachment)
{
icalcomponent *component;
@@ -146,7 +146,7 @@ attachment_handler_import_event (ECal *client,
icalcompiter iter;
/* FIXME Notify the user somehow. */
- g_return_if_fail (status == E_CALENDAR_STATUS_OK);
+ g_return_if_fail (error == NULL);
component = attachment_handler_get_component (attachment);
g_return_if_fail (component != NULL);
@@ -178,7 +178,7 @@ attachment_handler_import_event (ECal *client,
static void
attachment_handler_import_todo (ECal *client,
- ECalendarStatus status,
+ const GError *error,
EAttachment *attachment)
{
icalcomponent *component;
@@ -186,7 +186,7 @@ attachment_handler_import_todo (ECal *client,
icalcompiter iter;
/* FIXME Notify the user somehow. */
- g_return_if_fail (status == E_CALENDAR_STATUS_OK);
+ g_return_if_fail (error == NULL);
component = attachment_handler_get_component (attachment);
g_return_if_fail (component != NULL);
@@ -310,7 +310,7 @@ attachment_handler_run_dialog (GtkWindow *parent,
goto exit;
g_object_ref (attachment);
- g_signal_connect (client, "cal-opened", callback, attachment);
+ g_signal_connect (client, "cal-opened-ex", callback, attachment);
e_cal_open_async (client, FALSE);
exit:
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index 006dca5cb6..dede49c5b8 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -282,7 +282,7 @@ cal_shell_backend_ensure_sources (EShellBackend *shell_backend)
static void
cal_shell_backend_new_event (ECal *cal,
- ECalendarStatus status,
+ const GError *error,
EShell *shell,
CompEditorFlags flags,
gboolean all_day)
@@ -291,7 +291,7 @@ cal_shell_backend_new_event (ECal *cal,
CompEditor *editor;
/* XXX Handle errors better. */
- if (status != E_CALENDAR_STATUS_OK)
+ if (error)
return;
flags |= COMP_EDITOR_NEW_ITEM;
@@ -308,39 +308,39 @@ cal_shell_backend_new_event (ECal *cal,
static void
cal_shell_backend_event_new_cb (ECal *cal,
- ECalendarStatus status,
+ const GError *error,
EShell *shell)
{
CompEditorFlags flags;
flags = COMP_EDITOR_USER_ORG;
- cal_shell_backend_new_event (cal, status, shell, flags, FALSE);
+ cal_shell_backend_new_event (cal, error, shell, flags, FALSE);
g_object_unref (cal);
}
static void
cal_shell_backend_event_all_day_new_cb (ECal *cal,
- ECalendarStatus status,
+ const GError *error,
EShell *shell)
{
CompEditorFlags flags;
flags = COMP_EDITOR_USER_ORG;
- cal_shell_backend_new_event (cal, status, shell, flags, TRUE);
+ cal_shell_backend_new_event (cal, error, shell, flags, TRUE);
g_object_unref (cal);
}
static void
cal_shell_backend_event_meeting_new_cb (ECal *cal,
- ECalendarStatus status,
+ const GError *error,
EShell *shell)
{
CompEditorFlags flags;
flags = COMP_EDITOR_USER_ORG | COMP_EDITOR_MEETING;
- cal_shell_backend_new_event (cal, status, shell, flags, FALSE);
+ cal_shell_backend_new_event (cal, error, shell, flags, FALSE);
g_object_unref (cal);
}
@@ -425,17 +425,17 @@ action_event_new_cb (GtkAction *action,
action_name = gtk_action_get_name (action);
if (strcmp (action_name, "event-all-day-new") == 0)
g_signal_connect (
- cal, "cal-opened",
+ cal, "cal-opened-ex",
G_CALLBACK (cal_shell_backend_event_all_day_new_cb),
shell);
else if (strcmp (action_name, "event-meeting-new") == 0)
g_signal_connect (
- cal, "cal-opened",
+ cal, "cal-opened-ex",
G_CALLBACK (cal_shell_backend_event_meeting_new_cb),
shell);
else
g_signal_connect (
- cal, "cal-opened",
+ cal, "cal-opened-ex",
G_CALLBACK (cal_shell_backend_event_new_cb),
shell);
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 4dfa2ecb2d..4299c07746 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -177,7 +177,7 @@ cal_shell_sidebar_backend_error_cb (ECalShellSidebar *cal_shell_sidebar,
static void
cal_shell_sidebar_client_opened_cb (ECalShellSidebar *cal_shell_sidebar,
- ECalendarStatus status,
+ const GError *error,
ECal *client)
{
EShellView *shell_view;
@@ -189,12 +189,12 @@ cal_shell_sidebar_client_opened_cb (ECalShellSidebar *cal_shell_sidebar,
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_window = e_shell_view_get_shell_window (shell_view);
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED ||
- status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
+ g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED))
e_auth_cal_forget_password (client);
/* Handle errors. */
- switch (status) {
+ switch (error ? error->code : E_CALENDAR_STATUS_OK) {
case E_CALENDAR_STATUS_OK:
break;
@@ -219,7 +219,7 @@ cal_shell_sidebar_client_opened_cb (ECalShellSidebar *cal_shell_sidebar,
return;
}
- g_assert (status == E_CALENDAR_STATUS_OK);
+ g_assert (error == NULL);
g_signal_handlers_disconnect_matched (
client, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
@@ -233,7 +233,7 @@ cal_shell_sidebar_client_opened_cb (ECalShellSidebar *cal_shell_sidebar,
static void
cal_shell_sidebar_default_opened_cb (ECalShellSidebar *cal_shell_sidebar,
- ECalendarStatus status,
+ const GError *error,
ECal *client)
{
EShellView *shell_view;
@@ -242,12 +242,12 @@ cal_shell_sidebar_default_opened_cb (ECalShellSidebar *cal_shell_sidebar,
shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED ||
- status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
+ g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED))
e_auth_cal_forget_password (client);
/* Handle errors. */
- switch (status) {
+ switch (error ? error->code : E_CALENDAR_STATUS_OK) {
case E_CALENDAR_STATUS_OK:
break;
@@ -265,7 +265,7 @@ cal_shell_sidebar_default_opened_cb (ECalShellSidebar *cal_shell_sidebar,
return;
}
- g_assert (status == E_CALENDAR_STATUS_OK);
+ g_assert (error == NULL);
g_signal_handlers_disconnect_matched (
client, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
@@ -307,7 +307,7 @@ cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar,
g_return_if_fail (client != NULL);
g_signal_connect_swapped (
- client, "cal-opened",
+ client, "cal-opened-ex",
G_CALLBACK (cal_shell_sidebar_default_opened_cb),
cal_shell_sidebar);
@@ -1008,7 +1008,7 @@ e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
g_free (message);
g_signal_connect_swapped (
- client, "cal-opened",
+ client, "cal-opened-ex",
G_CALLBACK (cal_shell_sidebar_client_opened_cb),
cal_shell_sidebar);
diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c
index 2a0c277fc5..3996fa699f 100644
--- a/modules/calendar/e-memo-shell-backend.c
+++ b/modules/calendar/e-memo-shell-backend.c
@@ -197,7 +197,7 @@ memo_shell_backend_ensure_sources (EShellBackend *shell_backend)
static void
memo_shell_backend_memo_new_cb (ECal *cal,
- ECalendarStatus status,
+ const GError *error,
EShell *shell)
{
ECalComponent *comp;
@@ -205,7 +205,7 @@ memo_shell_backend_memo_new_cb (ECal *cal,
CompEditorFlags flags = 0;
/* XXX Handle errors better. */
- if (status != E_CALENDAR_STATUS_OK)
+ if (error)
return;
flags |= COMP_EDITOR_NEW_ITEM;
@@ -223,7 +223,7 @@ memo_shell_backend_memo_new_cb (ECal *cal,
static void
memo_shell_backend_memo_shared_new_cb (ECal *cal,
- ECalendarStatus status,
+ const GError *error,
EShell *shell)
{
ECalComponent *comp;
@@ -231,7 +231,7 @@ memo_shell_backend_memo_shared_new_cb (ECal *cal,
CompEditorFlags flags = 0;
/* XXX Handle errors better. */
- if (status != E_CALENDAR_STATUS_OK)
+ if (error)
return;
flags |= COMP_EDITOR_NEW_ITEM;
@@ -294,12 +294,12 @@ action_memo_new_cb (GtkAction *action,
action_name = gtk_action_get_name (action);
if (strcmp (action_name, "memo-shared-new") == 0)
g_signal_connect (
- cal, "cal-opened",
+ cal, "cal-opened-ex",
G_CALLBACK (memo_shell_backend_memo_shared_new_cb),
shell);
else
g_signal_connect (
- cal, "cal-opened",
+ cal, "cal-opened-ex",
G_CALLBACK (memo_shell_backend_memo_new_cb),
shell);
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 416759213e..75245c2d87 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -171,7 +171,7 @@ memo_shell_sidebar_backend_error_cb (EMemoShellSidebar *memo_shell_sidebar,
static void
memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
- ECalendarStatus status,
+ const GError *error,
ECal *client)
{
EShellView *shell_view;
@@ -183,12 +183,12 @@ memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_window = e_shell_view_get_shell_window (shell_view);
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED ||
- status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
+ g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED))
e_auth_cal_forget_password (client);
/* Handle errors. */
- switch (status) {
+ switch (error ? error->code : E_CALENDAR_STATUS_OK) {
case E_CALENDAR_STATUS_OK:
break;
@@ -213,7 +213,7 @@ memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
return;
}
- g_assert (status == E_CALENDAR_STATUS_OK);
+ g_assert (error == NULL);
g_signal_handlers_disconnect_matched (
client, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
@@ -227,7 +227,7 @@ memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
static void
memo_shell_sidebar_default_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
- ECalendarStatus status,
+ const GError *error,
ECal *client)
{
EShellView *shell_view;
@@ -236,12 +236,12 @@ memo_shell_sidebar_default_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED ||
- status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
+ g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED))
e_auth_cal_forget_password (client);
/* Handle errors. */
- switch (status) {
+ switch (error ? error->code : E_CALENDAR_STATUS_OK) {
case E_CALENDAR_STATUS_OK:
break;
@@ -259,7 +259,7 @@ memo_shell_sidebar_default_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
return;
}
- g_assert (status == E_CALENDAR_STATUS_OK);
+ g_assert (error == NULL);
g_signal_handlers_disconnect_matched (
client, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
@@ -301,7 +301,7 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar,
g_return_if_fail (client != NULL);
g_signal_connect_swapped (
- client, "cal-opened",
+ client, "cal-opened-ex",
G_CALLBACK (memo_shell_sidebar_default_opened_cb),
memo_shell_sidebar);
@@ -894,7 +894,7 @@ e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar,
g_free (message);
g_signal_connect_swapped (
- client, "cal-opened",
+ client, "cal-opened-ex",
G_CALLBACK (memo_shell_sidebar_client_opened_cb),
memo_shell_sidebar);
diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c
index c5f0a9927a..ca2b68228c 100644
--- a/modules/calendar/e-task-shell-backend.c
+++ b/modules/calendar/e-task-shell-backend.c
@@ -201,7 +201,7 @@ task_shell_backend_ensure_sources (EShellBackend *shell_backend)
static void
task_shell_backend_task_new_cb (ECal *cal,
- ECalendarStatus status,
+ const GError *error,
EShell *shell)
{
ECalComponent *comp;
@@ -209,7 +209,7 @@ task_shell_backend_task_new_cb (ECal *cal,
CompEditorFlags flags = 0;
/* XXX Handle errors better. */
- if (status != E_CALENDAR_STATUS_OK)
+ if (error)
return;
flags |= COMP_EDITOR_NEW_ITEM;
@@ -226,7 +226,7 @@ task_shell_backend_task_new_cb (ECal *cal,
static void
task_shell_backend_task_assigned_new_cb (ECal *cal,
- ECalendarStatus status,
+ const GError *error,
EShell *shell)
{
ECalComponent *comp;
@@ -234,7 +234,7 @@ task_shell_backend_task_assigned_new_cb (ECal *cal,
CompEditorFlags flags = 0;
/* XXX Handle errors better. */
- if (status != E_CALENDAR_STATUS_OK)
+ if (error)
return;
flags |= COMP_EDITOR_NEW_ITEM;
@@ -296,12 +296,12 @@ action_task_new_cb (GtkAction *action,
action_name = gtk_action_get_name (action);
if (strcmp (action_name, "task-assigned-new") == 0)
g_signal_connect (
- cal, "cal-opened",
+ cal, "cal-opened-ex",
G_CALLBACK (task_shell_backend_task_assigned_new_cb),
shell);
else
g_signal_connect (
- cal, "cal-opened",
+ cal, "cal-opened-ex",
G_CALLBACK (task_shell_backend_task_new_cb),
shell);
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index 07eb43bdbf..ef379d472f 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -171,7 +171,7 @@ task_shell_sidebar_backend_error_cb (ETaskShellSidebar *task_shell_sidebar,
static void
task_shell_sidebar_client_opened_cb (ETaskShellSidebar *task_shell_sidebar,
- ECalendarStatus status,
+ const GError *error,
ECal *client)
{
EShellView *shell_view;
@@ -183,12 +183,12 @@ task_shell_sidebar_client_opened_cb (ETaskShellSidebar *task_shell_sidebar,
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_window = e_shell_view_get_shell_window (shell_view);
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED ||
- status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
+ g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED))
e_auth_cal_forget_password (client);
/* Handle errors. */
- switch (status) {
+ switch (error ? error->code : E_CALENDAR_STATUS_OK) {
case E_CALENDAR_STATUS_OK:
break;
@@ -213,7 +213,7 @@ task_shell_sidebar_client_opened_cb (ETaskShellSidebar *task_shell_sidebar,
return;
}
- g_assert (status == E_CALENDAR_STATUS_OK);
+ g_assert (error == NULL);
g_signal_handlers_disconnect_matched (
client, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
@@ -227,7 +227,7 @@ task_shell_sidebar_client_opened_cb (ETaskShellSidebar *task_shell_sidebar,
static void
task_shell_sidebar_default_opened_cb (ETaskShellSidebar *task_shell_sidebar,
- ECalendarStatus status,
+ const GError *error,
ECal *client)
{
EShellView *shell_view;
@@ -236,12 +236,12 @@ task_shell_sidebar_default_opened_cb (ETaskShellSidebar *task_shell_sidebar,
shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED ||
- status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
+ g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED))
e_auth_cal_forget_password (client);
/* Handle errors. */
- switch (status) {
+ switch (error ? error->code : E_CALENDAR_STATUS_OK) {
case E_CALENDAR_STATUS_OK:
break;
@@ -259,7 +259,7 @@ task_shell_sidebar_default_opened_cb (ETaskShellSidebar *task_shell_sidebar,
return;
}
- g_assert (status == E_CALENDAR_STATUS_OK);
+ g_assert (error == NULL);
g_signal_handlers_disconnect_matched (
client, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
@@ -301,7 +301,7 @@ task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar,
g_return_if_fail (client != NULL);
g_signal_connect_swapped (
- client, "cal-opened",
+ client, "cal-opened-ex",
G_CALLBACK (task_shell_sidebar_default_opened_cb),
task_shell_sidebar);
@@ -894,7 +894,7 @@ e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar,
g_free (message);
g_signal_connect_swapped (
- client, "cal-opened",
+ client, "cal-opened-ex",
G_CALLBACK (task_shell_sidebar_client_opened_cb),
task_shell_sidebar);