-rw-r--r-- | kabc/addressbook.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index f9e4387..fe59fcb 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -945,8 +945,25 @@ void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool i (*it).computeCsum( csd ); } mergeAB( aBook ,csd, isSubset ); } +void AddressBook::preOLSync( AddressBook* aBook, const QString& csd ) +{ + //qDebug("AddressBook::preExternSync "); + AddressBook::Iterator it; + for ( it = begin(); it != end(); ++it ) { + (*it).setID( csd, (*it).externalUID() ); + (*it).computeCsum( csd ); + } + + Addressee ad; + for ( it = begin(); it != end(); ++it ) { + ad = aBook->findByExternUid( (*it).externalUID(), csd ); + if ( !ad.isEmpty() ) { + (*it).mergeOLContact( ad ); + } + } +} void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID) { //qDebug("AddressBook::postExternSync "); AddressBook::Iterator it; @@ -964,9 +981,10 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool } else { (*it).setIDStr(":"); if ( setID ) { if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) - ad.setID( csd, (*it).externalUID() ); + ad.setID( csd, (*it).externalUID() );{ + } } else ad.setID( csd, (*it).uid() ); (*it).computeCsum( csd ); ad.setCsum( csd, (*it).getCsum( csd ) ); |