summaryrefslogtreecommitdiffabout
path: root/kabc
Unidiff
Diffstat (limited to 'kabc') (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressbook.cpp13
-rw-r--r--kabc/addressbook.h2
-rw-r--r--kabc/addressee.cpp0
3 files changed, 13 insertions, 2 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 )
874 removeAddressee( it2 ); 874 removeAddressee( it2 );
875 } else { 875 } else {
876 //qDebug("skipping %s ",(*it).uid().latin1() ); 876 //qDebug("skipping %s ",(*it).uid().latin1() );
877 if ( removeDeleted ) {
878 // we have no postprocessing in the resource, we have to do it here
879 // we have to compute csum for all, because it could be the first sync
880 (*it).setTempSyncStat( SYNC_TEMPSTATE_NEW_CSUM );
881
882
883 }
877 ++it; 884 ++it;
878 } 885 }
879 } 886 }
@@ -917,7 +924,7 @@ void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool i
917 } 924 }
918 mergeAB( aBook ,csd, isSubset ); 925 mergeAB( aBook ,csd, isSubset );
919} 926}
920void AddressBook::postExternSync( AddressBook* aBook , const QString& csd) 927void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID)
921{ 928{
922 //qDebug("AddressBook::postExternSync "); 929 //qDebug("AddressBook::postExternSync ");
923 AddressBook::Iterator it; 930 AddressBook::Iterator it;
@@ -929,9 +936,13 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd)
929 if ( ad.isEmpty() ) { 936 if ( ad.isEmpty() ) {
930 qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1()); 937 qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1());
931 } else { 938 } else {
939 (*it).setIDStr(":");
932 (*it).computeCsum( csd ); 940 (*it).computeCsum( csd );
941 if ( setID ) {
933 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) 942 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID )
934 ad.setID( csd, (*it).externalUID() ); 943 ad.setID( csd, (*it).externalUID() );
944 } else
945 ad.setID( csd, "_" );
935 ad.setCsum( csd, (*it).getCsum( csd ) ); 946 ad.setCsum( csd, (*it).getCsum( csd ) );
936 aBook->insertAddressee( ad ); 947 aBook->insertAddressee( ad );
937 } 948 }
diff --git a/kabc/addressbook.h b/kabc/addressbook.h
index f124dc9..75f8b51 100644
--- a/kabc/addressbook.h
+++ b/kabc/addressbook.h
@@ -307,7 +307,7 @@ class AddressBook : public QObject
307 bool containsExternalUid( const QString& uid ); 307 bool containsExternalUid( const QString& uid );
308 308
309 void preExternSync( AddressBook* aBook, const QString& csd, bool isSubset ); 309 void preExternSync( AddressBook* aBook, const QString& csd, bool isSubset );
310 void postExternSync( AddressBook* aBook, const QString& csd ); 310 void postExternSync( AddressBook* aBook, const QString& csd , bool setID );
311 signals: 311 signals:
312 /** 312 /**
313 Emitted, when the address book has changed on disk. 313 Emitted, when the address book has changed on disk.
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index a660a9d..d5a110a 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp