author | zautrix <zautrix> | 2004-10-28 11:37:28 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-28 11:37:28 (UTC) |
commit | af21c3d45173ece8492850b8c2c5019e7c25d59c (patch) (unidiff) | |
tree | 52e60b226372bbe37987df07495b02de321410fe /kaddressbook | |
parent | 01cd4ef94b8604532181c390e9abd560aebaf372 (diff) | |
download | kdepimpi-af21c3d45173ece8492850b8c2c5019e7c25d59c.zip kdepimpi-af21c3d45173ece8492850b8c2c5019e7c25d59c.tar.gz kdepimpi-af21c3d45173ece8492850b8c2c5019e7c25d59c.tar.bz2 |
dtm sync fixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index bdc5bd8..c75b4bc 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2636,7 +2636,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2636 | //qDebug("take %d %s ", take, inL.summary().latin1()); | 2636 | //qDebug("take %d %s ", take, inL.summary().latin1()); |
2637 | if ( take == 3 ) | 2637 | if ( take == 3 ) |
2638 | return false; | 2638 | return false; |
2639 | if ( take == 1 ) {// take local | 2639 | if ( take == 1 ) {// take local ********************** |
2640 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2640 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2641 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | 2641 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); |
2642 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | 2642 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); |
@@ -2661,7 +2661,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2661 | inR.setResource( 0 ); | 2661 | inR.setResource( 0 ); |
2662 | remote->insertAddressee( inR , false); | 2662 | remote->insertAddressee( inR , false); |
2663 | ++changedRemote; | 2663 | ++changedRemote; |
2664 | } else { // take == 2 take remote | 2664 | } else { // take == 2 take remote ********************** |
2665 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2665 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2666 | if ( inR.revision().date().year() < 2004 ) | 2666 | if ( inR.revision().date().year() < 2004 ) |
2667 | inR.setRevision( modifiedCalendar ); | 2667 | inR.setRevision( modifiedCalendar ); |
@@ -2680,7 +2680,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2680 | } | 2680 | } |
2681 | } | 2681 | } |
2682 | } | 2682 | } |
2683 | } else { // no conflict | 2683 | } else { // no conflict ********** add or delete remote |
2684 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2684 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2685 | QString des = addresseeLSync.note(); | 2685 | QString des = addresseeLSync.note(); |
2686 | if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it | 2686 | if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it |
@@ -2691,6 +2691,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2691 | inR.setRevision( modifiedCalendar ); | 2691 | inR.setRevision( modifiedCalendar ); |
2692 | remote->insertAddressee( inR, false ); | 2692 | remote->insertAddressee( inR, false ); |
2693 | inL = inR; | 2693 | inL = inR; |
2694 | inL.setIDStr( ":" ); | ||
2695 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | ||
2696 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | ||
2694 | inL.setResource( 0 ); | 2697 | inL.setResource( 0 ); |
2695 | local->insertAddressee( inL , false); | 2698 | local->insertAddressee( inL , false); |
2696 | ++addedAddressee; | 2699 | ++addedAddressee; |
@@ -2732,7 +2735,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2732 | inL = local->findByUid( uid ); | 2735 | inL = local->findByUid( uid ); |
2733 | if ( !inL.resource() || inL.resource()->includeInSync() ) { | 2736 | if ( !inL.resource() || inL.resource()->includeInSync() ) { |
2734 | inR = remote->findByUid( uid ); | 2737 | inR = remote->findByUid( uid ); |
2735 | if ( inR.isEmpty() ) { | 2738 | if ( inR.isEmpty() ) { / no conflict ********** add or delete local |
2736 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2739 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2737 | if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 2740 | if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
2738 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); | 2741 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); |
@@ -2761,6 +2764,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2761 | inL.setRevision( modifiedCalendar ); | 2764 | inL.setRevision( modifiedCalendar ); |
2762 | local->insertAddressee( inL, false ); | 2765 | local->insertAddressee( inL, false ); |
2763 | inR = inL; | 2766 | inR = inL; |
2767 | inR.setIDStr( ":" ); | ||
2764 | inR.setResource( 0 ); | 2768 | inR.setResource( 0 ); |
2765 | remote->insertAddressee( inR, false ); | 2769 | remote->insertAddressee( inR, false ); |
2766 | } | 2770 | } |