On Wed, 2005-11-02 at 10:47 +0100, Sergio CERLESI wrote:
> Hi,
> 
> sorry for the waiting time but i'm offline in these days.

Hi!

No problem, I don't always respond so quick myself... :-)

> I wrote two patches that both fixes this bug without changing
> contact_ids.h.
> 
> The first is more simple but needs to do a search of the right position
> of the fields at any call of add_date/add_string
> 
> #define number_ids(c,id)   for (c=0; value_ids[c] != id && c < MAX_ID; c
> ++);
> 
> The changes into the second patch are more numerous but avoid to do the
> search.

OK.

> There is another bug fixed from these patchs, if rra_contact_from_vcard
> tries to parse a vcard with two or more fields of the same type (for
> example four mobile phones) it creates an object with four entries and
> the contact on my ipaq contain the last value and some dirty fields.
> With these patches it considers only the first value of any type:
> 
> if (propval->propid & CEVT_FLAG_EMPTY)
> {
>       ...
> }

Good catch!

> I'm waiting to know if there is something to change into these patch.

I haven't followed yours and Nabil Sayegh's followups on this 100% but
as long as you agree about that the purpose and solution is good, I'll
comment the code... :-)

I think I like synce-rra-0.9.1-vcard-empty-fields.2.diff better, but
these are some things that I think would make your patch a little
better. Please note that I really enjoy getting your patches so this is
just nitpicking!

o Don't #define MAX_ID in contact_ids.h. Instead put MAX_ID last in the
field_ids enum and it will get the right value. (I would probably have
used the name ID_COUNT instead of MAX_ID, field_index instead of
field_ids and field_id instead of value_ids, but that's not so
important.)

o Change the name_ids array and the id parameter to add_date and
add_string to be of the enum type (field_ids in your patch). Rename the
id parameter to "index" or something, because it is not an id as in ID_*
anymore.

o I use 2 spaces instead of tab characters for SynCE nowadays, but I
know it is not consistent throughout SynCE


-- 
Regards,
               -\- David Eriksson -/-

        SynCE - http://synce.sourceforge.net
      ScummVM - http://scummvm.sourceforge.net
     Desquirr - http://desquirr.sourceforge.net



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Synce-devel mailing list
Synce-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel

Reply via email to