From: <luc...@us...> - 2003-07-13 08:53:22
|
Update of /cvsroot/zxsync/zXSync/plugins/osx In directory sc8-pr-cvs1:/tmp/cvs-serv28147 Modified Files: contacts.py Log Message: - Removed UID field from vCards (the id is still available via getId(), but not as a field). This avoids a lot of trouble when the ids of a plugin are not worth much (as is currently the case with iPod and Zaurus contacts ;-)) - Set the sync mode of FN to SYNC_TO by default (FN is generated on the Mac, and there's no point in letting this conflict with other devices) - If a field is not supported, reject the change (FN is an example for that) Index: contacts.py =================================================================== RCS file: /cvsroot/zxsync/zXSync/plugins/osx/contacts.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** contacts.py 23 Jun 2003 21:23:26 -0000 1.5 --- contacts.py 13 Jul 2003 08:53:18 -0000 1.6 *************** *** 32,36 **** supportedFields = \ [X_PREF, ! vcard.UID, vcard.N, vcard.NICKNAME, vcard.BDAY, vcard.ADR, vcard.TEL, vcard.EMAIL, vcard.NOTE, vcard.ORG, vcard.TITLE, vcard.URL, vcard.X_AIM, vcard.X_ICQ, vcard.X_JABBER, vcard.X_MSN, vcard.X_YAHOO --- 32,36 ---- supportedFields = \ [X_PREF, ! vcard.N, vcard.NICKNAME, vcard.BDAY, vcard.ADR, vcard.TEL, vcard.EMAIL, vcard.NOTE, vcard.ORG, vcard.TITLE, vcard.URL, vcard.X_AIM, vcard.X_ICQ, vcard.X_JABBER, vcard.X_MSN, vcard.X_YAHOO *************** *** 88,91 **** --- 88,96 ---- person.valueForProperty(addressbook.kABSuffixProperty) ) + # special handling: since FN is just generated, set the field to + # SYNC_TO to avoid conflicts + fnField = personVCard.getChildWithId(vcard.FN) + if fnField != None: + fnField.setSyncMode(zxsync.syncbase.SYNC_TO) # NICKNAME field *************** *** 591,594 **** --- 596,610 ---- return 1 + return 1 + + + def notifyChangeField(newField, oldField): + """ + Called to notify the plugin when a field is about to be changed in + zXSync's internal pool of data for this application. + """ + fieldId = newField.getId() + if not (fieldId in supportedFields): + return 0 return 1 |