summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-17 12:39:45 (UTC)
committer zautrix <zautrix>2005-01-17 12:39:45 (UTC)
commitba5e5a22ad492f798b2626026cc1838b731e055b (patch) (unidiff)
treef8bdea9f3a7542371b5be6e5a30ba533889a2075
parent6b166ece0a576e9be9c71a61fab5424d75a9301f (diff)
downloadkdepimpi-ba5e5a22ad492f798b2626026cc1838b731e055b.zip
kdepimpi-ba5e5a22ad492f798b2626026cc1838b731e055b.tar.gz
kdepimpi-ba5e5a22ad492f798b2626026cc1838b731e055b.tar.bz2
more AB fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index aa04631..a480baf 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2797,12 +2797,14 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2797 int addedAddressee = 0; 2797 int addedAddressee = 0;
2798 int addedAddresseeR = 0; 2798 int addedAddresseeR = 0;
2799 int deletedAddresseeR = 0; 2799 int deletedAddresseeR = 0;
2800 int deletedAddresseeL = 0; 2800 int deletedAddresseeL = 0;
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();
2805 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2807 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2806 2808
2807 //QPtrList<Addressee> el = local->rawAddressees(); 2809 //QPtrList<Addressee> el = local->rawAddressees();
2808 Addressee addresseeR; 2810 Addressee addresseeR;
@@ -2986,12 +2988,14 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2986 } else { 2988 } else {
2987 // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); 2989 // pending checkExternSyncAddressee(addresseeRSyncSharp, inR);
2988 remote->removeAddressee( inR ); 2990 remote->removeAddressee( inR );
2989 ++deletedAddresseeR; 2991 ++deletedAddresseeR;
2990 } 2992 }
2991 } 2993 }
2994 } else {
2995 ++filteredIN;
2992 } 2996 }
2993 } 2997 }
2994 } 2998 }
2995 ++incCounter; 2999 ++incCounter;
2996 } 3000 }
2997 er.clear(); 3001 er.clear();
@@ -3009,19 +3013,17 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3009 uid = el[ incCounter ]; 3013 uid = el[ incCounter ];
3010 bool skipIncidence = false; 3014 bool skipIncidence = false;
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 ) { 3017 if ( ! skipIncidence ) {
3014 inL = local->findByUid( uid ); 3018 inL = local->findByUid( uid );
3015 if ( (!filterOUT.name().isEmpty()) && (! filterOUT.filterAddressee( inL ) ) )
3016 skipIncidence = true;
3017 }
3018 if ( !skipIncidence ) {
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 ( filterOUT.name().isEmpty() || filterOUT.filterAddressee( inL ) ) {
3023 // no conflict ********** add or delete local
3022 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3024 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3023 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 3025 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
3024 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 3026 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
3025 local->removeAddressee( inL ); 3027 local->removeAddressee( inL );
3026 ++deletedAddresseeL; 3028 ++deletedAddresseeL;
3027 } else { 3029 } else {
@@ -3051,12 +3053,15 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3051 inR.setIDStr( ":" ); 3053 inR.setIDStr( ":" );
3052 inR.setResource( 0 ); 3054 inR.setResource( 0 );
3053 remote->insertAddressee( inR, false ); 3055 remote->insertAddressee( inR, false );
3054 } 3056 }
3055 } 3057 }
3056 } 3058 }
3059 } else {
3060 ++filteredOUT;
3061 }
3057 } 3062 }
3058 } 3063 }
3059 } 3064 }
3060 ++incCounter; 3065 ++incCounter;
3061 } 3066 }
3062 el.clear(); 3067 el.clear();
@@ -3077,13 +3082,13 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3077 addresseeLSync.setNote( "" ); 3082 addresseeLSync.setNote( "" );
3078 3083
3079 if ( mGlobalSyncMode == SYNC_MODE_NORMAL) 3084 if ( mGlobalSyncMode == SYNC_MODE_NORMAL)
3080 remote->insertAddressee( addresseeRSync, false ); 3085 remote->insertAddressee( addresseeRSync, false );
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;
3086 if ( syncManager->mShowSyncSummary ) { 3091 if ( syncManager->mShowSyncSummary ) {
3087 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 3092 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
3088 i18n("KA/Pi Synchronization"),i18n("Write back"))) { 3093 i18n("KA/Pi Synchronization"),i18n("Write back"))) {
3089 qDebug("cancelled "); 3094 qDebug("cancelled ");