author | zautrix <zautrix> | 2004-09-14 01:59:37 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-14 01:59:37 (UTC) |
commit | 739fec31c8cea89dd40ff1ce7dd7b84b05e4e973 (patch) (side-by-side diff) | |
tree | e632528a6825911b1b7ae9db9af4e4c8984e6dbf /korganizer | |
parent | 30762fe125216362e1a6c1d5ec5d22d9525aa336 (diff) | |
download | kdepimpi-739fec31c8cea89dd40ff1ce7dd7b84b05e4e973.zip kdepimpi-739fec31c8cea89dd40ff1ce7dd7b84b05e4e973.tar.gz kdepimpi-739fec31c8cea89dd40ff1ce7dd7b84b05e4e973.tar.bz2 |
Sync fixes
-rw-r--r-- | korganizer/calendarview.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 94cc97d..ce41fbd 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1004,50 +1004,58 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int int modulo = (er.count()/10)+1; int incCounter = 0; while ( inR ) { if ( ! bar.isVisible() ) return false; if ( incCounter % modulo == 0 ) bar.setProgress( incCounter ); ++incCounter; uid = inR->uid(); bool skipIncidence = false; if ( uid.left(15) == QString("last-syncEvent-") ) skipIncidence = true; - + QString idS; qApp->processEvents(); if ( !skipIncidence ) { inL = local->incidence( uid ); if ( inL ) { // maybe conflict - same uid in both calendars int maxrev = inL->revision(); if ( maxrev < inR->revision() ) maxrev = inR->revision(); 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 - inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); + if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) + inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); + else + idS = inR->IDStr(); remote->deleteIncidence( inR ); if ( inL->revision() < maxrev ) inL->setRevision( maxrev ); inR = inL->clone(); inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); + if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) + inR->setIDStr( idS ); remote->addIncidence( inR ); ++changedRemote; } else { if ( inR->revision() < maxrev ) inR->setRevision( maxrev ); + idS = inL->IDStr(); local->deleteIncidence( inL ); - local->addIncidence( inR->clone() ); + inL = inR->clone(); + inL->setIDStr( idS ); + local->addIncidence( inL ); ++changedLocal; } } } else { // no conflict if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { QString des = eventLSync->description(); QString pref = "e"; if ( inR->type() == "Todo" ) pref = "t"; if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); //remote->deleteIncidence( inR ); @@ -1091,24 +1099,25 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int ++incCounter; uid = inL->uid(); bool skipIncidence = false; if ( uid.left(15) == QString("last-syncEvent-") ) skipIncidence = true; if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) skipIncidence = true; if ( !skipIncidence ) { inR = remote->incidence( uid ); if ( ! inR ) { if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { + checkExternSyncEvent(eventLSyncSharp, inL); local->deleteIncidence( inL ); ++deletedEventL; } else { if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) { inL->removeID(mCurrentSyncDevice ); ++addedEventR; qDebug("remote added Incidence %s ", inL->summary().latin1()); inL->setLastModified( modifiedCalendar ); inR = inL->clone(); inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); remote->addIncidence( inR ); } |