-rw-r--r-- | kabc/addressbook.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 9b196b5..5774c36 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -874,6 +874,13 @@ void AddressBook::removeSyncAddressees( bool removeDeleted ) removeAddressee( it2 ); } else { //qDebug("skipping %s ",(*it).uid().latin1() ); + if ( removeDeleted ) { + // we have no postprocessing in the resource, we have to do it here + // we have to compute csum for all, because it could be the first sync + (*it).setTempSyncStat( SYNC_TEMPSTATE_NEW_CSUM ); + + + } ++it; } } @@ -917,7 +924,7 @@ void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool i } mergeAB( aBook ,csd, isSubset ); } -void AddressBook::postExternSync( AddressBook* aBook , const QString& csd) +void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID) { //qDebug("AddressBook::postExternSync "); AddressBook::Iterator it; @@ -929,9 +936,13 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd) if ( ad.isEmpty() ) { qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1()); } else { + (*it).setIDStr(":"); (*it).computeCsum( csd ); + if ( setID ) { if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) ad.setID( csd, (*it).externalUID() ); + } else + ad.setID( csd, "_" ); ad.setCsum( csd, (*it).getCsum( csd ) ); aBook->insertAddressee( ad ); } |