summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index d970ff1..e88706e 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1179,24 +1179,28 @@ void KABCore::setModified( bool modified )
1179 mViewManager->refreshView(); 1179 mViewManager->refreshView();
1180 1180
1181} 1181}
1182 1182
1183bool KABCore::modified() const 1183bool KABCore::modified() const
1184{ 1184{
1185 return mModified; 1185 return mModified;
1186} 1186}
1187 1187
1188void KABCore::contactModified( const KABC::Addressee &addr ) 1188void KABCore::contactModified( const KABC::Addressee &addr )
1189{ 1189{
1190 addrModified( addr ); 1190 addrModified( addr );
1191#if 0 // debug only
1192 KABC::Addressee ad = addr;
1193 ad.computeCsum( "123");
1194#endif
1191} 1195}
1192 1196
1193void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) 1197void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails )
1194{ 1198{
1195 1199
1196 Command *command = 0; 1200 Command *command = 0;
1197 QString uid; 1201 QString uid;
1198 1202
1199 // check if it exists already 1203 // check if it exists already
1200 KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); 1204 KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() );
1201 if ( origAddr.isEmpty() ) 1205 if ( origAddr.isEmpty() )
1202 command = new PwNewCommand( mAddressBook, addr ); 1206 command = new PwNewCommand( mAddressBook, addr );
@@ -2704,25 +2708,26 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
2704 // 1 take local 2708 // 1 take local
2705 // 2 take remote 2709 // 2 take remote
2706 // 3 cancel 2710 // 3 cancel
2707 QDateTime lastSync = mLastAddressbookSync; 2711 QDateTime lastSync = mLastAddressbookSync;
2708 QDateTime localMod = local->revision(); 2712 QDateTime localMod = local->revision();
2709 QDateTime remoteMod = remote->revision(); 2713 QDateTime remoteMod = remote->revision();
2710 2714
2711 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2715 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2712 2716
2713 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2717 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2714 bool remCh, locCh; 2718 bool remCh, locCh;
2715 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 2719 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
2716 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); 2720 if ( remCh )
2721 qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
2717 locCh = ( localMod > mLastAddressbookSync ); 2722 locCh = ( localMod > mLastAddressbookSync );
2718 //qDebug("cahnged rem %d loc %d",remCh, locCh ); 2723 //qDebug("cahnged rem %d loc %d",remCh, locCh );
2719 if ( !remCh && ! locCh ) { 2724 if ( !remCh && ! locCh ) {
2720 //qDebug("both not changed "); 2725 //qDebug("both not changed ");
2721 lastSync = localMod.addDays(1); 2726 lastSync = localMod.addDays(1);
2722 if ( mode <= SYNC_PREF_ASK ) 2727 if ( mode <= SYNC_PREF_ASK )
2723 return 0; 2728 return 0;
2724 } else { 2729 } else {
2725 if ( locCh ) { 2730 if ( locCh ) {
2726 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); 2731 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1());
2727 lastSync = localMod.addDays( -1 ); 2732 lastSync = localMod.addDays( -1 );
2728 if ( !remCh ) 2733 if ( !remCh )