-rw-r--r-- | korganizer/calendarview.cpp | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 02c5e45..685bb60 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1062,49 +1062,49 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); } local->addIncidence( inL ); ++changedLocal; } } } else { // no conflict ********** add or delete remote - 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 ); - ++deletedEventR; - } else { - if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ + if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ + 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 ); + ++deletedEventR; + } 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 { - if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { - if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ + } else { + if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { inR->setLastModified( modifiedCalendar ); inL = inR->clone(); inL->setIDStr( ":" ); local->addIncidence( inL ); ++addedEvent; + + } else { + checkExternSyncEvent(eventRSyncSharp, inR); + remote->deleteIncidence( inR ); + ++deletedEventR; } - } else { - checkExternSyncEvent(eventRSyncSharp, inR); - remote->deleteIncidence( inR ); - ++deletedEventR; } } } } inR = er.next(); } QPtrList<Incidence> el = local->rawIncidences(); inL = el.first(); @@ -1123,52 +1123,51 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int bar.setProgress( incCounter ); ++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 ( filterOUT && ! filterOUT->filterCalendarItem( inL ) ){ + skipIncidence = true; + } if ( !skipIncidence ) { inR = remote->incidence( uid ); 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 ); ++deletedEventL; } else { if ( ! mSyncManager->mWriteBackExistingOnly ) { - if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ - inL->removeID(mCurrentSyncDevice ); - ++addedEventR; - //qDebug("remote added Incidence %s ", inL->summary().latin1()); - inL->setLastModified( modifiedCalendar ); - inR = inL->clone(); - inR->setIDStr( ":" ); - inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); - remote->addIncidence( inR ); - } + inL->removeID(mCurrentSyncDevice ); + ++addedEventR; + //qDebug("remote added Incidence %s ", inL->summary().latin1()); + inL->setLastModified( modifiedCalendar ); + inR = inL->clone(); + inR->setIDStr( ":" ); + inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); + remote->addIncidence( inR ); } } } else { if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { checkExternSyncEvent(eventLSyncSharp, inL); local->deleteIncidence( inL ); ++deletedEventL; } else { if ( ! mSyncManager->mWriteBackExistingOnly ) { - if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ - ++addedEventR; - inL->setLastModified( modifiedCalendar ); - inR = inL->clone(); - inR->setIDStr( ":" ); - remote->addIncidence( inR ); - } + ++addedEventR; + inL->setLastModified( modifiedCalendar ); + inR = inL->clone(); + inR->setIDStr( ":" ); + remote->addIncidence( inR ); } } } } } inL = el.next(); } int delFut = 0; |