summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-10-29 09:03:54 (UTC)
committer zautrix <zautrix>2004-10-29 09:03:54 (UTC)
commit6500d6ebb080f1de58fe676aa0a730d47fcf64f5 (patch) (unidiff)
tree41841e05bf1e6b88e6e55f42011dce5f6bed85b4 /kaddressbook
parent41e3625b8c38ff45e70b59416a519d59a5f4d937 (diff)
downloadkdepimpi-6500d6ebb080f1de58fe676aa0a730d47fcf64f5.zip
kdepimpi-6500d6ebb080f1de58fe676aa0a730d47fcf64f5.tar.gz
kdepimpi-6500d6ebb080f1de58fe676aa0a730d47fcf64f5.tar.bz2
sync fixes
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp4
-rw-r--r--kaddressbook/kabcore.cpp25
2 files changed, 16 insertions, 13 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 012780b..3397e06 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -1060,7 +1060,9 @@ void AddresseeEditorWidget::save()
1060 if ( !dirty() ) { 1060 if ( !dirty() ) {
1061 return; 1061 return;
1062 } 1062 }
1063 1063
1064 mAddressee.setRevision( QDateTime::currentDateTime() );
1065
1064 mAddressee.setRole( mRoleEdit->text() ); 1066 mAddressee.setRole( mRoleEdit->text() );
1065 mAddressee.setOrganization( mOrgEdit->text() ); 1067 mAddressee.setOrganization( mOrgEdit->text() );
1066 mAddressee.setUrl( KURL( mURLEdit->text() ) ); 1068 mAddressee.setUrl( KURL( mURLEdit->text() ) );
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 273d435..6e482b5 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2406,25 +2406,26 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
2406 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2406 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2407 bool remCh, locCh; 2407 bool remCh, locCh;
2408 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 2408 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
2409 2409 qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
2410 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
2411 locCh = ( localMod > mLastAddressbookSync ); 2410 locCh = ( localMod > mLastAddressbookSync );
2412 if ( !remCh && ! locCh ) { 2411 if ( !remCh && ! locCh ) {
2413 //qDebug("both not changed "); 2412 qDebug("both not changed ");
2414 lastSync = localMod.addDays(1); 2413 lastSync = localMod.addDays(1);
2415 if ( mode <= SYNC_PREF_ASK ) 2414 if ( mode <= SYNC_PREF_ASK )
2416 return 0; 2415 return 0;
2417 } else { 2416 } else {
2418 if ( locCh ) { 2417 if ( locCh ) {
2419 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); 2418 qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1());
2420 lastSync = localMod.addDays( -1 ); 2419 lastSync = localMod.addDays( -1 );
2421 if ( !remCh ) 2420 if ( !remCh )
2422 remoteMod =( lastSync.addDays( -1 ) ); 2421 remoteMod =( lastSync.addDays( -1 ) );
2423 } else { 2422 } else {
2424 //qDebug(" not loc changed "); 2423 qDebug(" not loc changed ");
2425 lastSync = localMod.addDays( 1 ); 2424 lastSync = localMod.addDays( 1 );
2426 if ( remCh ) 2425 if ( remCh ) {
2426 qDebug("rem changed ");
2427 remoteMod =( lastSync.addDays( 1 ) ); 2427 remoteMod =( lastSync.addDays( 1 ) );
2428 }
2428 2429
2429 } 2430 }
2430 } 2431 }
@@ -2436,15 +2437,13 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
2436 return 0; 2437 return 0;
2437 2438
2438 } 2439 }
2439 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); 2440 qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec());
2440 2441 qDebug("lastsync %s ", lastSync.toString().latin1() );
2441 //qDebug("%s %d %s %d", local->lastModified().toString().latin1() , localMod, remote->lastModified().toString().latin1(), remoteMod);
2442 //qDebug("%d %d %d %d ", local->lastModified().time().second(), local->lastModified().time().msec(), remote->lastModified().time().second(), remote->lastModified().time().msec() );
2443 //full = true; //debug only 2442 //full = true; //debug only
2444 if ( full ) { 2443 if ( full ) {
2445 bool equ = ( (*local) == (*remote) ); 2444 bool equ = ( (*local) == (*remote) );
2446 if ( equ ) { 2445 if ( equ ) {
2447 //qDebug("equal "); 2446 qDebug("equal ");
2448 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2447 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2449 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 2448 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
2450 } 2449 }
@@ -2643,8 +2642,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2643 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2642 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2644 inR.setOriginalExternalUID( OidS ); 2643 inR.setOriginalExternalUID( OidS );
2645 inR.setExternalUID( idS ); 2644 inR.setExternalUID( idS );
2646 if ( syncManager->syncWithDesktop() ) 2645 if ( syncManager->syncWithDesktop() ) {
2647 inR.setIDStr("changed" ); 2646 inR.setIDStr("changed" );
2647 }
2648 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); 2648 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" );
2649 } else { 2649 } else {
2650 inR.setIDStr( idS ); 2650 inR.setIDStr( idS );
@@ -2746,6 +2746,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2746 } 2746 }
2747 } else { 2747 } else {
2748 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { 2748 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) {
2749 //qDebug("data %s ", inL.revision().toString().latin1());
2749 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 2750 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
2750 local->removeAddressee( inL ); 2751 local->removeAddressee( inL );
2751 ++deletedAddresseeL; 2752 ++deletedAddresseeL;