GNOME Bugzilla – Bug 650952
[libebook] unknown field name warnings
Last modified: 2011-05-27 13:34:46 UTC
Created attachment 188448 [details] [review] Proposed patch 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?
Could I have any feedback on this please? Is this simple patch acceptable or should I write another patch for: - Adding a function to test if an EContact field exist - Use this function in e-book-query::func_*() to check for existence because calling e_contact_field_id()
I would like to have something between. What about claiming about unknown field only if it doesn't begin with "X-"? It may cover all above mentioned with minimal effort.
How about not calling e_contact_field_id() at all when the property name starts with "X-" and directly call e_book_query_vcard_field_test() in that case? I believe this is somewhat cleaner.
After our chat on IRC, never mind, your change is fine, let's remove the runtime warning.
Would it be possible to get these patches in gnome-2-32 also? This is what is still use in MeeGo.
Created commit f700cef in eds master (3.1.2+)