aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend/pas')
-rw-r--r--addressbook/backend/pas/pas-backend-file.c16
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c21
-rw-r--r--addressbook/backend/pas/pas-book-view.c5
-rw-r--r--addressbook/backend/pas/pas-book-view.h3
4 files changed, 27 insertions, 18 deletions
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index fe14be3f07..542ab47c0b 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -190,7 +190,7 @@ do_summary_query (PASBackendFile *bf,
if (card_count)
pas_book_view_notify_add (view->book_view, cards);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
g_list_foreach (cards, (GFunc)g_free, NULL);
g_list_free (cards);
@@ -377,9 +377,7 @@ pas_backend_file_search (PASBackendFile *bf,
view->card_sexp = pas_backend_card_sexp_new (view->search);
if (!view->card_sexp) {
- /* need a different error message here. */
- pas_book_view_notify_status_message (view->book_view, _("Error in search expression."));
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_InvalidQuery);
return;
}
@@ -436,7 +434,7 @@ pas_backend_file_search (PASBackendFile *bf,
if (card_count)
pas_book_view_notify_add (view->book_view, cards);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
/*
** It's fine to do this now since the data has been handed off.
@@ -561,7 +559,7 @@ pas_backend_file_changes (PASBackendFile *bf,
pas_book_view_notify_remove (view->book_view, id);
}
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
}
/* Update the hash */
@@ -658,7 +656,7 @@ pas_backend_file_process_create_card (PASBackend *backend,
if (vcard_matches_search (view, vcard)) {
bonobo_object_ref (BONOBO_OBJECT (view->book_view));
pas_book_view_notify_add_1 (view->book_view, vcard);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_unref (BONOBO_OBJECT (view->book_view));
}
}
@@ -728,7 +726,7 @@ pas_backend_file_process_remove_card (PASBackend *backend,
if (vcard_matches_search (view, vcard_string)) {
bonobo_object_ref (BONOBO_OBJECT (view->book_view));
pas_book_view_notify_remove (view->book_view, req->id);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_unref (BONOBO_OBJECT (view->book_view));
}
}
@@ -809,7 +807,7 @@ pas_backend_file_process_modify_card (PASBackend *backend,
else /* if (old_match) */
pas_book_view_notify_remove (view->book_view, id);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
index 296bb8797a..2d30ef508c 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -1059,7 +1059,7 @@ create_card_handler (LDAPOp *op, LDAPMessage *res)
pas_book_view_notify_add_1 (view->book_view,
new_vcard);
}
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
g_free (new_vcard);
@@ -1071,7 +1071,7 @@ create_card_handler (LDAPOp *op, LDAPMessage *res)
}
if (op->view)
- pas_book_view_notify_complete (op->view);
+ pas_book_view_notify_complete (op->view, GNOME_Evolution_Addressbook_BookViewListener_Success);
/* and lastly respond */
response = ldap_error_to_response (ldap_error);
@@ -1259,7 +1259,7 @@ remove_card_handler (LDAPOp *op, LDAPMessage *res)
ldap_error_to_response (ldap_error));
if (op->view)
- pas_book_view_notify_complete (op->view);
+ pas_book_view_notify_complete (op->view, GNOME_Evolution_Addressbook_BookViewListener_Success);
}
static void
@@ -1371,7 +1371,7 @@ modify_card_modify_handler (LDAPOp *op, LDAPMessage *res)
pas_book_view_notify_add_1 (view->book_view, modify_op->vcard);
else /* if (old_match) */
pas_book_view_notify_remove (view->book_view, e_card_simple_get_id (modify_op->card));
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
}
@@ -2771,14 +2771,23 @@ ldap_search_handler (LDAPOp *op, LDAPMessage *res)
/* the entry that marks the end of our search */
if (search_op->num_pending_adds)
send_pending_adds (search_op);
- pas_book_view_notify_complete (search_op->op.view);
+
+ if (ldap_error == LDAP_TIMELIMIT_EXCEEDED)
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_SearchTimeLimitExceeded);
+ else if (ldap_error == LDAP_SIZELIMIT_EXCEEDED)
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_SearchSizeLimitExceeded);
+ else if (ldap_error == LDAP_SUCCESS)
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_Success);
+ else
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_OtherError);
+
ldap_op_finished (op);
}
else {
g_warning ("unhandled search result type %d returned", msg_type);
if (search_op->num_pending_adds)
send_pending_adds (search_op);
- pas_book_view_notify_complete (search_op->op.view);
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_OtherError);
ldap_op_finished (op);
}
}
diff --git a/addressbook/backend/pas/pas-book-view.c b/addressbook/backend/pas/pas-book-view.c
index b5266a6b35..27d0f3ae06 100644
--- a/addressbook/backend/pas/pas-book-view.c
+++ b/addressbook/backend/pas/pas-book-view.c
@@ -126,14 +126,15 @@ pas_book_view_notify_add_1 (PASBookView *book_view,
}
void
-pas_book_view_notify_complete (PASBookView *book_view)
+pas_book_view_notify_complete (PASBookView *book_view,
+ GNOME_Evolution_Addressbook_BookViewListener_CallStatus status)
{
CORBA_Environment ev;
CORBA_exception_init (&ev);
GNOME_Evolution_Addressbook_BookViewListener_notifySequenceComplete (
- book_view->priv->listener, &ev);
+ book_view->priv->listener, status, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_warning ("pas_book_view_notify_complete: Exception signaling BookViewListener!\n");
diff --git a/addressbook/backend/pas/pas-book-view.h b/addressbook/backend/pas/pas-book-view.h
index 26bf360f17..712f3c3b96 100644
--- a/addressbook/backend/pas/pas-book-view.h
+++ b/addressbook/backend/pas/pas-book-view.h
@@ -40,7 +40,8 @@ void pas_book_view_notify_add (PASBookView *b
const GList *cards);
void pas_book_view_notify_add_1 (PASBookView *book_view,
const char *card);
-void pas_book_view_notify_complete (PASBookView *book_view);
+void pas_book_view_notify_complete (PASBookView *book_view,
+ GNOME_Evolution_Addressbook_BookViewListener_CallStatus);
void pas_book_view_notify_status_message (PASBookView *book_view,
const char *message);