-rw-r--r-- | kabc/addressbook.cpp | 19 | ||||
-rw-r--r-- | kabc/addressbook.h | 2 | ||||
-rw-r--r-- | kabc/addressee.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 16 |
4 files changed, 26 insertions, 13 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 9b196b5..5774c36 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -876,2 +876,9 @@ void AddressBook::removeSyncAddressees( bool removeDeleted ) | |||
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; |
@@ -919,3 +926,3 @@ void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool i | |||
919 | } | 926 | } |
920 | void AddressBook::postExternSync( AddressBook* aBook , const QString& csd) | 927 | void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID) |
921 | { | 928 | { |
@@ -924,3 +931,3 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd) | |||
924 | for ( it = begin(); it != end(); ++it ) { | 931 | for ( it = begin(); it != end(); ++it ) { |
925 | // qDebug("check uid %s ", (*it).uid().latin1() ); | 932 | //qDebug("check uid %s ", (*it).uid().latin1() ); |
926 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || | 933 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || |
@@ -931,5 +938,9 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd) | |||
931 | } else { | 938 | } else { |
939 | (*it).setIDStr(":"); | ||
932 | (*it).computeCsum( csd ); | 940 | (*it).computeCsum( csd ); |
933 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) | 941 | if ( setID ) { |
934 | ad.setID( csd, (*it).externalUID() ); | 942 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) |
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 ) ); |
diff --git a/kabc/addressbook.h b/kabc/addressbook.h index f124dc9..75f8b51 100644 --- a/kabc/addressbook.h +++ b/kabc/addressbook.h | |||
@@ -309,3 +309,3 @@ class AddressBook : public QObject | |||
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: |
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index a660a9d..d5a110a 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -268,3 +268,3 @@ void Addressee::computeCsum(const QString &dev) | |||
268 | uint cs = getCsum4List(l); | 268 | uint cs = getCsum4List(l); |
269 | // qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); | 269 | //qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); |
270 | setCsum( dev, QString::number (cs )); | 270 | setCsum( dev, QString::number (cs )); |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index ea87929..b0cb986 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2515,3 +2515,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2515 | if ( syncManager->syncWithDesktop() ) { | 2515 | if ( syncManager->syncWithDesktop() ) { |
2516 | remote->removeSyncInfo( QString());//remove all info | 2516 | // remote->removeSyncInfo( QString());//remove all info |
2517 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { | 2517 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { |
@@ -2520,3 +2520,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2520 | } else { | 2520 | } else { |
2521 | qDebug("ERROR: KSyncManager::mRequestedSyncEvent has invalid datatime "); | 2521 | qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); |
2522 | } | 2522 | } |
@@ -2622,3 +2622,4 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2622 | if ( syncManager->syncWithDesktop() ) | 2622 | if ( syncManager->syncWithDesktop() ) |
2623 | inR.setIDStr( "changed" ); | 2623 | inR.setIDStr("changed" ); |
2624 | //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); | ||
2624 | } else { | 2625 | } else { |
@@ -2814,5 +2815,5 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
2814 | qDebug("Error writing back AB to file "); | 2815 | qDebug("Error writing back AB to file "); |
2815 | if ( isXML ) { | 2816 | if ( external ) { |
2816 | // afterwrite processing | 2817 | // afterwrite processing |
2817 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | 2818 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); |
2818 | } | 2819 | } |
@@ -2832,2 +2833,3 @@ void KABCore::removeSyncInfo( QString syncProfile) | |||
2832 | mAddressBook->removeSyncInfo( syncProfile ); | 2833 | mAddressBook->removeSyncInfo( syncProfile ); |
2834 | setModified(); | ||
2833 | } | 2835 | } |
@@ -2854,3 +2856,3 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) | |||
2854 | abLocal.saveAB(); | 2856 | abLocal.saveAB(); |
2855 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | 2857 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
2856 | } | 2858 | } |
@@ -2893,3 +2895,3 @@ bool KABCore::syncPhone() | |||
2893 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); | 2895 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); |
2894 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | 2896 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
2895 | } | 2897 | } |