I am also using OS X 10.3.5 with the latest CVS copy as of today and
cleaned out my bitpim data directory before proceeding. I used your
phonebook index.idx file and the entry showed up with a "Data" phone
number and a email address with type "none" (i.e. blank field). When I
imported the vCard, I did not get 2 emails as you mentioned earlier,
but the email type got updated to match the vCard type of "work"
("business" in bitpim).
I double checked the code to see if this was the right behavior and it
does look ok to me. The default behavior that I decided to use was that
if the field value already exists in bitpim, check to see if the type
is different. If the type is different, update it to the appropriate
one that is being imported. In your example that you provided, there
was no type for the email in the bitpim phonebook, but there was a type
of "work" in the vCard. Therefore the entry in the bitpim phonebook got
updated with the new type.
The following is a snippet of where the code catches the email address
and decides to update the type:
if (comparestrings(resfield, impfield) > threshold):
# an existing entry was matched so we stop
found=True
# since new item matches, we don't need to replace the
# original value, but we should update the type of item
# to reflect the imported value
# for example home --> business
if i.has_key('type'):
r['type'] = i['type']
# break out of original item loop
break
I also tried the reverse and set the bitpim entry to have a type of
"business" and the vCard to have no type. That resulted in no change to
the bitpim entry, since there is a type already present (it doesn't get
overwritten by a blank type).
Let me know what you think. If you have another example, we could try
testing that as well.
Thanks,
Adit
I just created a fresh bitpim phonebook in bitpim, the attached file
index.idx, with one entry, for a 'Tom Hall'. It pretty much matches my
Address Book entry (OS X 10.3.5).
Tom Hall's Address Book entry, exported as a vcard, is also attached as
THall.vcf. It contains a matching telephone number and email address.
If I import this vcf file, the import merge/confirm dialog contains the
one entry for Tom Hall, with one occurrence of the telephone number but
TWO occurrences of the email address.