After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 650952 - [libebook] unknown field name warnings
[libebook] unknown field name warnings
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
2.32.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2011-05-24 10:43 UTC by Christophe Dumez
Modified: 2011-05-27 13:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (1.04 KB, patch)
2011-05-24 10:43 UTC, Christophe Dumez
committed Details | Review

Description Christophe Dumez 2011-05-24 10:43:05 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?
Comment 1 Christophe Dumez 2011-05-26 08:06:46 UTC
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()
Comment 2 Milan Crha 2011-05-26 10:04:43 UTC
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.
Comment 3 Christophe Dumez 2011-05-26 11:08:42 UTC
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.
Comment 4 Milan Crha 2011-05-26 11:42:12 UTC
After our chat on IRC, never mind, your change is fine, let's remove the runtime warning.
Comment 5 Christophe Dumez 2011-05-26 13:17:48 UTC
Would it be possible to get these patches in gnome-2-32 also? This is what is
still use in MeeGo.
Comment 6 Milan Crha 2011-05-27 13:34:35 UTC
Created commit f700cef in eds master (3.1.2+)