aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c84
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c16
-rw-r--r--addressbook/gui/contact-editor/eab-editor.c18
-rw-r--r--addressbook/gui/contact-editor/eab-editor.h12
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c48
-rw-r--r--addressbook/gui/merging/eab-contact-compare.c16
-rw-r--r--addressbook/gui/merging/eab-contact-merging.c44
-rw-r--r--addressbook/gui/merging/eab-contact-merging.h6
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c34
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.h3
-rw-r--r--addressbook/gui/widgets/e-addressbook-reflow-adapter.c1
-rw-r--r--addressbook/gui/widgets/e-addressbook-selector.c14
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.c6
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c29
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c8
-rw-r--r--addressbook/gui/widgets/e-minicard-view.h2
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c80
-rw-r--r--addressbook/gui/widgets/eab-gui-util.h7
-rw-r--r--addressbook/printing/e-contact-print.c9
-rw-r--r--addressbook/util/addressbook.c68
-rw-r--r--addressbook/util/addressbook.h4
-rw-r--r--addressbook/util/eab-book-util.c8
-rw-r--r--addressbook/util/eab-book-util.h4
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.c8
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c8
-rw-r--r--calendar/gui/dialogs/delete-error.c30
-rw-r--r--calendar/gui/dialogs/delete-error.h2
-rw-r--r--calendar/gui/e-cal-model.c31
-rw-r--r--calendar/gui/e-cal-model.h6
-rw-r--r--calendar/gui/e-itip-control.c12
-rw-r--r--calendar/gui/e-memo-table.c11
-rw-r--r--calendar/gui/e-task-table.c11
-rw-r--r--calendar/gui/gnome-cal.c23
-rw-r--r--calendar/importers/icalendar-importer.c6
-rw-r--r--configure.ac2
-rw-r--r--e-util/e-marshal.list4
-rw-r--r--mail/em-utils.c10
-rw-r--r--modules/addressbook/e-book-shell-backend.c12
-rw-r--r--modules/addressbook/e-book-shell-view-private.c8
-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
-rw-r--r--plugins/itip-formatter/itip-formatter.c29
-rw-r--r--plugins/vcard-inline/vcard-inline.c4
48 files changed, 448 insertions, 418 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 2cb975725f..6ce890c999 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -197,44 +197,44 @@ static const gint email_default [] = { 0, 1, 2, 2 };
static void
e_contact_editor_contact_added (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact)
{
- if (status == E_BOOK_ERROR_OK)
+ if (!error)
return;
- if (status == E_BOOK_ERROR_CANCELLED)
+ if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED))
return;
- eab_error_dialog (_("Error adding contact"), status);
+ eab_error_dialog (_("Error adding contact"), error);
}
static void
e_contact_editor_contact_modified (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact)
{
- if (status == E_BOOK_ERROR_OK)
+ if (!error)
return;
- if (status == E_BOOK_ERROR_CANCELLED)
+ if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED))
return;
- eab_error_dialog (_("Error modifying contact"), status);
+ eab_error_dialog (_("Error modifying contact"), error);
}
static void
e_contact_editor_contact_deleted (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact)
{
- if (status == E_BOOK_ERROR_OK)
+ if (!error)
return;
- if (status == E_BOOK_ERROR_CANCELLED)
+ if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED))
return;
- eab_error_dialog (_("Error removing contact"), status);
+ eab_error_dialog (_("Error removing contact"), error);
}
static void
@@ -2691,15 +2691,15 @@ init_all (EContactEditor *editor)
}
static void
-new_target_cb (EBook *new_book, EBookStatus status, EContactEditor *editor)
+new_target_cb (EBook *new_book, const GError *error, EContactEditor *editor)
{
editor->load_source_id = 0;
editor->load_book = NULL;
- if (status != E_BOOK_ERROR_OK || new_book == NULL) {
+ if (error || new_book == NULL) {
GtkWidget *source_combo_box;
- eab_load_error_dialog (NULL, e_book_get_source (new_book), status);
+ eab_load_error_dialog (NULL, e_book_get_source (new_book), error);
source_combo_box = e_builder_get_widget (
editor->builder, "source-combo-box-source");
@@ -2747,7 +2747,7 @@ source_changed (ESourceComboBox *source_combo_box, EContactEditor *editor)
editor->load_book = e_book_new (source, NULL);
editor->load_source_id = addressbook_load (editor->load_book,
- (EBookCallback) new_target_cb, editor);
+ (EBookExCallback) new_target_cb, editor);
}
static void
@@ -3025,7 +3025,7 @@ typedef struct {
} EditorCloseStruct;
static void
-contact_moved_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
+contact_moved_cb (EBook *book, const GError *error, EditorCloseStruct *ecs)
{
EContactEditor *ce = ecs->ce;
gboolean should_close = ecs->should_close;
@@ -3035,7 +3035,7 @@ contact_moved_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
e_contact_set (ce->contact, E_CONTACT_UID, ecs->new_id);
- eab_editor_contact_deleted (EAB_EDITOR (ce), status, ce->contact);
+ eab_editor_contact_deleted (EAB_EDITOR (ce), error, ce->contact);
ce->is_new_contact = FALSE;
@@ -3058,16 +3058,16 @@ contact_moved_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
}
static void
-contact_added_cb (EBook *book, EBookStatus status, const gchar *id, EditorCloseStruct *ecs)
+contact_added_cb (EBook *book, const GError *error, const gchar *id, EditorCloseStruct *ecs)
{
EContactEditor *ce = ecs->ce;
gboolean should_close = ecs->should_close;
if (ce->source_book != ce->target_book && e_book_is_writable (ce->source_book) &&
- status == E_BOOK_ERROR_OK && ce->is_new_contact == FALSE) {
+ !error && ce->is_new_contact == FALSE) {
ecs->new_id = g_strdup (id);
- e_book_async_remove_contact (ce->source_book, ce->contact,
- (EBookCallback) contact_moved_cb, ecs);
+ e_book_async_remove_contact_ex (ce->source_book, ce->contact,
+ (EBookExCallback) contact_moved_cb, ecs);
return;
}
@@ -3076,9 +3076,9 @@ contact_added_cb (EBook *book, EBookStatus status, const gchar *id, EditorCloseS
e_contact_set (ce->contact, E_CONTACT_UID, (gchar *) id);
- eab_editor_contact_added (EAB_EDITOR (ce), status, ce->contact);
+ eab_editor_contact_added (EAB_EDITOR (ce), error, ce->contact);
- if (status == E_BOOK_ERROR_OK) {
+ if (!error) {
ce->is_new_contact = FALSE;
if (should_close) {
@@ -3095,7 +3095,7 @@ contact_added_cb (EBook *book, EBookStatus status, const gchar *id, EditorCloseS
}
static void
-contact_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
+contact_modified_cb (EBook *book, const GError *error, EditorCloseStruct *ecs)
{
EContactEditor *ce = ecs->ce;
gboolean should_close = ecs->should_close;
@@ -3103,9 +3103,9 @@ contact_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
gtk_widget_set_sensitive (ce->app, TRUE);
ce->in_async_call = FALSE;
- eab_editor_contact_modified (EAB_EDITOR (ce), status, ce->contact);
+ eab_editor_contact_modified (EAB_EDITOR (ce), error, ce->contact);
- if (status == E_BOOK_ERROR_OK) {
+ if (!error) {
if (should_close) {
eab_editor_close (EAB_EDITOR (ce));
}
@@ -3137,14 +3137,14 @@ real_save_contact (EContactEditor *ce, gboolean should_close)
if (ce->source_book != ce->target_book) {
/* Two-step move; add to target, then remove from source */
eab_merging_book_add_contact (ce->target_book, ce->contact,
- (EBookIdCallback) contact_added_cb, ecs);
+ (EBookIdExCallback) contact_added_cb, ecs);
} else {
if (ce->is_new_contact)
eab_merging_book_add_contact (ce->target_book, ce->contact,
- (EBookIdCallback) contact_added_cb, ecs);
+ (EBookIdExCallback) contact_added_cb, ecs);
else
eab_merging_book_commit_contact (ce->target_book, ce->contact,
- (EBookCallback) contact_modified_cb, ecs);
+ (EBookExCallback) contact_modified_cb, ecs);
}
}
@@ -3641,7 +3641,7 @@ e_contact_editor_dispose (GObject *object)
}
static void
-supported_fields_cb (EBook *book, EBookStatus status,
+supported_fields_cb (EBook *book, const GError *error,
EList *fields, EContactEditor *ce)
{
if (!g_slist_find (eab_editor_get_all_editors (), ce)) {
@@ -3659,7 +3659,7 @@ supported_fields_cb (EBook *book, EBookStatus status,
}
static void
-required_fields_cb (EBook *book, EBookStatus status,
+required_fields_cb (EBook *book, const GError *error,
EList *fields, EContactEditor *ce)
{
@@ -3697,8 +3697,8 @@ e_contact_editor_new (EShell *shell,
NULL);
if (book)
- e_book_async_get_supported_fields (
- book, (EBookEListCallback)supported_fields_cb, editor);
+ e_book_async_get_supported_fields_ex (
+ book, (EBookEListExCallback)supported_fields_cb, editor);
return editor;
}
@@ -3751,10 +3751,10 @@ e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *val
editor->target_editable_id = g_signal_connect (editor->target_book, "writable_status",
G_CALLBACK (writable_changed), editor);
- e_book_async_get_supported_fields (editor->target_book,
- (EBookEListCallback) supported_fields_cb, editor);
- e_book_async_get_required_fields (editor->target_book,
- (EBookEListCallback) required_fields_cb, editor);
+ e_book_async_get_supported_fields_ex (editor->target_book,
+ (EBookEListExCallback) supported_fields_cb, editor);
+ e_book_async_get_required_fields_ex (editor->target_book,
+ (EBookEListExCallback) required_fields_cb, editor);
}
writable = e_book_is_writable (editor->target_book);
@@ -3790,11 +3790,11 @@ e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *val
editor->target_editable_id = g_signal_connect (editor->target_book, "writable_status",
G_CALLBACK (writable_changed), editor);
- e_book_async_get_supported_fields (editor->target_book,
- (EBookEListCallback) supported_fields_cb, editor);
+ e_book_async_get_supported_fields_ex (editor->target_book,
+ (EBookEListExCallback) supported_fields_cb, editor);
- e_book_async_get_required_fields (editor->target_book,
- (EBookEListCallback) required_fields_cb, editor);
+ e_book_async_get_required_fields_ex (editor->target_book,
+ (EBookEListExCallback) required_fields_cb, editor);
if (!editor->is_new_contact)
editor->changed = TRUE;
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c
index 0feced4ca0..032f4ac475 100644
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ b/addressbook/gui/contact-editor/e-contact-quick-add.c
@@ -121,11 +121,11 @@ quick_add_set_vcard (QuickAdd *qa, const gchar *vcard)
}
static void
-merge_cb (EBook *book, EBookStatus status, gpointer closure)
+merge_cb (EBook *book, const GError *error, gpointer closure)
{
QuickAdd *qa = (QuickAdd *) closure;
- if (status == E_BOOK_ERROR_OK) {
+ if (!error) {
if (e_book_is_writable (book))
eab_merging_book_add_contact (book, qa->contact, NULL, NULL);
else
@@ -186,14 +186,14 @@ editor_closed_cb (GtkWidget *w, gpointer closure)
}
static void
-ce_have_contact (EBook *book, EBookStatus status, EContact *contact, gpointer closure)
+ce_have_contact (EBook *book, const GError *error, EContact *contact, gpointer closure)
{
QuickAdd *qa = (QuickAdd *) closure;
- if (status != E_BOOK_ERROR_OK) {
+ if (error) {
if (book)
g_object_unref (book);
- g_warning ("Failed to find contact, status %d.", status);
+ g_warning ("Failed to find contact, status %d (%s).", error->code, error->message);
quick_add_unref (qa);
} else {
EShell *shell;
@@ -235,14 +235,14 @@ ce_have_contact (EBook *book, EBookStatus status, EContact *contact, gpointer cl
}
static void
-ce_have_book (EBook *book, EBookStatus status, gpointer closure)
+ce_have_book (EBook *book, const GError *error, gpointer closure)
{
QuickAdd *qa = (QuickAdd *) closure;
- if (status != E_BOOK_ERROR_OK) {
+ if (error) {
if (book)
g_object_unref (book);
- g_warning ("Couldn't open local address book.");
+ g_warning ("Couldn't open local address book (%s).", error->message);
quick_add_unref (qa);
} else {
eab_merging_book_find_contact (book, qa->contact, ce_have_contact, qa);
diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c
index f53ecc30cd..f2765f40a6 100644
--- a/addressbook/gui/contact-editor/eab-editor.c
+++ b/addressbook/gui/contact-editor/eab-editor.c
@@ -181,7 +181,7 @@ eab_editor_class_init (EABEditorClass *class)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EABEditorClass, contact_added),
NULL, NULL,
- e_marshal_NONE__INT_OBJECT,
+ e_marshal_NONE__POINTER_OBJECT,
G_TYPE_NONE, 2,
G_TYPE_INT, G_TYPE_OBJECT);
@@ -191,7 +191,7 @@ eab_editor_class_init (EABEditorClass *class)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EABEditorClass, contact_modified),
NULL, NULL,
- e_marshal_NONE__INT_OBJECT,
+ e_marshal_NONE__POINTER_OBJECT,
G_TYPE_NONE, 2,
G_TYPE_INT, G_TYPE_OBJECT);
@@ -201,7 +201,7 @@ eab_editor_class_init (EABEditorClass *class)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EABEditorClass, contact_deleted),
NULL, NULL,
- e_marshal_NONE__INT_OBJECT,
+ e_marshal_NONE__POINTER_OBJECT,
G_TYPE_NONE, 2,
G_TYPE_INT, G_TYPE_OBJECT);
@@ -385,35 +385,35 @@ eab_editor_prompt_to_save_changes (EABEditor *editor, GtkWindow *window)
void
eab_editor_contact_added (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact)
{
g_return_if_fail (EAB_IS_EDITOR (editor));
g_return_if_fail (E_IS_CONTACT (contact));
- g_signal_emit (editor, signals[CONTACT_ADDED], 0, status, contact);
+ g_signal_emit (editor, signals[CONTACT_ADDED], 0, error, contact);
}
void
eab_editor_contact_modified (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact)
{
g_return_if_fail (EAB_IS_EDITOR (editor));
g_return_if_fail (E_IS_CONTACT (contact));
- g_signal_emit (editor, signals[CONTACT_MODIFIED], 0, status, contact);
+ g_signal_emit (editor, signals[CONTACT_MODIFIED], 0, error, contact);
}
void
eab_editor_contact_deleted (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact)
{
g_return_if_fail (EAB_IS_EDITOR (editor));
g_return_if_fail (E_IS_CONTACT (contact));
- g_signal_emit (editor, signals[CONTACT_DELETED], 0, status, contact);
+ g_signal_emit (editor, signals[CONTACT_DELETED], 0, error, contact);
}
void
diff --git a/addressbook/gui/contact-editor/eab-editor.h b/addressbook/gui/contact-editor/eab-editor.h
index f3803e7341..5623aa5bd4 100644
--- a/addressbook/gui/contact-editor/eab-editor.h
+++ b/addressbook/gui/contact-editor/eab-editor.h
@@ -72,9 +72,9 @@ struct _EABEditorClass {
GtkWindow* (* get_window) (EABEditor *editor);
/* signals */
- void (* contact_added) (EABEditor *editor, EBookStatus status, EContact *contact);
- void (* contact_modified) (EABEditor *editor, EBookStatus status, EContact *contact);
- void (* contact_deleted) (EABEditor *editor, EBookStatus status, EContact *contact);
+ void (* contact_added) (EABEditor *editor, const GError *error, EContact *contact);
+ void (* contact_modified) (EABEditor *editor, const GError *error, EContact *contact);
+ void (* contact_deleted) (EABEditor *editor, const GError *error, EContact *contact);
void (* editor_closed) (EABEditor *editor);
};
@@ -98,13 +98,13 @@ gboolean eab_editor_prompt_to_save_changes
/* these four generate EABEditor signals */
void eab_editor_contact_added (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact);
void eab_editor_contact_modified (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact);
void eab_editor_contact_deleted (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact);
void eab_editor_closed (EABEditor *editor);
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index cc734d2035..dc31d3c1fe 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -208,7 +208,7 @@ contact_list_editor_add_email (EContactListEditor *editor)
static void
contact_list_editor_book_loaded (EBook *new_book,
- EBookStatus status,
+ const GError *error,
EContactListEditor *editor)
{
EContactListEditorPrivate *priv = editor->priv;
@@ -218,9 +218,9 @@ contact_list_editor_book_loaded (EBook *new_book,
priv->load_source_id = 0;
priv->load_book = NULL;
- if (status != E_BOOK_ERROR_OK || new_book == NULL) {
+ if (error || new_book == NULL) {
eab_load_error_dialog (
- NULL, e_book_get_source (new_book), status);
+ NULL, e_book_get_source (new_book), error);
e_source_combo_box_set_active (
E_SOURCE_COMBO_BOX (WIDGET (SOURCE_MENU)),
e_book_get_source (priv->book));
@@ -266,7 +266,7 @@ contact_list_editor_contact_exists (EContactListModel *model,
static void
contact_list_editor_list_added_cb (EBook *book,
- EBookStatus status,
+ const GError *error,
const gchar *id,
EditorCloseStruct *ecs)
{
@@ -280,9 +280,9 @@ contact_list_editor_list_added_cb (EBook *book,
e_contact_set (priv->contact, E_CONTACT_UID, (gchar *) id);
eab_editor_contact_added (
- EAB_EDITOR (editor), status, priv->contact);
+ EAB_EDITOR (editor), error, priv->contact);
- if (status == E_BOOK_ERROR_OK) {
+ if (!error) {
priv->is_new_list = FALSE;
if (should_close)
@@ -297,7 +297,7 @@ contact_list_editor_list_added_cb (EBook *book,
static void
contact_list_editor_list_modified_cb (EBook *book,
- EBookStatus status,
+ const GError *error,
EditorCloseStruct *ecs)
{
EContactListEditor *editor = ecs->editor;
@@ -308,9 +308,9 @@ contact_list_editor_list_modified_cb (EBook *book,
priv->in_async_call = FALSE;
eab_editor_contact_modified (
- EAB_EDITOR (editor), status, priv->contact);
+ EAB_EDITOR (editor), error, priv->contact);
- if (status == E_BOOK_ERROR_OK) {
+ if (!error) {
if (should_close)
eab_editor_close (EAB_EDITOR (editor));
}
@@ -816,7 +816,7 @@ contact_list_editor_source_menu_changed_cb (GtkWidget *widget)
editor->priv->load_book = e_book_new (source, NULL);
editor->priv->load_source_id = addressbook_load (
- editor->priv->load_book, (EBookCallback)
+ editor->priv->load_book, (EBookExCallback)
contact_list_editor_book_loaded, editor);
}
@@ -1113,11 +1113,11 @@ contact_list_editor_save_contact (EABEditor *eab_editor,
if (priv->is_new_list)
eab_merging_book_add_contact (
- priv->book, contact, (EBookIdCallback)
+ priv->book, contact, (EBookIdExCallback)
contact_list_editor_list_added_cb, ecs);
else
eab_merging_book_commit_contact (
- priv->book, contact, (EBookCallback)
+ priv->book, contact, (EBookExCallback)
contact_list_editor_list_modified_cb, ecs);
priv->changed = FALSE;
@@ -1152,44 +1152,44 @@ contact_list_editor_get_window (EABEditor *editor)
static void
contact_list_editor_contact_added (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact)
{
- if (status == E_BOOK_ERROR_OK)
+ if (!error)
return;
- if (status == E_BOOK_ERROR_CANCELLED)
+ if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED))
return;
- eab_error_dialog (_("Error adding list"), status);
+ eab_error_dialog (_("Error adding list"), error);
}
static void
contact_list_editor_contact_modified (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact)
{
- if (status == E_BOOK_ERROR_OK)
+ if (!error)
return;
- if (status == E_BOOK_ERROR_CANCELLED)
+ if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED))
return;
- eab_error_dialog (_("Error modifying list"), status);
+ eab_error_dialog (_("Error modifying list"), error);
}
static void
contact_list_editor_contact_deleted (EABEditor *editor,
- EBookStatus status,
+ const GError *error,
EContact *contact)
{
- if (status == E_BOOK_ERROR_OK)
+ if (!error)
return;
- if (status == E_BOOK_ERROR_CANCELLED)
+ if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED))
return;
- eab_error_dialog (_("Error removing list"), status);
+ eab_error_dialog (_("Error removing list"), error);
}
static void
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c
index b341d77fc9..aad7c52f89 100644
--- a/addressbook/gui/merging/eab-contact-compare.c
+++ b/addressbook/gui/merging/eab-contact-compare.c
@@ -565,7 +565,7 @@ match_search_info_free (MatchSearchInfo *info)
}
static void
-query_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure)
+query_cb (EBook *book, const GError *error, GList *contacts, gpointer closure)
{
/* XXX we need to free contacts */
MatchSearchInfo *info = (MatchSearchInfo *) closure;
@@ -574,7 +574,7 @@ query_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure)
GList *remaining_contacts = NULL;
const GList *i;
- if (status != E_BOOK_ERROR_OK) {
+ if (error) {
info->cb (info->contact, NULL, EAB_CONTACT_MATCH_NONE, info->closure);
match_search_info_free (info);
return;
@@ -626,7 +626,7 @@ query_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure)
#define MAX_QUERY_PARTS 10
static void
-use_common_book_cb (EBook *book, gpointer closure)
+use_common_book_cb (EBook *book, const GError *error, gpointer closure)
{
MatchSearchInfo *info = (MatchSearchInfo *) closure;
EContact *contact = info->contact;
@@ -707,9 +707,9 @@ use_common_book_cb (EBook *book, gpointer closure)
}
if (query)
- e_book_async_get_contacts (book, query, query_cb, info);
+ e_book_async_get_contacts_ex (book, query, query_cb, info);
else
- query_cb (book, E_BOOK_ERROR_OK, NULL, info);
+ query_cb (book, NULL, NULL, info);
g_free (qj);
if (query)
@@ -731,7 +731,7 @@ eab_contact_locate_match (EContact *contact, EABContactMatchQueryCallback cb, gp
info->closure = closure;
info->avoid = NULL;
- addressbook_load_default_book ((EBookCallback) use_common_book_cb, info);
+ addressbook_load_default_book ((EBookExCallback) use_common_book_cb, info);
}
/**
@@ -762,8 +762,8 @@ eab_contact_locate_match_full (EBook *book, EContact *contact, GList *avoid, EAB
g_list_foreach (info->avoid, (GFunc) g_object_ref, NULL);
if (book)
- use_common_book_cb (book, info);
+ use_common_book_cb (book, NULL, info);
else
- addressbook_load_default_book ((EBookCallback) use_common_book_cb, info);
+ addressbook_load_default_book ((EBookExCallback) use_common_book_cb, info);
}
diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c
index ec37972b46..70a1aa462b 100644
--- a/addressbook/gui/merging/eab-contact-merging.c
+++ b/addressbook/gui/merging/eab-contact-merging.c
@@ -49,9 +49,9 @@ typedef struct {
/*match is the duplicate contact already existing in the addressbook*/
EContact *match;
GList *avoid;
- EBookIdCallback id_cb;
- EBookCallback cb;
- EBookContactCallback c_cb;
+ EBookIdExCallback id_cb;
+ EBookExCallback cb;
+ EBookContactExCallback c_cb;
gpointer closure;
} EContactMergingLookup;
@@ -110,12 +110,12 @@ free_lookup (EContactMergingLookup *lookup)
}
static void
-final_id_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
+final_id_cb (EBook *book, const GError *error, const gchar *id, gpointer closure)
{
EContactMergingLookup *lookup = closure;
if (lookup->id_cb)
- lookup->id_cb (lookup->book, status, id, lookup->closure);
+ lookup->id_cb (lookup->book, error, id, lookup->closure);
free_lookup (lookup);
@@ -123,12 +123,12 @@ final_id_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
}
static void
-final_cb_as_id (EBook *book, EBookStatus status, gpointer closure)
+final_cb_as_id (EBook *book, const GError *error, gpointer closure)
{
EContactMergingLookup *lookup = closure;
if (lookup->id_cb)
- lookup->id_cb (lookup->book, status, lookup->contact ? e_contact_get_const (lookup->contact, E_CONTACT_UID) : NULL, lookup->closure);
+ lookup->id_cb (lookup->book, error, lookup->contact ? e_contact_get_const (lookup->contact, E_CONTACT_UID) : NULL, lookup->closure);
free_lookup (lookup);
@@ -136,12 +136,12 @@ final_cb_as_id (EBook *book, EBookStatus status, gpointer closure)
}
static void
-final_cb (EBook *book, EBookStatus status, gpointer closure)
+final_cb (EBook *book, const GError *error, gpointer closure)
{
EContactMergingLookup *lookup = closure;
if (lookup->cb)
- lookup->cb (lookup->book, status, lookup->closure);
+ lookup->cb (lookup->book, error, lookup->closure);
free_lookup (lookup);
@@ -153,21 +153,25 @@ doit (EContactMergingLookup *lookup, gboolean force_commit)
{
if (lookup->op == E_CONTACT_MERGING_ADD) {
if (force_commit)
- e_book_async_commit_contact (lookup->book, lookup->contact, final_cb_as_id, lookup);
+ e_book_async_commit_contact_ex (lookup->book, lookup->contact, final_cb_as_id, lookup);
else
- e_book_async_add_contact (lookup->book, lookup->contact, final_id_cb, lookup);
+ e_book_async_add_contact_ex (lookup->book, lookup->contact, final_id_cb, lookup);
} else if (lookup->op == E_CONTACT_MERGING_COMMIT)
- e_book_async_commit_contact (lookup->book, lookup->contact, final_cb, lookup);
+ e_book_async_commit_contact_ex (lookup->book, lookup->contact, final_cb, lookup);
}
static void
cancelit (EContactMergingLookup *lookup)
{
+ GError *error = g_error_new (E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED, _("Cancelled"));
+
if (lookup->op == E_CONTACT_MERGING_ADD) {
- final_id_cb (lookup->book, E_BOOK_ERROR_CANCELLED, NULL, lookup);
+ final_id_cb (lookup->book, error, NULL, lookup);
} else if (lookup->op == E_CONTACT_MERGING_COMMIT) {
- final_cb (lookup->book, E_BOOK_ERROR_CANCELLED, lookup);
+ final_cb (lookup->book, error, lookup);
}
+
+ g_error_free (error);
}
static void
@@ -371,8 +375,8 @@ mergeit (EContactMergingLookup *lookup)
{
case GTK_RESPONSE_OK:
lookup->contact = lookup->match;
- e_book_async_remove_contact (lookup->book, lookup->match, NULL, lookup);
- e_book_async_add_contact (lookup->book, lookup->contact, final_id_cb, lookup);
+ e_book_async_remove_contact_ex (lookup->book, lookup->match, NULL, lookup);
+ e_book_async_add_contact_ex (lookup->book, lookup->contact, final_id_cb, lookup);
value = 1;
break;
case GTK_RESPONSE_CANCEL:
@@ -466,7 +470,7 @@ match_query_callback (EContact *contact, EContact *match, EABContactMatchType ty
if (lookup->op == E_CONTACT_MERGING_FIND) {
if (lookup->c_cb)
- lookup->c_cb (lookup->book, E_BOOK_ERROR_OK, (gint) type <= (gint) EAB_CONTACT_MATCH_VAGUE ? NULL : match, lookup->closure);
+ lookup->c_cb (lookup->book, NULL, (gint) type <= (gint) EAB_CONTACT_MATCH_VAGUE ? NULL : match, lookup->closure);
free_lookup (lookup);
finished_lookup ();
@@ -543,7 +547,7 @@ match_query_callback (EContact *contact, EContact *match, EABContactMatchType ty
gboolean
eab_merging_book_add_contact (EBook *book,
EContact *contact,
- EBookIdCallback cb,
+ EBookIdExCallback cb,
gpointer closure)
{
EContactMergingLookup *lookup;
@@ -566,7 +570,7 @@ eab_merging_book_add_contact (EBook *book,
gboolean
eab_merging_book_commit_contact (EBook *book,
EContact *contact,
- EBookCallback cb,
+ EBookExCallback cb,
gpointer closure)
{
EContactMergingLookup *lookup;
@@ -589,7 +593,7 @@ eab_merging_book_commit_contact (EBook *book,
gboolean
eab_merging_book_find_contact (EBook *book,
EContact *contact,
- EBookContactCallback cb,
+ EBookContactExCallback cb,
gpointer closure)
{
EContactMergingLookup *lookup;
diff --git a/addressbook/gui/merging/eab-contact-merging.h b/addressbook/gui/merging/eab-contact-merging.h
index fe1457f4e7..eacfcf734a 100644
--- a/addressbook/gui/merging/eab-contact-merging.h
+++ b/addressbook/gui/merging/eab-contact-merging.h
@@ -32,15 +32,15 @@ G_BEGIN_DECLS
gboolean eab_merging_book_add_contact (EBook *book,
EContact *contact,
- EBookIdCallback cb,
+ EBookIdExCallback cb,
gpointer closure);
gboolean eab_merging_book_commit_contact (EBook *book,
EContact *contact,
- EBookCallback cb,
+ EBookExCallback cb,
gpointer closure);
gboolean eab_merging_book_find_contact (EBook *book,
EContact *contact,
- EBookContactCallback cb,
+ EBookContactExCallback cb,
gpointer closure);
G_END_DECLS
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index e323d3d8a5..b469e8200d 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <glib/gi18n.h>
#include "e-addressbook-model.h"
+#include <e-util/e-marshal.h>
#include <e-util/e-util.h>
#include "eab-gui-util.h"
@@ -46,7 +47,7 @@ struct _EAddressbookModelPrivate {
gulong modify_contact_id;
gulong status_message_id;
gulong writable_status_id;
- gulong sequence_complete_id;
+ gulong view_complete_id;
gulong backend_died_id;
guint search_in_progress : 1;
@@ -109,16 +110,16 @@ remove_book_view(EAddressbookModel *model)
g_signal_handler_disconnect (
model->priv->book_view,
model->priv->status_message_id);
- if (model->priv->book_view && model->priv->sequence_complete_id)
+ if (model->priv->book_view && model->priv->view_complete_id)
g_signal_handler_disconnect (
model->priv->book_view,
- model->priv->sequence_complete_id);
+ model->priv->view_complete_id);
model->priv->create_contact_id = 0;
model->priv->remove_contact_id = 0;
model->priv->modify_contact_id = 0;
model->priv->status_message_id = 0;
- model->priv->sequence_complete_id = 0;
+ model->priv->view_complete_id = 0;
model->priv->search_in_progress = FALSE;
@@ -266,13 +267,14 @@ status_message (EBookView *book_view,
}
static void
-sequence_complete (EBookView *book_view,
+view_complete (EBookView *book_view,
EBookViewStatus status,
+ const gchar *error_msg,
EAddressbookModel *model)
{
model->priv->search_in_progress = FALSE;
status_message (book_view, NULL, model);
- g_signal_emit (model, signals[SEARCH_RESULT], 0, status);
+ g_signal_emit (model, signals[SEARCH_RESULT], 0, status, error_msg);
g_signal_emit (model, signals[STOP_STATE_CHANGED], 0);
}
@@ -297,14 +299,14 @@ backend_died (EBook *book,
static void
book_view_loaded (EBook *book,
- EBookStatus status,
+ const GError *error,
EBookView *book_view,
gpointer closure)
{
EAddressbookModel *model = closure;
- if (status != E_BOOK_ERROR_OK) {
- eab_error_dialog (_("Error getting book view"), status);
+ if (error) {
+ eab_error_dialog (_("Error getting book view"), error);
return;
}
@@ -327,9 +329,9 @@ book_view_loaded (EBook *book,
model->priv->status_message_id = g_signal_connect (
model->priv->book_view, "status-message",
G_CALLBACK (status_message), model);
- model->priv->sequence_complete_id = g_signal_connect (
- model->priv->book_view, "sequence-complete",
- G_CALLBACK (sequence_complete), model);
+ model->priv->view_complete_id = g_signal_connect (
+ model->priv->book_view, "view-complete",
+ G_CALLBACK (view_complete), model);
model->priv->search_in_progress = TRUE;
g_signal_emit (model, signals[MODEL_CHANGED], 0);
@@ -361,7 +363,7 @@ addressbook_model_idle_cb (EAddressbookModel *model)
model->priv->first_get_view = FALSE;
if (e_book_check_static_capability (model->priv->book, "do-initial-query")) {
- e_book_async_get_book_view (
+ e_book_async_get_book_view_ex (
model->priv->book, model->priv->query,
NULL, limit, book_view_loaded, model);
} else {
@@ -373,7 +375,7 @@ addressbook_model_idle_cb (EAddressbookModel *model)
signals[STOP_STATE_CHANGED], 0);
}
} else
- e_book_async_get_book_view (
+ e_book_async_get_book_view_ex (
model->priv->book, model->priv->query,
NULL, limit, book_view_loaded, model);
@@ -570,8 +572,8 @@ addressbook_model_class_init (EAddressbookModelClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EAddressbookModelClass, search_result),
NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
+ e_marshal_VOID__UINT_STRING,
+ G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING);
signals[FOLDER_BAR_MESSAGE] =
g_signal_new ("folder_bar_message",
diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h
index b42de48dbc..8dcc4060e0 100644
--- a/addressbook/gui/widgets/e-addressbook-model.h
+++ b/addressbook/gui/widgets/e-addressbook-model.h
@@ -63,7 +63,8 @@ struct _EAddressbookModelClass {
gboolean writable);
void (*search_started) (EAddressbookModel *model);
void (*search_result) (EAddressbookModel *model,
- EBookViewStatus status);
+ EBookViewStatus status,
+ const gchar *error_msg);
void (*status_message) (EAddressbookModel *model,
const gchar *message);
void (*folder_bar_message) (EAddressbookModel *model,
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
index 8953e3705e..f167075886 100644
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
@@ -337,6 +337,7 @@ search_started (EAddressbookModel *model,
static void
search_result (EAddressbookModel *model,
EBookViewStatus status,
+ const gchar *error_msg,
EAddressbookReflowAdapter *adapter)
{
EAddressbookReflowAdapterPrivate *priv = adapter->priv;
diff --git a/addressbook/gui/widgets/e-addressbook-selector.c b/addressbook/gui/widgets/e-addressbook-selector.c
index 690ad007ba..8ae7bc6bbb 100644
--- a/addressbook/gui/widgets/e-addressbook-selector.c
+++ b/addressbook/gui/widgets/e-addressbook-selector.c
@@ -102,7 +102,7 @@ merge_context_free (MergeContext *merge_context)
static void
addressbook_selector_removed_cb (EBook *book,
- EBookStatus status,
+ const GError *error,
MergeContext *merge_context)
{
merge_context->pending_removals--;
@@ -118,16 +118,16 @@ addressbook_selector_removed_cb (EBook *book,
static void
addressbook_selector_merge_next_cb (EBook *book,
- EBookStatus status,
+ const GError *error,
const gchar *id,
MergeContext *merge_context)
{
- if (merge_context->remove_from_source && status == E_BOOK_ERROR_OK) {
+ if (merge_context->remove_from_source && !error) {
/* Remove previous contact from source. */
- e_book_async_remove_contact (
+ e_book_async_remove_contact_ex (
merge_context->source_book,
merge_context->current_contact,
- (EBookCallback) addressbook_selector_removed_cb,
+ (EBookExCallback) addressbook_selector_removed_cb,
merge_context);
merge_context->pending_removals++;
}
@@ -139,7 +139,7 @@ addressbook_selector_merge_next_cb (EBook *book,
eab_merging_book_add_contact (
merge_context->target_book,
merge_context->current_contact,
- (EBookIdCallback) addressbook_selector_merge_next_cb,
+ (EBookIdExCallback) addressbook_selector_merge_next_cb,
merge_context);
} else if (merge_context->pending_removals == 0)
@@ -319,7 +319,7 @@ addressbook_selector_data_dropped (ESourceSelector *selector,
eab_merging_book_add_contact (
target_book, merge_context->current_contact,
- (EBookIdCallback) addressbook_selector_merge_next_cb,
+ (EBookIdExCallback) addressbook_selector_merge_next_cb,
merge_context);
return TRUE;
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c
index d3c122ef19..88e6554299 100644
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c
@@ -143,11 +143,11 @@ addressbook_value_at (ETableModel *etc, gint col, gint row)
/* This function sets the value at a particular point in our ETableModel. */
static void
-contact_modified_cb (EBook* book, EBookStatus status,
+contact_modified_cb (EBook* book, const GError *error,
gpointer user_data)
{
- if (status != E_BOOK_ERROR_OK)
- eab_error_dialog (_("Error modifying card"), status);
+ if (error)
+ eab_error_dialog (_("Error modifying card"), error);
}
static void
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 70c3c2334e..187b08b290 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -67,7 +67,7 @@
#define d(x)
static void status_message (EAddressbookView *view, const gchar *status);
-static void search_result (EAddressbookView *view, EBookViewStatus status);
+static void search_result (EAddressbookView *view, EBookViewStatus status, const gchar *error_msg);
static void folder_bar_message (EAddressbookView *view, const gchar *status);
static void stop_state_changed (GtkObject *object, EAddressbookView *view);
static void backend_died (EAddressbookView *view);
@@ -1084,14 +1084,15 @@ status_message (EAddressbookView *view,
static void
search_result (EAddressbookView *view,
- EBookViewStatus status)
+ EBookViewStatus status,
+ const gchar *error_msg)
{
EShellView *shell_view;
EShellWindow *shell_window;
shell_view = e_addressbook_view_get_shell_view (view);
shell_window = e_shell_view_get_shell_window (shell_view);
- eab_search_result_dialog (GTK_WIDGET (shell_window), status);
+ eab_search_result_dialog (GTK_WIDGET (shell_window), status, error_msg);
}
static void
@@ -1252,9 +1253,9 @@ e_addressbook_view_print (EAddressbookView *view,
* which a user doesnt have write permission
*/
static void
-delete_contacts_cb (EBook *book, EBookStatus status, gpointer closure)
+delete_contacts_cb (EBook *book, const GError *error, gpointer closure)
{
- switch (status) {
+ switch (error ? error->code : E_BOOK_ERROR_OK) {
case E_BOOK_ERROR_OK :
case E_BOOK_ERROR_CANCELLED :
break;
@@ -1265,7 +1266,7 @@ delete_contacts_cb (EBook *book, EBookStatus status, gpointer closure)
break;
default :
/* Unknown error */
- eab_error_dialog (_("Failed to delete contact"), status);
+ eab_error_dialog (_("Failed to delete contact"), error);
break;
}
}
@@ -1391,10 +1392,10 @@ e_addressbook_view_delete_selection(EAddressbookView *view, gboolean is_delete)
}
/* Remove the cards all at once. */
- e_book_async_remove_contacts (book,
- ids,
- delete_contacts_cb,
- NULL);
+ e_book_async_remove_contacts_ex (book,
+ ids,
+ delete_contacts_cb,
+ NULL);
g_list_free (ids);
}
@@ -1402,10 +1403,10 @@ e_addressbook_view_delete_selection(EAddressbookView *view, gboolean is_delete)
for (l=list;l;l=g_list_next(l)) {
contact = l->data;
/* Remove the card. */
- e_book_async_remove_contact (book,
- contact,
- delete_contacts_cb,
- NULL);
+ e_book_async_remove_contact_ex (book,
+ contact,
+ delete_contacts_cb,
+ NULL);
}
}
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index b69f842d63..ba9c1b5b26 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -456,7 +456,7 @@ e_minicard_view_selection_event (EReflow *reflow,
typedef struct {
EMinicardView *view;
- EBookCallback cb;
+ EBookExCallback cb;
gpointer closure;
} ViewCbClosure;
@@ -467,7 +467,7 @@ do_remove (gint i, gpointer user_data)
EContact *contact;
ViewCbClosure *viewcbclosure = user_data;
EMinicardView *view = viewcbclosure->view;
- EBookCallback cb = viewcbclosure->cb;
+ EBookExCallback cb = viewcbclosure->cb;
gpointer closure = viewcbclosure->closure;
g_object_get (view->adapter,
@@ -476,7 +476,7 @@ do_remove (gint i, gpointer user_data)
contact = e_addressbook_reflow_adapter_get_contact (view->adapter, i);
- e_book_async_remove_contact(book, contact, cb, closure);
+ e_book_async_remove_contact_ex (book, contact, cb, closure);
g_object_unref (contact);
}
@@ -624,7 +624,7 @@ e_minicard_view_get_type (void)
void
e_minicard_view_remove_selection(EMinicardView *view,
- EBookCallback cb,
+ EBookExCallback cb,
gpointer closure)
{
ViewCbClosure viewcbclosure;
diff --git a/addressbook/gui/widgets/e-minicard-view.h b/addressbook/gui/widgets/e-minicard-view.h
index babfddd0c3..e8fc9fc21f 100644
--- a/addressbook/gui/widgets/e-minicard-view.h
+++ b/addressbook/gui/widgets/e-minicard-view.h
@@ -85,7 +85,7 @@ struct _EMinicardViewClass
GType e_minicard_view_get_type (void);
void e_minicard_view_remove_selection (EMinicardView *view,
- EBookCallback cb,
+ EBookExCallback cb,
gpointer closure);
void e_minicard_view_jump_to_letter (EMinicardView *view,
gunichar letter);
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index d127d50786..a7642625e3 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -47,52 +47,17 @@
#include "addressbook/util/addressbook.h"
-/* the NULL's in this table correspond to the status codes
- that should *never* be generated by a backend */
-static const gchar *status_to_string[] = {
- /* E_BOOK_ERROR_OK */ N_("Success"),
- /* E_BOOK_ERROR_INVALID_ARG */ NULL,
- /* E_BOOK_ERROR_BUSY */ N_("Backend busy"),
- /* E_BOOK_ERROR_REPOSITORY_OFFLINE */ N_("Repository offline"),
- /* E_BOOK_ERROR_NO_SUCH_BOOK */ N_("Address Book does not exist"),
- /* E_BOOK_ERROR_NO_SELF_CONTACT */ N_("No Self Contact defined"),
- /* E_BOOK_ERROR_URI_NOT_LOADED */ NULL,
- /* E_BOOK_ERROR_URI_ALREADY_LOADED */ NULL,
- /* E_BOOK_ERROR_PERMISSION_DENIED */ N_("Permission denied"),
- /* E_BOOK_ERROR_CONTACT_NOT_FOUND */ N_("Contact not found"),
- /* E_BOOK_ERROR_CONTACT_ID_ALREADY_EXISTS */ N_("Contact ID already exists"),
- /* E_BOOK_ERROR_PROTOCOL_NOT_SUPPORTED */ N_("Protocol not supported"),
- /* E_BOOK_ERROR_CANCELLED */ N_("Canceled"),
- /* E_BOOK_ERROR_COULD_NOT_CANCEL */ N_("Could not cancel"),
- /* E_BOOK_ERROR_AUTHENTICATION_FAILED */ N_("Authentication Failed"),
- /* E_BOOK_ERROR_AUTHENTICATION_REQUIRED */ N_("Authentication Required"),
- /* E_BOOK_ERROR_TLS_NOT_AVAILABLE */ N_("TLS not Available"),
- /* E_BOOK_ERROR_CORBA_EXCEPTION */ NULL,
- /* E_BOOK_ERROR_NO_SUCH_SOURCE */ N_("No such source"),
- /* E_BOOK_ERROR_OFFLINE_UNAVAILABLE */ N_("Not available in offline mode"),
- /* E_BOOK_ERROR_OTHER_ERROR */ N_("Other error"),
- /* E_BOOK_ERROR_INVALID_SERVER_VERSION */ N_("Invalid server version"),
- /* E_BOOK_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD */ N_("Unsupported authentication method")
-};
-
void
-eab_error_dialog (const gchar *msg, EBookStatus status)
+eab_error_dialog (const gchar *msg, const GError *error)
{
- const gchar *status_str;
-
- if (status >= G_N_ELEMENTS (status_to_string))
- status_str = "Other error";
- else
- status_str = status_to_string [status];
-
- if (status_str)
+ if (error && error->message)
e_alert_run_dialog_for_args (e_shell_get_active_window (NULL),
"addressbook:generic-error",
- msg, _(status_str), NULL);
+ msg, error->message, NULL);
}
void
-eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status)
+eab_load_error_dialog (GtkWidget *parent, ESource *source, const GError *error)
{
gchar *label_string, *label = NULL, *uri;
GtkWidget *dialog;
@@ -102,7 +67,7 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status)
uri = e_source_get_uri (source);
- if (status == E_BOOK_ERROR_OFFLINE_UNAVAILABLE) {
+ if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_OFFLINE_UNAVAILABLE)) {
can_detail_error = FALSE;
label_string = _("This address book cannot be opened. This either means this "
"book is not marked for offline usage or not yet downloaded "
@@ -141,8 +106,8 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status)
if (can_detail_error) {
/* do not show repository offline message, it's kind of generic error */
- if (status != E_BOOK_ERROR_REPOSITORY_OFFLINE && status > 0 && status < G_N_ELEMENTS (status_to_string) && status_to_string [status]) {
- label = g_strconcat (label_string, "\n\n", _("Detailed error message:"), " ", _(status_to_string [status]), NULL);
+ if (error && !g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_REPOSITORY_OFFLINE)) {
+ label = g_strconcat (label_string, "\n\n", _("Detailed error message:"), " ", error->message, NULL);
label_string = label;
}
}
@@ -157,7 +122,8 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status)
void
eab_search_result_dialog (GtkWidget *parent,
- EBookViewStatus status)
+ EBookViewStatus status,
+ const gchar *error_msg)
{
gchar *str = NULL;
@@ -169,27 +135,37 @@ eab_search_result_dialog (GtkWidget *parent,
"configured to return or Evolution is configured to display.\n"
"Please make your search more specific or raise the result limit in\n"
"the directory server preferences for this address book.");
+ str = g_strdup (str);
break;
case E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED:
str = _("The time to execute this query exceeded the server limit or the limit\n"
"configured for this address book. Please make your search\n"
"more specific or raise the time limit in the directory server\n"
"preferences for this address book.");
+ str = g_strdup (str);
break;
case E_BOOK_VIEW_ERROR_INVALID_QUERY:
- str = _("The backend for this address book was unable to parse this query.");
+ /* Translators: %s is replaced with a detailed error message, or an empty string, if not provided */
+ str = _("The backend for this address book was unable to parse this query. %s");
+ str = g_strdup_printf (str, error_msg ? error_msg : "");
break;
case E_BOOK_VIEW_ERROR_QUERY_REFUSED:
- str = _("The backend for this address book refused to perform this query.");
+ /* Translators: %s is replaced with a detailed error message, or an empty string, if not provided */
+ str = _("The backend for this address book refused to perform this query. %s");
+ str = g_strdup_printf (str, error_msg ? error_msg : "");
break;
case E_BOOK_VIEW_ERROR_OTHER_ERROR:
- str = _("This query did not complete successfully.");
+ /* Translators: %s is replaced with a detailed error message, or an empty string, if not provided */
+ str = _("This query did not complete successfully. %s");
+ str = g_strdup_printf (str, error_msg ? error_msg : "");
break;
default:
g_return_if_reached ();
}
e_alert_run_dialog_for_args ((GtkWindow *) parent, "addressbook:search-error", str, NULL);
+
+ g_free (str);
}
gint
@@ -368,15 +344,15 @@ process_unref (ContactCopyProcess *process)
}
static void
-contact_added_cb (EBook* book, EBookStatus status, const gchar *id, gpointer user_data)
+contact_added_cb (EBook* book, const GError *error, const gchar *id, gpointer user_data)
{
ContactCopyProcess *process = user_data;
- if (status != E_BOOK_ERROR_OK && status != E_BOOK_ERROR_CANCELLED) {
+ if (error && !g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED)) {
process->book_status = FALSE;
- eab_error_dialog (_("Error adding contact"), status);
+ eab_error_dialog (_("Error adding contact"), error);
}
- else if (status == E_BOOK_ERROR_CANCELLED) {
+ else if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED)) {
process->book_status = FALSE;
}
else {
@@ -403,11 +379,11 @@ do_copy (gpointer data, gpointer user_data)
}
static void
-got_book_cb (EBook *book, EBookStatus status, gpointer closure)
+got_book_cb (EBook *book, const GError *error, gpointer closure)
{
ContactCopyProcess *process;
process = closure;
- if (status == E_BOOK_ERROR_OK) {
+ if (!error) {
process->destination = book;
process->book_status = TRUE;
g_object_ref (book);
diff --git a/addressbook/gui/widgets/eab-gui-util.h b/addressbook/gui/widgets/eab-gui-util.h
index ffa43ef94f..5f8890feb2 100644
--- a/addressbook/gui/widgets/eab-gui-util.h
+++ b/addressbook/gui/widgets/eab-gui-util.h
@@ -30,12 +30,13 @@
G_BEGIN_DECLS
void eab_error_dialog (const gchar *msg,
- EBookStatus status);
+ const GError *error);
void eab_load_error_dialog (GtkWidget *parent,
ESource *source,
- EBookStatus status);
+ const GError *error);
void eab_search_result_dialog (GtkWidget *parent,
- EBookViewStatus status);
+ EBookViewStatus status,
+ const gchar *error_msg);
gint eab_prompt_save_dialog (GtkWindow *parent);
void eab_transfer_contacts (EBook *source,
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
index 7eb955bba7..37b2837b5c 100644
--- a/addressbook/printing/e-contact-print.c
+++ b/addressbook/printing/e-contact-print.c
@@ -397,8 +397,7 @@ contacts_added (EBookView *book_view, const GList *contact_list,
}
static void
-sequence_complete (EBookView *book_view, const GList *contact_list,
- EFlag *book_view_started)
+view_complete (EBookView *book_view, EBookViewStatus status, const gchar *error_msg, EFlag *book_view_started)
{
e_flag_set (book_view_started);
}
@@ -596,8 +595,8 @@ load_contacts (EContactPrintContext *ctxt)
book_view, "contacts_added",
G_CALLBACK (contacts_added), ctxt);
g_signal_connect (
- book_view, "sequence_complete",
- G_CALLBACK (sequence_complete), book_view_started);
+ book_view, "view_complete",
+ G_CALLBACK (view_complete), book_view_started);
e_book_view_start (book_view);
@@ -609,7 +608,7 @@ load_contacts (EContactPrintContext *ctxt)
g_signal_handlers_disconnect_by_func (
book_view, G_CALLBACK (contacts_added), ctxt);
g_signal_handlers_disconnect_by_func (
- book_view, G_CALLBACK (sequence_complete), book_view_started);
+ book_view, G_CALLBACK (view_complete), book_view_started);
}
static void
diff --git a/addressbook/util/addressbook.c b/addressbook/util/addressbook.c
index b394319c0f..2185434d00 100644
--- a/addressbook/util/addressbook.c
+++ b/addressbook/util/addressbook.c
@@ -37,11 +37,11 @@
#define d(x)
static void addressbook_authenticate (EBook *book, gboolean previous_failure,
- ESource *source, EBookCallback cb, gpointer closure);
+ ESource *source, EBookExCallback cb, gpointer closure);
static void auth_required_cb (EBook *book, gpointer data);
typedef struct {
- EBookCallback cb;
+ EBookExCallback cb;
ESource *source;
gpointer closure;
guint cancelled : 1;
@@ -71,7 +71,7 @@ remove_parameters_from_uri (const gchar *uri)
}
static void
-load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
+load_source_auth_cb (EBook *book, const GError *error, gpointer closure)
{
LoadSourceData *data = closure;
gboolean was_in = g_object_get_data (G_OBJECT (book), "authenticated") != NULL;
@@ -83,10 +83,10 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
return;
}
- if (status != E_BOOK_ERROR_OK) {
+ if (error) {
/* the user clicked cancel in the password dialog */
- if (status == E_BOOK_ERROR_CANCELLED) {
+ if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED)) {
if (e_book_check_static_capability (book, "anon-access")) {
@@ -103,20 +103,20 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
"%s", _("Accessing LDAP Server anonymously"));
g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
- status = E_BOOK_ERROR_OK;
+ error = NULL;
goto done;
}
- } else if (status == E_BOOK_ERROR_INVALID_SERVER_VERSION) {
+ } else if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_INVALID_SERVER_VERSION)) {
e_alert_run_dialog_for_args (e_shell_get_active_window (NULL),
"addressbook:server-version",
NULL);
- status = E_BOOK_ERROR_OK;
+ error = NULL;
goto done;
- } else if (status == E_BOOK_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD) {
+ } else if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD)) {
goto done;
} else {
- if (status == E_BOOK_ERROR_AUTHENTICATION_FAILED) {
+ if (g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_AUTHENTICATION_FAILED)) {
const gchar *uri = e_book_get_uri (book);
gchar *stripped_uri = remove_parameters_from_uri (uri);
const gchar *auth_domain = e_source_get_property (data->source, "auth-domain");
@@ -142,7 +142,7 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
done:
if (data->cb)
- data->cb (book, status, data->closure);
+ data->cb (book, error, data->closure);
free_load_source_data (data);
}
@@ -168,7 +168,7 @@ set_remember_password (ESource *source, gboolean value)
static void
addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *source,
- EBookCallback cb, gpointer closure)
+ EBookExCallback cb, gpointer closure)
{
const gchar *password = NULL;
gchar *pass_dup = NULL;
@@ -231,14 +231,18 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc
}
if (password || pass_dup) {
- e_book_async_authenticate_user (book, user, password ? password : pass_dup,
- e_source_get_property (source, "auth"),
- cb, closure);
+ e_book_async_authenticate_user_ex (book, user, password ? password : pass_dup,
+ e_source_get_property (source, "auth"),
+ cb, closure);
g_free (pass_dup);
}
else {
+ GError *error = g_error_new (E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED, _("Cancelled"));
+
/* they hit cancel */
- cb (book, E_BOOK_ERROR_CANCELLED, closure);
+ cb (book, error, closure);
+
+ g_error_free (error);
}
g_free (uri);
@@ -256,7 +260,7 @@ auth_required_cb (EBook *book, gpointer data)
}
static void
-load_source_cb (EBook *book, EBookStatus status, gpointer closure)
+load_source_cb (EBook *book, const GError *error, gpointer closure)
{
LoadSourceData *load_source_data = closure;
@@ -265,7 +269,7 @@ load_source_cb (EBook *book, EBookStatus status, gpointer closure)
return;
}
- if (status == E_BOOK_ERROR_OK && book != NULL) {
+ if (!error && book != NULL) {
const gchar *auth;
auth = e_source_get_property (load_source_data->source, "auth");
@@ -279,13 +283,13 @@ load_source_cb (EBook *book, EBookStatus status, gpointer closure)
}
}
}
- load_source_data->cb (book, status, load_source_data->closure);
+ load_source_data->cb (book, error, load_source_data->closure);
free_load_source_data (load_source_data);
}
guint
addressbook_load (EBook *book,
- EBookCallback cb, gpointer closure)
+ EBookExCallback cb, gpointer closure)
{
LoadSourceData *load_source_data = g_new0 (LoadSourceData, 1);
@@ -294,7 +298,7 @@ addressbook_load (EBook *book,
load_source_data->source = g_object_ref (g_object_ref (e_book_get_source (book)));
load_source_data->cancelled = FALSE;
- e_book_async_open (book, FALSE, load_source_cb, load_source_data);
+ e_book_async_open_ex (book, FALSE, load_source_cb, load_source_data);
return GPOINTER_TO_UINT (load_source_data);
}
@@ -308,33 +312,33 @@ addressbook_load_cancel (guint id)
}
static void
-default_book_cb (EBook *book, EBookStatus status, gpointer closure)
+default_book_cb (EBook *book, const GError *error, gpointer closure)
{
LoadSourceData *load_source_data = closure;
- if (status == E_BOOK_ERROR_OK)
+ if (!error)
load_source_data->source = g_object_ref (e_book_get_source (book));
- load_source_cb (book, status, closure);
+ load_source_cb (book, error, closure);
}
void
-addressbook_load_default_book (EBookCallback cb, gpointer closure)
+addressbook_load_default_book (EBookExCallback cb, gpointer closure)
{
LoadSourceData *load_source_data = g_new (LoadSourceData, 1);
EBook *book;
+ GError *error = NULL;
load_source_data->cb = cb;
load_source_data->source = NULL;
load_source_data->closure = closure;
load_source_data->cancelled = FALSE;
- book = e_book_new_default_addressbook (NULL);
- if (!book)
- /* XXX We should just use a GError and its error code here. */
- load_source_cb (
- NULL, E_BOOK_ERROR_OTHER_ERROR, load_source_data);
- else
- e_book_async_open (
+ book = e_book_new_default_addressbook (&error);
+ if (!book) {
+ load_source_cb (NULL, error, load_source_data);
+ g_error_free (error);
+ } else
+ e_book_async_open_ex (
book, FALSE, default_book_cb, load_source_data);
}
diff --git a/addressbook/util/addressbook.h b/addressbook/util/addressbook.h
index 7bc92ee344..fca409ed8c 100644
--- a/addressbook/util/addressbook.h
+++ b/addressbook/util/addressbook.h
@@ -24,8 +24,8 @@
#include <libebook/e-book.h>
-guint addressbook_load (EBook *book, EBookCallback cb, gpointer closure);
+guint addressbook_load (EBook *book, EBookExCallback cb, gpointer closure);
void addressbook_load_cancel (guint id);
-void addressbook_load_default_book (EBookCallback open_response, gpointer closure);
+void addressbook_load_default_book (EBookExCallback open_response, gpointer closure);
#endif /* __ADDRESSBOOK_H__ */
diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c
index 40180d4631..2b1966684e 100644
--- a/addressbook/util/eab-book-util.c
+++ b/addressbook/util/eab-book-util.c
@@ -58,7 +58,7 @@ guint
eab_name_and_email_query (EBook *book,
const gchar *name,
const gchar *email,
- EBookListCallback cb,
+ EBookListExCallback cb,
gpointer closure)
{
gchar *email_query=NULL, *name_query=NULL;
@@ -119,7 +119,7 @@ eab_name_and_email_query (EBook *book,
else
return 0;
- tag = e_book_async_get_contacts (book, query, cb, closure);
+ tag = e_book_async_get_contacts_ex (book, query, cb, closure);
g_free (email_query);
g_free (name_query);
@@ -136,7 +136,7 @@ eab_name_and_email_query (EBook *book,
guint
eab_nickname_query (EBook *book,
const gchar *nickname,
- EBookListCallback cb,
+ EBookListExCallback cb,
gpointer closure)
{
EBookQuery *query;
@@ -154,7 +154,7 @@ eab_nickname_query (EBook *book,
query = e_book_query_from_string (query_string);
- retval = e_book_async_get_contacts (book, query, cb, closure);
+ retval = e_book_async_get_contacts_ex (book, query, cb, closure);
g_free (query_string);
e_book_query_unref (query);
diff --git a/addressbook/util/eab-book-util.h b/addressbook/util/eab-book-util.h
index 9f8a79eae1..edc7c3ebe6 100644
--- a/addressbook/util/eab-book-util.h
+++ b/addressbook/util/eab-book-util.h
@@ -34,11 +34,11 @@ typedef void (*EABHaveAddressCallback) (EBook *book, const gchar *addr, EContact
guint eab_name_and_email_query (EBook *book,
const gchar *name,
const gchar *email,
- EBookListCallback cb,
+ EBookListExCallback cb,
gpointer closure);
guint eab_nickname_query (EBook *book,
const gchar *nickname,
- EBookListCallback cb,
+ EBookListExCallback cb,
gpointer closure);
GList *eab_contact_list_from_string (const gchar *str);
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
index 7ad414c61c..df6a8fc4f7 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/gui/alarm-notify/alarm-notify.c
@@ -308,16 +308,16 @@ alarm_notify_new (void)
}
static void
-cal_opened_cb (ECal *client, ECalendarStatus status, gpointer user_data)
+cal_opened_cb (ECal *client, const GError *error, gpointer user_data)
{
AlarmNotifyPrivate *priv;
AlarmNotify *an = ALARM_NOTIFY (user_data);
priv = an->priv;
- d (printf("%s:%d (cal_opened_cb) %s - Calendar Status %d\n", __FILE__, __LINE__, e_cal_get_uri (client), status));
+ d (printf("%s:%d (cal_opened_cb) %s - Calendar Status %d%s%s%s\n", __FILE__, __LINE__, e_cal_get_uri (client), error ? error->code : 0, error ? " (" : "", error ? error->message : "", error ? ")" : ""));
- if (status == E_CALENDAR_STATUS_OK)
+ if (!error)
alarm_queue_add_client (client);
else {
g_hash_table_remove (priv->uri_client_hash[e_cal_get_source_type (client)],
@@ -389,7 +389,7 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalSourceType source_type, ESource
if (client) {
d (printf("%s:%d (alarm_notify_add_calendar) %s - Calendar Open Async... %p\n", __FILE__, __LINE__, str_uri, client));
g_hash_table_insert (priv->uri_client_hash[source_type], g_strdup (str_uri), client);
- g_signal_connect (G_OBJECT (client), "cal_opened", G_CALLBACK (cal_opened_cb), an);
+ g_signal_connect (G_OBJECT (client), "cal_opened_ex", G_CALLBACK (cal_opened_cb), an);
/* to resolve floating DATE-TIME properly */
e_cal_set_default_timezone (client, config_data_get_timezone (), NULL);
e_cal_open_async (client, FALSE);
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
index f7ef6fdcf4..426d69ec55 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/gui/alarm-notify/alarm-queue.c
@@ -597,14 +597,14 @@ load_alarms_for_today (ClientAlarms *ca)
/* Called when a calendar client finished loading; we load its alarms */
static void
-cal_opened_cb (ECal *client, ECalendarStatus status, gpointer data)
+cal_opened_cb (ECal *client, const GError *error, gpointer data)
{
ClientAlarms *ca;
ca = data;
- d(printf("%s:%d (cal_opened_cb) - Opened Calendar %p (Status %d)\n",__FILE__, __LINE__, client, status==E_CALENDAR_STATUS_OK));
- if (status != E_CALENDAR_STATUS_OK)
+ d(printf("%s:%d (cal_opened_cb) - Opened Calendar %p (Status %d%s%s%s)\n",__FILE__, __LINE__, client, error ? error->code : 0, error ? " (" : "", error ? error->message : "", error ? ")" : ""));
+ if (error)
return;
load_alarms_for_today (ca);
@@ -1999,7 +1999,7 @@ alarm_queue_add_async (struct _alarm_client_msg *msg)
if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED) {
load_alarms_for_today (ca);
} else {
- g_signal_connect (client, "cal_opened",
+ g_signal_connect (client, "cal_opened_ex",
G_CALLBACK (cal_opened_cb),
ca);
}
diff --git a/calendar/gui/dialogs/delete-error.c b/calendar/gui/dialogs/delete-error.c
index c312e16ada..9b9d22ae4c 100644
--- a/calendar/gui/dialogs/delete-error.c
+++ b/calendar/gui/dialogs/delete-error.c
@@ -39,7 +39,7 @@
*
**/
void
-delete_error_dialog (GError *error, ECalComponentVType vtype)
+delete_error_dialog (const GError *error, ECalComponentVType vtype)
{
GtkWidget *dialog;
const gchar *str;
@@ -49,19 +49,23 @@ delete_error_dialog (GError *error, ECalComponentVType vtype)
return;
switch (error->code) {
- case E_CALENDAR_STATUS_CORBA_EXCEPTION:
+ case E_CALENDAR_STATUS_DBUS_EXCEPTION:
switch (vtype) {
case E_CAL_COMPONENT_EVENT:
- str = _("The event could not be deleted due to a corba error");
+ /* Translators: The '%s' is replaced with a detailed error message */
+ str = _("The event could not be deleted due to a dbus error: %s");
break;
case E_CAL_COMPONENT_TODO:
- str = _("The task could not be deleted due to a corba error");
+ /* Translators: The '%s' is replaced with a detailed error message */
+ str = _("The task could not be deleted due to a dbus error: %s");
break;
case E_CAL_COMPONENT_JOURNAL:
- str = _("The memo could not be deleted due to a corba error");
+ /* Translators: The '%s' is replaced with a detailed error message */
+ str = _("The memo could not be deleted due to a dbus error: %s");
break;
default:
- str = _("The item could not be deleted due to a corba error");
+ /* Translators: The '%s' is replaced with a detailed error message */
+ str = _("The item could not be deleted due to a dbus error: %s");
break;
}
break;
@@ -84,16 +88,20 @@ delete_error_dialog (GError *error, ECalComponentVType vtype)
case E_CALENDAR_STATUS_OTHER_ERROR:
switch (vtype) {
case E_CAL_COMPONENT_EVENT:
- str = _("The event could not be deleted due to an error");
+ /* Translators: The '%s' is replaced with a detailed error message */
+ str = _("The event could not be deleted due to an error: %s");
break;
case E_CAL_COMPONENT_TODO:
- str = _("The task could not be deleted due to an error");
+ /* Translators: The '%s' is replaced with a detailed error message */
+ str = _("The task could not be deleted due to an error: %s");
break;
case E_CAL_COMPONENT_JOURNAL:
- str = _("The memo could not be deleted due to an error");
+ /* Translators: The '%s' is replaced with a detailed error message */
+ str = _("The memo could not be deleted due to an error: %s");
break;
default:
- str = _("The item could not be deleted due to an error");
+ /* Translators: The '%s' is replaced with a detailed error message */
+ str = _("The item could not be deleted due to an error: %s");
break;
}
break;
@@ -106,7 +114,7 @@ delete_error_dialog (GError *error, ECalComponentVType vtype)
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK, "%s", str);
+ GTK_BUTTONS_OK, str, error->message);
if (vtype == E_CAL_COMPONENT_EVENT)
icon_name = "x-office-calendar";
else if (vtype == E_CAL_COMPONENT_TODO)
diff --git a/calendar/gui/dialogs/delete-error.h b/calendar/gui/dialogs/delete-error.h
index dab620541f..0353d188f2 100644
--- a/calendar/gui/dialogs/delete-error.h
+++ b/calendar/gui/dialogs/delete-error.h
@@ -30,6 +30,6 @@
#include <libecal/e-cal.h>
#include <libecal/e-cal-component.h>
-void delete_error_dialog (GError *error, ECalComponentVType vtype);
+void delete_error_dialog (const GError *error, ECalComponentVType vtype);
#endif
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index e745d33810..d04c87ad93 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -136,7 +136,10 @@ enum {
ROW_APPENDED,
COMPS_DELETED,
CAL_VIEW_PROGRESS,
+ #ifndef E_CAL_DISABLE_DEPRECATED
CAL_VIEW_DONE,
+ #endif
+ CAL_VIEW_COMPLETE,
STATUS_MESSAGE,
TIMEZONE_CHANGED,
LAST_SIGNAL
@@ -394,6 +397,8 @@ e_cal_model_class_init (ECalModelClass *class)
NULL, NULL,
e_marshal_VOID__STRING_INT_INT,
G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
+
+ #ifndef E_CAL_DISABLE_DEPRECATED
signals[CAL_VIEW_DONE] =
g_signal_new ("cal_view_done",
G_TYPE_FROM_CLASS (class),
@@ -402,6 +407,16 @@ e_cal_model_class_init (ECalModelClass *class)
NULL, NULL,
e_marshal_VOID__INT_INT,
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
+ #endif
+
+ signals[CAL_VIEW_COMPLETE] =
+ g_signal_new ("cal_view_complete",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ECalModelClass, cal_view_complete),
+ NULL, NULL,
+ e_marshal_VOID__INT_STRING_INT,
+ G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT);
signals[STATUS_MESSAGE] = g_signal_new (
"status-message",
@@ -2003,16 +2018,20 @@ e_cal_view_progress_cb (ECalView *query, const gchar *message, gint percent, gpo
}
static void
-e_cal_view_done_cb (ECalView *query, ECalendarStatus status, gpointer user_data)
+e_cal_view_complete_cb (ECalView *query, ECalendarStatus status, const gchar *error_msg, gpointer user_data)
{
ECalModel *model = (ECalModel *) user_data;
ECal *client = e_cal_view_get_client (query);
g_return_if_fail (E_IS_CAL_MODEL (model));
+ #ifndef E_CAL_DISABLE_DEPRECATED
/* emit the signal on the model and let the view catch it to display */
g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_DONE], 0, status,
e_cal_get_source_type (client));
+ #endif
+ g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_COMPLETE], 0, status, error_msg,
+ e_cal_get_source_type (client));
}
static void
@@ -2062,7 +2081,7 @@ try_again:
g_signal_connect (client_data->query, "objects_modified", G_CALLBACK (e_cal_view_objects_modified_cb), model);
g_signal_connect (client_data->query, "objects_removed", G_CALLBACK (e_cal_view_objects_removed_cb), model);
g_signal_connect (client_data->query, "view_progress", G_CALLBACK (e_cal_view_progress_cb), model);
- g_signal_connect (client_data->query, "view_done", G_CALLBACK (e_cal_view_done_cb), model);
+ g_signal_connect (client_data->query, "view_complete", G_CALLBACK (e_cal_view_complete_cb), model);
e_cal_view_start (client_data->query);
}
@@ -2086,17 +2105,17 @@ backend_died_cb (ECal *client, gpointer user_data)
}
static void
-cal_opened_cb (ECal *client, ECalendarStatus status, gpointer user_data)
+cal_opened_cb (ECal *client, const GError *error, gpointer user_data)
{
ECalModel *model = (ECalModel *) user_data;
ECalModelClient *client_data;
- if (status == E_CALENDAR_STATUS_BUSY) {
+ if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_BUSY)) {
e_cal_open_async (client, FALSE);
return;
}
- if (status != E_CALENDAR_STATUS_OK) {
+ if (error) {
e_cal_model_remove_client (model, client);
e_cal_model_update_status_message (model, NULL, -1.0);
return;
@@ -2159,7 +2178,7 @@ add_new_client (ECalModel *model, ECal *client, gboolean do_query)
e_cal_set_default_timezone (client, e_cal_model_get_timezone (model), NULL);
- g_signal_connect (client, "cal_opened", G_CALLBACK (cal_opened_cb), model);
+ g_signal_connect (client, "cal_opened_ex", G_CALLBACK (cal_opened_cb), model);
e_cal_open_async (client, TRUE);
}
diff --git a/calendar/gui/e-cal-model.h b/calendar/gui/e-cal-model.h
index 29c3335310..2750006f06 100644
--- a/calendar/gui/e-cal-model.h
+++ b/calendar/gui/e-cal-model.h
@@ -160,9 +160,15 @@ struct _ECalModelClass {
const gchar *message,
gint progress,
ECalSourceType type);
+ #ifndef E_CAL_DISABLE_DEPRECATED
void (*cal_view_done) (ECalModel *model,
ECalendarStatus status,
ECalSourceType type);
+ #endif
+ void (*cal_view_complete) (ECalModel *model,
+ ECalendarStatus status,
+ const gchar *error_msg,
+ ECalSourceType type);
void (*status_message) (ECalModel *model,
const gchar *message,
gdouble percent);
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index fed200d34c..dd9516f7bf 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -142,7 +142,7 @@ set_ok_sens (EItipControl *itip)
}
static void
-cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
+cal_opened_cb (ECal *ecal, const GError *error, gpointer data)
{
EItipControl *itip = data;
EItipControlPrivate *priv;
@@ -156,7 +156,7 @@ cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, cal_opened_cb, NULL);
- if (status != E_CALENDAR_STATUS_OK) {
+ if (error) {
g_hash_table_remove (priv->ecals[source_type], e_source_peek_uid (source));
return;
@@ -166,7 +166,7 @@ cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
set_ok_sens (itip);
}
-typedef void (* EItipControlOpenFunc) (ECal *ecal, ECalendarStatus status, gpointer data);
+typedef void (* EItipControlOpenFunc) (ECal *ecal, const GError *error, gpointer data);
static ECal *
start_calendar_server (EItipControl *itip, ESource *source, ECalSourceType type, EItipControlOpenFunc func, gpointer data)
@@ -189,7 +189,7 @@ start_calendar_server (EItipControl *itip, ESource *source, ECalSourceType type,
zone = calendar_config_get_icaltimezone ();
e_cal_set_default_timezone (ecal, zone, NULL);
- g_signal_connect (G_OBJECT (ecal), "cal_opened", G_CALLBACK (func), data);
+ g_signal_connect (G_OBJECT (ecal), "cal_opened_ex", G_CALLBACK (func), data);
g_hash_table_insert (priv->ecals[type], g_strdup (e_source_peek_uid (source)), ecal);
@@ -239,7 +239,7 @@ source_changed_cb (ESourceComboBox *escb, EItipControl *itip)
}
static void
-find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
+find_cal_opened_cb (ECal *ecal, const GError *error, gpointer data)
{
EShell *shell;
EShellSettings *shell_settings;
@@ -262,7 +262,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, find_cal_opened_cb, NULL);
- if (status != E_CALENDAR_STATUS_OK) {
+ if (error) {
g_hash_table_remove (priv->ecals[source_type], e_source_peek_uid (source));
goto cleanup;
diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c
index a078fd140f..9888ec80d4 100644
--- a/calendar/gui/e-memo-table.c
+++ b/calendar/gui/e-memo-table.c
@@ -168,9 +168,10 @@ memo_table_model_cal_view_progress_cb (EMemoTable *memo_table,
}
static void
-memo_table_model_cal_view_done_cb (EMemoTable *memo_table,
- ECalendarStatus status,
- ECalSourceType type)
+memo_table_model_cal_view_complete_cb ( EMemoTable *memo_table,
+ ECalendarStatus status,
+ const gchar *error_msg,
+ ECalSourceType type)
{
memo_table_emit_status_message (memo_table, NULL, -1.0);
}
@@ -216,8 +217,8 @@ memo_table_set_model (EMemoTable *memo_table,
memo_table);
g_signal_connect_swapped (
- model, "cal-view-done",
- G_CALLBACK (memo_table_model_cal_view_done_cb),
+ model, "cal-view-complete",
+ G_CALLBACK (memo_table_model_cal_view_complete_cb),
memo_table);
}
diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c
index 98d422aa16..f792ad3c66 100644
--- a/calendar/gui/e-task-table.c
+++ b/calendar/gui/e-task-table.c
@@ -246,9 +246,10 @@ task_table_model_cal_view_progress_cb (ETaskTable *task_table,
}
static void
-task_table_model_cal_view_done_cb (ETaskTable *task_table,
- ECalendarStatus status,
- ECalSourceType type)
+task_table_model_cal_view_complete_cb ( ETaskTable *task_table,
+ ECalendarStatus status,
+ const gchar *error_msg,
+ ECalSourceType type)
{
task_table_emit_status_message (task_table, NULL, -1.0);
}
@@ -294,8 +295,8 @@ task_table_set_model (ETaskTable *task_table,
task_table);
g_signal_connect_swapped (
- model, "cal-view-done",
- G_CALLBACK (task_table_model_cal_view_done_cb),
+ model, "cal-view-complete",
+ G_CALLBACK (task_table_model_cal_view_complete_cb),
task_table);
}
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 38121c095c..5ecbf0a157 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -305,10 +305,11 @@ view_progress_cb (ECalModel *model,
}
static void
-view_done_cb (ECalModel *model,
- ECalendarStatus status,
- ECalSourceType type,
- GnomeCalendar *gcal)
+view_complete_cb (ECalModel *model,
+ ECalendarStatus status,
+ const gchar *error_msg,
+ ECalSourceType type,
+ GnomeCalendar *gcal)
{
gcal_update_status_message (gcal, NULL, -1);
}
@@ -419,8 +420,8 @@ gnome_calendar_constructed (GObject *object)
G_CALLBACK (view_progress_cb), gcal);
g_signal_connect (
- model, "cal-view-done",
- G_CALLBACK (view_done_cb), gcal);
+ model, "cal-view-complete",
+ G_CALLBACK (view_complete_cb), gcal);
/* Day View */
calendar_view = e_day_view_new (model);
@@ -807,11 +808,11 @@ dn_e_cal_view_objects_removed_cb (ECalView *query, GList *ids, gpointer data)
/* Callback used when the calendar query is done */
static void
-dn_e_cal_view_done_cb (ECalView *query, ECalendarStatus status, gpointer data)
+dn_e_cal_view_complete_cb (ECalView *query, ECalendarStatus status, const gchar *error_msg, gpointer data)
{
/* FIXME Better error reporting */
if (status != E_CALENDAR_STATUS_OK)
- g_warning (G_STRLOC ": Query did not successfully complete");
+ g_warning (G_STRLOC ": Query did not successfully complete, code:%d (%s)", status, error_msg ? error_msg : "Unknown error");
}
ECalendarView *
@@ -1103,8 +1104,8 @@ try_again:
G_CALLBACK (dn_e_cal_view_objects_modified_cb), gcal);
g_signal_connect (new_query, "objects_removed",
G_CALLBACK (dn_e_cal_view_objects_removed_cb), gcal);
- g_signal_connect (new_query, "view_done",
- G_CALLBACK (dn_e_cal_view_done_cb), gcal);
+ g_signal_connect (new_query, "view_complete",
+ G_CALLBACK (dn_e_cal_view_complete_cb), gcal);
g_mutex_lock (priv->dn_query_lock);
priv->dn_queries = g_list_append (priv->dn_queries, new_query);
@@ -1487,7 +1488,7 @@ gnome_calendar_do_dispose (GObject *object)
g_signal_handlers_disconnect_by_func (
priv->model, view_progress_cb, gcal);
g_signal_handlers_disconnect_by_func (
- priv->model, view_done_cb, gcal);
+ priv->model, view_complete_cb, gcal);
g_object_unref (priv->model);
priv->model = NULL;
}
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
index 77884da945..38db4cad92 100644
--- a/calendar/importers/icalendar-importer.c
+++ b/calendar/importers/icalendar-importer.c
@@ -319,9 +319,9 @@ ivcal_import_items(gpointer d)
}
static void
-ivcal_opened(ECal *ecal, ECalendarStatus status, ICalImporter *ici)
+ivcal_opened(ECal *ecal, const GError *error, ICalImporter *ici)
{
- if (!ici->cancelled && status == E_CALENDAR_STATUS_OK) {
+ if (!ici->cancelled && !error) {
e_import_status(ici->import, ici->target, _("Importing..."), 0);
ici->idle_id = g_idle_add(ivcal_import_items, ici);
} else
@@ -348,7 +348,7 @@ ivcal_import(EImport *ei, EImportTarget *target, icalcomponent *icalcomp)
ici->client = client;
ici->source_type = type;
e_import_status(ei, target, _("Opening calendar"), 0);
- g_signal_connect(client, "cal-opened", G_CALLBACK(ivcal_opened), ici);
+ g_signal_connect(client, "cal-opened-ex", G_CALLBACK(ivcal_opened), ici);
e_cal_open_async(client, TRUE);
return;
} else {
diff --git a/configure.ac b/configure.ac
index e664073bb1..5810a6dd85 100644
--- a/configure.ac
+++ b/configure.ac
@@ -169,6 +169,8 @@ dnl -Wmissing-format-attribute
dnl -Wshadow
dnl -Wformat-nonliteral
dnl -Wstrict-aliasing=2
+dnl -DE_BOOK_DISABLE_DEPRECATED
+dnl -DE_CAL_DISABLE_DEPRECATED
dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
dnl behavior that -- according to the C99 standard -- is supposed to be
diff --git a/e-util/e-marshal.list b/e-util/e-marshal.list
index ab270d2f34..9cc975f3b4 100644
--- a/e-util/e-marshal.list
+++ b/e-util/e-marshal.list
@@ -33,6 +33,7 @@ NONE:INT,POINTER,INT,OBJECT
NONE:INT,POINTER,INT,OBJECT,BOXED,UINT,UINT
NONE:INT,POINTER,INT,OBJECT,INT,INT,BOXED,UINT,UINT
NONE:INT,POINTER,INT,OBJECT,UINT
+NONE:INT,STRING,INT
NONE:LONG,LONG
NONE:OBJECT,BOOLEAN
NONE:OBJECT,DOUBLE,DOUBLE,BOOLEAN
@@ -44,6 +45,7 @@ NONE:OBJECT,STRING,STRING,INT,STRING,STRING,STRING
NONE:POINTER,INT
NONE:POINTER,INT,INT,INT,INT
NONE:POINTER,INT,OBJECT
+NONE:POINTER,OBJECT
NONE:POINTER,POINTER
NONE:POINTER,POINTER,INT
NONE:STRING,DOUBLE
@@ -51,5 +53,5 @@ NONE:STRING,INT,INT
NONE:STRING,POINTER,POINTER
NONE:STRING,STRING
NONE:STRING,STRING,UINT
+NONE:UINT,STRING
STRING:NONE
-
diff --git a/mail/em-utils.c b/mail/em-utils.c
index aa147bf7e1..e182e61364 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1565,18 +1565,18 @@ struct TryOpenEBookStruct {
};
static void
-try_open_e_book_cb (EBook *book, EBookStatus status, gpointer closure)
+try_open_e_book_cb (EBook *book, const GError *error, gpointer closure)
{
struct TryOpenEBookStruct *data = (struct TryOpenEBookStruct *)closure;
if (!data)
return;
- data->result = status == E_BOOK_ERROR_OK;
+ data->result = error == NULL;
if (!data->result) {
g_clear_error (data->error);
- g_set_error (data->error, E_BOOK_ERROR, status, "EBookStatus returned %d", status);
+ g_propagate_error (data->error, g_error_copy (error));
}
e_flag_set (data->flag);
@@ -1600,10 +1600,10 @@ try_open_e_book (EBook *book, gboolean only_if_exists, GError **error)
data.flag = flag;
data.result = FALSE;
- if (e_book_async_open (book, only_if_exists, try_open_e_book_cb, &data) != FALSE) {
+ if (!e_book_async_open_ex (book, only_if_exists, try_open_e_book_cb, &data)) {
e_flag_free (flag);
g_clear_error (error);
- g_set_error (error, E_BOOK_ERROR, E_BOOK_ERROR_OTHER_ERROR, "Failed to call e_book_async_open.");
+ g_set_error (error, E_BOOK_ERROR, E_BOOK_ERROR_OTHER_ERROR, "Failed to call e_book_async_open_ex.");
return FALSE;
}
diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c
index d0340f7974..652b7a5a73 100644
--- a/modules/addressbook/e-book-shell-backend.c
+++ b/modules/addressbook/e-book-shell-backend.c
@@ -230,7 +230,7 @@ book_shell_backend_init_importers (void)
static void
book_shell_backend_new_contact_cb (EBook *book,
- EBookStatus status,
+ const GError *error,
gpointer user_data)
{
EShell *shell;
@@ -238,7 +238,7 @@ book_shell_backend_new_contact_cb (EBook *book,
EABEditor *editor;
/* XXX Handle errors better. */
- if (status != E_BOOK_ERROR_OK)
+ if (error)
return;
contact = e_contact_new ();
@@ -255,7 +255,7 @@ book_shell_backend_new_contact_cb (EBook *book,
static void
book_shell_backend_new_contact_list_cb (EBook *book,
- EBookStatus status,
+ const GError *error,
gpointer user_data)
{
EShell *shell;
@@ -263,7 +263,7 @@ book_shell_backend_new_contact_list_cb (EBook *book,
EABEditor *editor;
/* XXX Handle errors better. */
- if (status != E_BOOK_ERROR_OK)
+ if (error)
return;
contact = e_contact_new ();
@@ -317,12 +317,12 @@ action_contact_new_cb (GtkAction *action,
book = e_book_new_default_addressbook (NULL);
if (strcmp (action_name, "contact-new") == 0)
- e_book_async_open (
+ e_book_async_open_ex (
book, FALSE,
book_shell_backend_new_contact_cb, shell);
if (strcmp (action_name, "contact-new-list") == 0)
- e_book_async_open (
+ e_book_async_open_ex (
book, FALSE,
book_shell_backend_new_contact_list_cb, shell);
}
diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c
index 4008cfa1f7..4482383331 100644
--- a/modules/addressbook/e-book-shell-view-private.c
+++ b/modules/addressbook/e-book-shell-view-private.c
@@ -177,7 +177,7 @@ contacts_removed (EBookShellView *book_shell_view,
static void
book_open_cb (EBook *book,
- EBookStatus status,
+ const GError *error,
gpointer user_data)
{
EAddressbookView *view = user_data;
@@ -187,11 +187,11 @@ book_open_cb (EBook *book,
source = e_book_get_source (book);
model = e_addressbook_view_get_model (view);
- if (status == E_BOOK_ERROR_OK) {
+ if (!error) {
e_addressbook_model_set_book (model, book);
e_addressbook_model_force_folder_bar_message (model);
- } else if (status != E_BOOK_ERROR_CANCELLED)
- eab_load_error_dialog (NULL /* XXX */, source, status);
+ } else if (!g_error_matches (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED))
+ eab_load_error_dialog (NULL /* XXX */, source, error);
}
static void
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);
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index cbefc53bc4..c0d4e1034e 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -145,7 +145,7 @@ typedef struct {
gint count;
} FormatItipFindData;
-typedef void (* FormatItipOpenFunc) (ECal *ecal, ECalendarStatus status, gpointer data);
+typedef void (* FormatItipOpenFunc) (ECal *ecal, const GError *error, gpointer data);
static gboolean check_is_instance (icalcomponent *icalcomp);
@@ -472,24 +472,25 @@ set_buttons_sensitive (struct _itip_puri *pitip)
}
static void
-add_failed_to_load_msg (ItipView *view, ESource *source, ECalendarStatus status)
+add_failed_to_load_msg (ItipView *view, ESource *source, const GError *error)
{
- gchar *msg, *msg_full;
+ gchar *msg;
g_return_if_fail (view != NULL);
g_return_if_fail (source != NULL);
+ g_return_if_fail (error != NULL);
- msg = g_strdup_printf (_("Failed to load the calendar '%s'"), e_source_peek_name (source));
- msg_full = g_strconcat (msg, " (", e_cal_get_error_message (status), ")", NULL);
+ /* Translators: The first '%s' is replaced with a calendar name,
+ the second '%s' with an error message */
+ msg = g_strdup_printf (_("Failed to load the calendar '%s' (%s)"), e_source_peek_name (source), error->message);
- itip_view_add_lower_info_item (view, ITIP_VIEW_INFO_ITEM_TYPE_WARNING, msg_full);
+ itip_view_add_lower_info_item (view, ITIP_VIEW_INFO_ITEM_TYPE_WARNING, msg);
- g_free (msg_full);
g_free (msg);
}
static void
-cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
+cal_opened_cb (ECal *ecal, const GError *error, gpointer data)
{
struct _itip_puri *pitip = data;
ESource *source;
@@ -500,10 +501,10 @@ cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, cal_opened_cb, NULL);
- if (status != E_CALENDAR_STATUS_OK) {
+ if (error) {
d(printf ("Failed opening itip formatter calendar '%s' during non-search opening\n", e_source_peek_name (source)));
- add_failed_to_load_msg (ITIP_VIEW (pitip->view), source, status);
+ add_failed_to_load_msg (ITIP_VIEW (pitip->view), source, error);
if (pitip->current_ecal == ecal) {
pitip->current_ecal = NULL;
@@ -561,7 +562,7 @@ start_calendar_server (struct _itip_puri *pitip, ESource *source, ECalSourceType
if (!ecal)
return NULL;
- g_signal_connect (G_OBJECT (ecal), "cal_opened", G_CALLBACK (func), data);
+ g_signal_connect (G_OBJECT (ecal), "cal_opened_ex", G_CALLBACK (func), data);
g_hash_table_insert (pitip->ecals[type], g_strdup (e_source_peek_uid (source)), ecal);
@@ -604,7 +605,7 @@ source_selected_cb (ItipView *view, ESource *source, gpointer data)
}
static void
-find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
+find_cal_opened_cb (ECal *ecal, const GError *error, gpointer data)
{
FormatItipFindData *fd = data;
struct _itip_puri *pitip = fd->puri;
@@ -620,12 +621,12 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, find_cal_opened_cb, NULL);
- if (status != E_CALENDAR_STATUS_OK) {
+ if (error) {
/* FIXME Do we really want to warn here? If we fail
* to find the item, this won't be cleared but the
* selector might be shown */
d(printf ("Failed opening itip formatter calendar '%s' during search opening... ", e_source_peek_name (source)));
- add_failed_to_load_msg (ITIP_VIEW (pitip->view), source, status);
+ add_failed_to_load_msg (ITIP_VIEW (pitip->view), source, error);
if (pitip->current_ecal == ecal) {
pitip->current_ecal = NULL;
diff --git a/plugins/vcard-inline/vcard-inline.c b/plugins/vcard-inline/vcard-inline.c
index dffc407d66..5d0c681d4c 100644
--- a/plugins/vcard-inline/vcard-inline.c
+++ b/plugins/vcard-inline/vcard-inline.c
@@ -114,13 +114,13 @@ org_gnome_vcard_inline_decode (VCardInlinePObject *vcard_object,
static void
org_gnome_vcard_inline_book_open_cb (EBook *book,
- EBookStatus status,
+ const GError *error,
gpointer user_data)
{
GList *contact_list = user_data;
GList *iter;
- if (status != E_BOOK_ERROR_OK)
+ if (error)
goto exit;
for (iter = contact_list; iter != NULL; iter = iter->next)