From: Stewart H. <she...@us...> - 2005-03-17 00:01:54
|
Update of /cvsroot/multisync/multisync/plugins/kdepim_plugin/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29488 Modified Files: Tag: branch_08X kaddrbook.cpp Log Message: Changes the plugin so that custom KDE Addressbook vcard fields are not deleted by the sync engine when the other plugin does not support them. Index: kaddrbook.cpp =================================================================== RCS file: /cvsroot/multisync/multisync/plugins/kdepim_plugin/src/Attic/kaddrbook.cpp,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -d -r1.1.2.8 -r1.1.2.9 --- kaddrbook.cpp 5 Mar 2005 05:00:53 -0000 1.1.2.8 +++ kaddrbook.cpp 17 Mar 2005 00:01:35 -0000 1.1.2.9 @@ -363,6 +363,20 @@ //other device, we need to set the KDE UID as supplied by the sync engine. addressee.setUid(QString(obj->uid)); + //Other plugins are unlikely to support the KDE addressbook non-standard vcard + //fields (X-KADDRESSBOOK-*) and so we must merge those fields from our current + //copy back into back into the incoming vcard. + KABC::Addressee addressee_old = addressbookptr->findByUid(QString(obj->uid)); + if (!addressee_old.isEmpty()) + { + QStringList customs = addressee_old.customs(); + addressee.setCustoms(customs); + + if (multisync_debug) + for (QStringList::Iterator it=customs.begin(); it!=customs.end(); ++it) + cout << "kdepim_plugin: retaining" << *it << "\n"; + } + // replace the current entry in the KDE addressbook with this one addressbookptr->insertAddressee(addressee); |