summaryrefslogtreecommitdiffabout
path: root/kabc/addressbook.cpp
Unidiff
Diffstat (limited to 'kabc/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index f9e4387..fe59fcb 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -943,12 +943,29 @@ void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool i
943 for ( it = begin(); it != end(); ++it ) { 943 for ( it = begin(); it != end(); ++it ) {
944 (*it).setID( csd, (*it).externalUID() ); 944 (*it).setID( csd, (*it).externalUID() );
945 (*it).computeCsum( csd ); 945 (*it).computeCsum( csd );
946 } 946 }
947 mergeAB( aBook ,csd, isSubset ); 947 mergeAB( aBook ,csd, isSubset );
948} 948}
949void AddressBook::preOLSync( AddressBook* aBook, const QString& csd )
950{
951 //qDebug("AddressBook::preExternSync ");
952 AddressBook::Iterator it;
953 for ( it = begin(); it != end(); ++it ) {
954 (*it).setID( csd, (*it).externalUID() );
955 (*it).computeCsum( csd );
956 }
957
958 Addressee ad;
959 for ( it = begin(); it != end(); ++it ) {
960 ad = aBook->findByExternUid( (*it).externalUID(), csd );
961 if ( !ad.isEmpty() ) {
962 (*it).mergeOLContact( ad );
963 }
964 }
965}
949void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID) 966void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID)
950{ 967{
951 //qDebug("AddressBook::postExternSync "); 968 //qDebug("AddressBook::postExternSync ");
952 AddressBook::Iterator it; 969 AddressBook::Iterator it;
953 int foundEmpty = 0; 970 int foundEmpty = 0;
954 for ( it = begin(); it != end(); ++it ) { 971 for ( it = begin(); it != end(); ++it ) {
@@ -961,14 +978,15 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool
961 ++foundEmpty; 978 ++foundEmpty;
962 //qDebug("postExternSync:addressee is empty: %s ", (*it).uid().latin1()); 979 //qDebug("postExternSync:addressee is empty: %s ", (*it).uid().latin1());
963 //qDebug("-- formatted name %s ",(*it).formattedName().latin1() ); 980 //qDebug("-- formatted name %s ",(*it).formattedName().latin1() );
964 } else { 981 } else {
965 (*it).setIDStr(":"); 982 (*it).setIDStr(":");
966 if ( setID ) { 983 if ( setID ) {
967 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) 984 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID )
968 ad.setID( csd, (*it).externalUID() ); 985 ad.setID( csd, (*it).externalUID() );{
986 }
969 } else 987 } else
970 ad.setID( csd, (*it).uid() ); 988 ad.setID( csd, (*it).uid() );
971 (*it).computeCsum( csd ); 989 (*it).computeCsum( csd );
972 ad.setCsum( csd, (*it).getCsum( csd ) ); 990 ad.setCsum( csd, (*it).getCsum( csd ) );
973 //qDebug("CSUM %s ",(*it).getCsum( csd ).latin1() ); 991 //qDebug("CSUM %s ",(*it).getCsum( csd ).latin1() );
974 aBook->insertAddressee( ad , false); 992 aBook->insertAddressee( ad , false);