-rw-r--r-- | kaddressbook/kabcore.cpp | 12 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 10 |
2 files changed, 14 insertions, 8 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index bdc5bd8..c75b4bc 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -2635,9 +2635,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) { //qDebug("take %d %s ", take, inL.summary().latin1()); if ( take == 3 ) return false; - if ( take == 1 ) {// take local + if ( take == 1 ) {// take local ********************** if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); local->insertAddressee( inL, false ); @@ -2660,9 +2660,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo } inR.setResource( 0 ); remote->insertAddressee( inR , false); ++changedRemote; - } else { // take == 2 take remote + } else { // take == 2 take remote ********************** if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { if ( inR.revision().date().year() < 2004 ) inR.setRevision( modifiedCalendar ); } @@ -2679,9 +2679,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo ++changedLocal; } } } - } else { // no conflict + } else { // no conflict ********** add or delete remote if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { QString des = addresseeLSync.note(); if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); @@ -2690,8 +2690,11 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo } else { inR.setRevision( modifiedCalendar ); remote->insertAddressee( inR, false ); inL = inR; + inL.setIDStr( ":" ); + inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); + inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); inL.setResource( 0 ); local->insertAddressee( inL , false); ++addedAddressee; } @@ -2731,9 +2734,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo if ( !skipIncidence ) { inL = local->findByUid( uid ); if ( !inL.resource() || inL.resource()->includeInSync() ) { inR = remote->findByUid( uid ); - if ( inR.isEmpty() ) { + if ( inR.isEmpty() ) { / no conflict ********** add or delete local if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); local->removeAddressee( inL ); @@ -2760,8 +2763,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo ++addedAddresseeR; inL.setRevision( modifiedCalendar ); local->insertAddressee( inL, false ); inR = inL; + inR.setIDStr( ":" ); inR.setResource( 0 ); remote->insertAddressee( inR, false ); } } diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 4667918..4e29d6f 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1015,9 +1015,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { //qDebug("take %d %s ", take, inL->summary().latin1()); if ( take == 3 ) return false; - if ( take == 1 ) {// take local + if ( take == 1 ) {// take local ********************** if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); else idS = inR->IDStr(); @@ -1029,9 +1029,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int remote->addIncidence( inR ); if ( mSyncManager->syncWithDesktop() ) inR->setPilotId( 2 ); ++changedRemote; - } else { + } else {// take remote ********************** idS = inL->IDStr(); int pid = inL->pilotId(); local->deleteIncidence( inL ); inL = inR->clone(); @@ -1045,9 +1045,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int local->addIncidence( inL ); ++changedLocal; } } - } else { // no conflict + } else { // no conflict ********** add or delete remote if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { QString des = eventLSync->description(); QString pref = "e"; if ( inR->type() == "Todo" ) @@ -1059,8 +1059,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } else { inR->setLastModified( modifiedCalendar ); inL = inR->clone(); inL->setIDStr( ":" ); + inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); + inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); local->addIncidence( inL ); ++addedEvent; } } else { @@ -1103,9 +1105,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) skipIncidence = true; if ( !skipIncidence ) { inR = remote->incidence( uid ); - if ( ! inR ) { + if ( ! inR ) { // no conflict ********** add or delete local if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { checkExternSyncEvent(eventLSyncSharp, inL); local->deleteIncidence( inL ); |