[evolution-patches] Various libebook patches



Hi,

Now that the holidays are nearly over, I'll resent the patches to
evolution I have so far for comments.

1) add video conferencing fields to EContact (econtact-video.diff)

A simple patch adding video conferencing fields to EContact, identical
to the free/busy URL field (the field is a simple string).  I have also
patched the contact editor, but my evolution is crashing at the moment. 
When I can test the UI patch, I will also submit that.

2) Removal of old-style addressbook opening functions

e_book_load_local_addressbook and e_book_get_default_addressbook have
hard-coded paths to the local address books.  At the moment,
get_default_addressbook() even loads the Evo1.4 book.

I think these functions should be removed, and applications should read
the GConf keys and/or use the source selector widgets.  Putting
knowledge of the Evolution gconf keys into libebook is a possible
alternative, but I don't think it's a good one.

3) Update e-book-async to use EBookQuery (async-bookquery.diff)

This patch changes e_book_async_get_contacts() to take the query as a
EBookQuery* instead of a char*, and changes _get_book_view() to do the
same, as well as take arguments for the max. number of records and the
requested fields. These functions now match the e_book_* API, which is
good.

Of course this stops the addressbook module in evolution from compiling
due to the API change...  I've got patches for that but as evolution is
still building, I'll leave those for another mail.

Hopefully I can get these patches into CVS, my contact lookup applet
depends on them now...

Happy new year everyone,
Ross
 
(please cc: me, I do not receive mail from evo-patches)
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Index: addressbook/libebook/e-contact.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-contact.c,v
retrieving revision 1.11
diff -u -r1.11 e-contact.c
--- addressbook/libebook/e-contact.c	29 Dec 2003 21:53:10 -0000	1.11
+++ addressbook/libebook/e-contact.c	1 Jan 2004 14:42:38 -0000
@@ -166,6 +166,7 @@
 	/* Web fields */
 	STRING_FIELD (E_CONTACT_HOMEPAGE_URL, EVC_URL,        "homepage_url", N_("Homepage URL"), FALSE),
 	STRING_FIELD (E_CONTACT_BLOG_URL,     EVC_X_BLOG_URL, "blog_url",     N_("Weblog URL"),   FALSE),
+	STRING_FIELD (E_CONTACT_VIDEO_URL,     EVC_X_VIDEO_URL, "video_url",     N_("Video Conferencing URL"),   FALSE),
 
 	/* Photo/Logo */
 	STRUCT_FIELD    (E_CONTACT_PHOTO, EVC_PHOTO, "photo", N_("Photo"), FALSE, photo_getter, photo_setter, e_contact_photo_get_type),
Index: addressbook/libebook/e-contact.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-contact.h,v
retrieving revision 1.6
diff -u -r1.6 e-contact.h
--- addressbook/libebook/e-contact.h	23 Dec 2003 22:36:53 -0000	1.6
+++ addressbook/libebook/e-contact.h	1 Jan 2004 14:42:38 -0000
@@ -89,6 +89,7 @@
 	E_CONTACT_CALENDAR_URI,  /* string field */
 	E_CONTACT_FREEBUSY_URL,  /* string field */
 	E_CONTACT_ICS_CALENDAR,  /* string field */
+	E_CONTACT_VIDEO_URL,      /* string field */
 
 	/* misc fields */
 	E_CONTACT_SPOUSE,        /* string field */
Index: addressbook/libebook/e-book-async.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-book-async.c,v
retrieving revision 1.4
diff -u -r1.4 e-book-async.c
--- addressbook/libebook/e-book-async.c	17 Dec 2003 19:34:00 -0000	1.4
+++ addressbook/libebook/e-book-async.c	1 Jan 2004 14:51:51 -0000
@@ -970,6 +970,8 @@
 
 	EBook *book;
 	EBookQuery *query;
+	GList *requested_fields;
+	int max_results;
 	EBookBookViewCallback cb;
 	gpointer closure;
 } GetBookViewMsg;
@@ -1015,7 +1017,7 @@
 	e_book_msg_init ((EBookMsg*)response, _get_book_view_response_handler, _get_book_view_response_dtor);
 
 	response->status = E_BOOK_ERROR_OK;
-	if (!e_book_get_book_view (view_msg->book, view_msg->query, NULL, -1, &response->book_view, &error)) {
+	if (!e_book_get_book_view (view_msg->book, view_msg->query, view_msg->requested_fields, view_msg->max_results, &response->book_view, &error)) {
 		response->status = error->code;
 		g_error_free (error);
 	}
@@ -1030,14 +1032,16 @@
 _get_book_view_dtor (EBookMsg *msg)
 {
 	GetBookViewMsg *view_msg = (GetBookViewMsg *)msg;
-	
+	/* TODO: handle requested_fields */
 	e_book_query_unref (view_msg->query);
 	g_free (view_msg);
 }
 
 guint
 e_book_async_get_book_view (EBook                 *book,
-			    const gchar           *query,
+			    EBookQuery            *query,
+			    GList                 *requested_fields,
+			    int                    max_results,
 			    EBookBookViewCallback  cb,
 			    gpointer               closure)
 {
@@ -1049,7 +1053,9 @@
 	e_book_msg_init ((EBookMsg*)msg, _get_book_view_handler, _get_book_view_dtor);
 
 	msg->book = g_object_ref (book);
-	msg->query = e_book_query_from_string (query);
+	msg->query = e_book_query_ref (query);
+	msg->requested_fields = requested_fields; /* TODO: clone? ref? */
+	msg->max_results = max_results;
 	msg->cb = cb;
 	msg->closure = closure;
 
@@ -1130,7 +1136,7 @@
 
 guint
 e_book_async_get_contacts (EBook                 *book,
-			   const gchar           *query,
+			   EBookQuery            *query,
 			   EBookContactsCallback  cb,
 			   gpointer              closure)
 {
@@ -1142,7 +1148,8 @@
 	e_book_msg_init ((EBookMsg*)msg, _get_contacts_handler, _get_contacts_dtor);
 
 	msg->book = g_object_ref (book);
-	msg->query = e_book_query_from_string (query);
+	e_book_query_ref (query);
+	msg->query = query;
 	msg->cb = cb;
 	msg->closure = closure;
 
Index: addressbook/libebook/e-book-async.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-book-async.h,v
retrieving revision 1.2
diff -u -r1.2 e-book-async.h
--- addressbook/libebook/e-book-async.h	1 Dec 2003 06:49:54 -0000	1.2
+++ addressbook/libebook/e-book-async.h	1 Jan 2004 14:51:51 -0000
@@ -71,7 +71,7 @@
 						 gpointer               closure);
 
 guint     e_book_async_get_contacts             (EBook                 *book,
-						 const char            *query,
+						 EBookQuery            *query,
 						 EBookContactsCallback  cb,
 						 gpointer               closure);
 
@@ -103,7 +103,9 @@
 						 gpointer               closure);
 
 guint     e_book_async_get_book_view            (EBook                 *book,
-						 const gchar           *query, /* XXX this needs to change to an EBookQuery */
+						 EBookQuery            *query,
+						 GList                 *requested_fields,
+						 int                    max_results,
 						 EBookBookViewCallback  cb,
 						 gpointer               closure);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]