[Evolution-hackers] [libebook] unknown field name warnings



Hi,

I'm currently working on the QtContacts backend for EDS in MeeGo. While testing the backend, I noticed warnings such as:

(process:30563): libebook-WARNING **: unknown field name `X-GENDER'
(process:30563): libebook-WARNING **: unknown field name `X-EDS-QTCONTACTS-FAVORITE'

I realized than those are caused by queries on custom EContact vcard fields. Those queries work fine though because e-book-query::func_*() test the return value of e_contact_field_id() and call e_book_query_vcard_field_test() instead of e_book_query_field_test() whenever the return value is 0 (unknown EContact field).

The warning is misleading because it makes developer think that he is doing something wrong (but as far as I know, this is the correct way to query custom fields). As a consequence, I believe that this warning should be removed (see patch attached).

Alternatively, a additional function could be added to test the existence of an EContact field, and then e-book-query::func_*() should be fixed to use this new function to check that this is a known field because calling e_contact_field_id().

Could something please comment on this?

Kr,

--
Dr. Christophe Dumez
Linux Software Engineer
Intel Finland Oy - Open Source Technology Center

>From 204d7b742312c8d1e89e56657522ac49bc93ce72 Mon Sep 17 00:00:00 2001
From: Christophe Dumez <christophe dumez intel com>
Date: Mon, 23 May 2011 15:27:29 +0300
Subject: [PATCH] e_contact_field_id: Remove unknown field warning

EBookQuery supports queries based on custom contact
fields by calling e_contact_field_id() and handling
differently the case where the function returns 0.
The warnings are therefore confusing because the
queries on those "unknown" fields do work.

Calls to e_contact_field_id() are required because
there is no function to check if a field is known.
---
 addressbook/libebook/e-contact.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/addressbook/libebook/e-contact.c b/addressbook/libebook/e-contact.c
index 9875103..033694f 100644
--- a/addressbook/libebook/e-contact.c
+++ b/addressbook/libebook/e-contact.c
@@ -1355,7 +1355,6 @@ e_contact_field_id (const gchar *field_name)
 			return field_info[i].field_id;
 	}
 
-	g_warning ("unknown field name `%s'", field_name);
 	return 0;
 }
 
-- 
1.7.4.4



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