summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-01-17 12:39:45 (UTC)
committer zautrix <zautrix>2005-01-17 12:39:45 (UTC)
commitba5e5a22ad492f798b2626026cc1838b731e055b (patch) (unidiff)
treef8bdea9f3a7542371b5be6e5a30ba533889a2075 /kaddressbook
parent6b166ece0a576e9be9c71a61fab5424d75a9301f (diff)
downloadkdepimpi-ba5e5a22ad492f798b2626026cc1838b731e055b.zip
kdepimpi-ba5e5a22ad492f798b2626026cc1838b731e055b.tar.gz
kdepimpi-ba5e5a22ad492f798b2626026cc1838b731e055b.tar.bz2
more AB fixes
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp79
1 files changed, 42 insertions, 37 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index aa04631..a480baf 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2801,4 +2801,6 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2801 int changedLocal = 0; 2801 int changedLocal = 0;
2802 int changedRemote = 0; 2802 int changedRemote = 0;
2803 int filteredIN = 0;
2804 int filteredOUT = 0;
2803 2805
2804 QString mCurrentSyncName = syncManager->getCurrentSyncName(); 2806 QString mCurrentSyncName = syncManager->getCurrentSyncName();
@@ -2990,4 +2992,6 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2990 } 2992 }
2991 } 2993 }
2994 } else {
2995 ++filteredIN;
2992 } 2996 }
2993 } 2997 }
@@ -3011,47 +3015,48 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3011 if ( uid.left(19) == QString("last-syncAddressee-") ) 3015 if ( uid.left(19) == QString("last-syncAddressee-") )
3012 skipIncidence = true; 3016 skipIncidence = true;
3013 if ( ! skipIncidence ) {
3014 inL = local->findByUid( uid );
3015 if ( (!filterOUT.name().isEmpty()) && (! filterOUT.filterAddressee( inL ) ) )
3016 skipIncidence = true;
3017 }
3018 if ( !skipIncidence ) { 3017 if ( !skipIncidence ) {
3018 inL = local->findByUid( uid );
3019 if ( !inL.resource() || inL.resource()->includeInSync() ) { 3019 if ( !inL.resource() || inL.resource()->includeInSync() ) {
3020 inR = remote->findByUid( uid ); 3020 inR = remote->findByUid( uid );
3021 if ( inR.isEmpty() ) { // no conflict ********** add or delete local 3021 if ( inR.isEmpty() ){
3022 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3022 if ( filterOUT.name().isEmpty() || filterOUT.filterAddressee( inL ) ) {
3023 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 3023 // no conflict ********** add or delete local
3024 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 3024 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3025 local->removeAddressee( inL ); 3025 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
3026 ++deletedAddresseeL; 3026 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
3027 } else { 3027 local->removeAddressee( inL );
3028 if ( ! syncManager->mWriteBackExistingOnly ) { 3028 ++deletedAddresseeL;
3029 inL.removeID(mCurrentSyncDevice ); 3029 } else {
3030 ++addedAddresseeR; 3030 if ( ! syncManager->mWriteBackExistingOnly ) {
3031 inL.setRevision( modifiedCalendar ); 3031 inL.removeID(mCurrentSyncDevice );
3032 local->insertAddressee( inL, false ); 3032 ++addedAddresseeR;
3033 inR = inL; 3033 inL.setRevision( modifiedCalendar );
3034 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); 3034 local->insertAddressee( inL, false );
3035 inR.setResource( 0 ); 3035 inR = inL;
3036 remote->insertAddressee( inR, false ); 3036 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL );
3037 inR.setResource( 0 );
3038 remote->insertAddressee( inR, false );
3039 }
3037 } 3040 }
3038 }
3039 } else {
3040 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) {
3041 //qDebug("data %s ", inL.revision().toString().latin1());
3042 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
3043 local->removeAddressee( inL );
3044 ++deletedAddresseeL;
3045 } else { 3041 } else {
3046 if ( ! syncManager->mWriteBackExistingOnly ) { 3042 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) {
3047 ++addedAddresseeR; 3043 //qDebug("data %s ", inL.revision().toString().latin1());
3048 inL.setRevision( modifiedCalendar ); 3044 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
3049 local->insertAddressee( inL, false ); 3045 local->removeAddressee( inL );
3050 inR = inL; 3046 ++deletedAddresseeL;
3051 inR.setIDStr( ":" ); 3047 } else {
3052 inR.setResource( 0 ); 3048 if ( ! syncManager->mWriteBackExistingOnly ) {
3053 remote->insertAddressee( inR, false ); 3049 ++addedAddresseeR;
3050 inL.setRevision( modifiedCalendar );
3051 local->insertAddressee( inL, false );
3052 inR = inL;
3053 inR.setIDStr( ":" );
3054 inR.setResource( 0 );
3055 remote->insertAddressee( inR, false );
3056 }
3054 } 3057 }
3055 } 3058 }
3059 } else {
3060 ++filteredOUT;
3056 } 3061 }
3057 } 3062 }
@@ -3081,5 +3086,5 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3081 local->insertAddressee( addresseeLSync, false ); 3086 local->insertAddressee( addresseeLSync, false );
3082 QString mes; 3087 QString mes;
3083 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); 3088 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT );
3084 qDebug( mes ); 3089 qDebug( mes );
3085 mes = i18n("Local addressbook changed!\n") +mes; 3090 mes = i18n("Local addressbook changed!\n") +mes;