aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook/e-book.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-02-21 17:19:15 +0800
committerChris Toshok <toshok@src.gnome.org>2001-02-21 17:19:15 +0800
commit65438eb13d8d8f82f4a9fde03ed538809fe9be1b (patch)
treeebf004f01aa2e877b9d3813da946fc8ca44d21d3 /addressbook/backend/ebook/e-book.c
parent2f099e392d0dfae27282b5d87aa3c5d2acea22de (diff)
downloadgsoc2013-evolution-65438eb13d8d8f82f4a9fde03ed538809fe9be1b.tar
gsoc2013-evolution-65438eb13d8d8f82f4a9fde03ed538809fe9be1b.tar.gz
gsoc2013-evolution-65438eb13d8d8f82f4a9fde03ed538809fe9be1b.tar.bz2
gsoc2013-evolution-65438eb13d8d8f82f4a9fde03ed538809fe9be1b.tar.lz
gsoc2013-evolution-65438eb13d8d8f82f4a9fde03ed538809fe9be1b.tar.xz
gsoc2013-evolution-65438eb13d8d8f82f4a9fde03ed538809fe9be1b.tar.zst
gsoc2013-evolution-65438eb13d8d8f82f4a9fde03ed538809fe9be1b.zip
new function. (impl_GNOME_Evolution_Addressbook_Book_getSupportedFields):
2001-02-21 Chris Toshok <toshok@ximian.com> * backend/pas/pas-book.c (pas_book_queue_get_supported_fields): new function. (impl_GNOME_Evolution_Addressbook_Book_getSupportedFields): track change to idl. (pas_book_respond_get_supported_fields): new function. * backend/pas/pas-book.h: add GetSupportedFields to the PASOperation enum. Also, add a stringlist field to the PASRequest struct. lastly, add a prototype for pas_book_respond_get_supported_fields. * backend/pas/pas-backend.h: remove prototype for pas_backend_get_supported_fields, and remove it from the vtable. * backend/pas/pas-backend.c (pas_backend_get_supported_fields): remove. (pas_backend_class_init): no vtable entry for get_supported_fields anymore. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_process_get_supported_fields): new function. (pas_backend_ldap_process_client_requests): add case for GetSupportedFields. (pas_backend_ldap_class_init): get_supported_fields isn't in vtable anymore. * backend/pas/pas-backend-file.c (pas_backend_file_process_get_supported_fields): new function. (pas_backend_file_process_client_requests): add case for GetSupportedFields. (pas_backend_file_class_init): get_supported_fields isn't in vtable anymore. * backend/idl/addressbook.idl: Book::getSupportedFields now returns void and add BookListener::notifySupportedFields. * backend/ebook/test-client.c (get_fields_cb): new function. (auth_user_cb): track change to e_book_get_supported_fields. * backend/ebook/e-book.c (e_book_do_response_get_supported_fields): new function. (e_book_check_listener_queue): add case GetSupportedFieldsResponse. (e_book_get_supported_fields): switch to async model. * backend/ebook/e-book.h: switch e_book_get_supported_fields to an async model. * backend/ebook/e-book-listener.c (e_book_listener_queue_get_supported_fields_response): new function. (impl_BookListener_response_get_supported_fields): new function. (e_book_listener_get_epv): fill in epv's "notifySupportedFields" * backend/ebook/e-book-listener.h: add an async response for GetSupportedFields and add a stringlist member to the EBookListenerResponse struct. svn path=/trunk/; revision=8316
Diffstat (limited to 'addressbook/backend/ebook/e-book.c')
-rw-r--r--addressbook/backend/ebook/e-book.c56
1 files changed, 39 insertions, 17 deletions
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
index 873aa77805..1471d67f4c 100644
--- a/addressbook/backend/ebook/e-book.c
+++ b/addressbook/backend/ebook/e-book.c
@@ -331,6 +331,32 @@ e_book_do_link_event (EBook *book,
resp->connected);
}
+static void
+e_book_do_response_get_supported_fields (EBook *book,
+ EBookListenerResponse *resp)
+{
+ EBookOp *op;
+ EList *list;
+ int i;
+
+ op = e_book_pop_op (book);
+
+ if (op == NULL) {
+ g_warning ("e_book_do_response_get_supported_fields: Cannot find operation "
+ "in local op queue!\n");
+ return;
+ }
+
+ list = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL);
+
+ for (i = 0; i < resp->fields->_length; i ++) {
+ e_list_append (list, g_strdup (resp->fields->_buffer[i]));
+ }
+
+ if (op->cb)
+ ((EBookFieldsCallback) op->cb) (book, resp->status, list, op->closure);
+ g_free (op);
+}
/*
* Reading notices out of the EBookListener's queue.
@@ -366,6 +392,9 @@ e_book_check_listener_queue (EBookListener *listener, EBook *book)
case OpenBookResponse:
e_book_do_response_open (book, resp);
break;
+ case GetSupportedFieldsResponse:
+ e_book_do_response_get_supported_fields (book, resp);
+ break;
case OpenProgressEvent:
e_book_do_progress_event (book, resp);
@@ -522,41 +551,34 @@ e_book_get_static_capabilities (EBook *book)
return ret_val;
}
-EList *
-e_book_get_supported_fields (EBook *book)
+gboolean
+e_book_get_supported_fields (EBook *book,
+ EBookFieldsCallback cb,
+ gpointer closure)
{
CORBA_Environment ev;
- GNOME_Evolution_Addressbook_stringlist *stringlist;
- EList *list;
- int i;
CORBA_exception_init (&ev);
if (book->priv->load_state != URILoaded) {
g_warning ("e_book_unload_uri: No URI is loaded!\n");
- return NULL;
+ return FALSE;
}
- stringlist = GNOME_Evolution_Addressbook_Book_getSupportedFields(book->priv->corba_book, &ev);
+ GNOME_Evolution_Addressbook_Book_getSupportedFields(book->priv->corba_book, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_warning ("e_book_get_supported_fields: Exception "
"during get_supported_fields!\n");
CORBA_exception_free (&ev);
- return NULL;
- }
-
- list = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL);
-
- for (i = 0; i < stringlist->_length; i ++) {
- e_list_append (list, g_strdup (stringlist->_buffer[i]));
+ return FALSE;
}
- CORBA_free (stringlist);
-
CORBA_exception_free (&ev);
- return list;
+ e_book_queue_op (book, cb, closure, NULL);
+
+ return TRUE;
}
static gboolean