From d57ed4438bbd6e3d9a7a0e46283d3e7645b4e47b Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 16 Jan 2005 11:22:49 +0000 Subject: filter impl --- (limited to 'korganizer/calendarview.cpp') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8258c74..02c5e45 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1077,21 +1077,25 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int //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; + if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ + 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 ) { - inR->setLastModified( modifiedCalendar ); - inL = inR->clone(); - inL->setIDStr( ":" ); - local->addIncidence( inL ); - ++addedEvent; + if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ + inR->setLastModified( modifiedCalendar ); + inL = inR->clone(); + inL->setIDStr( ":" ); + local->addIncidence( inL ); + ++addedEvent; + } } else { checkExternSyncEvent(eventRSyncSharp, inR); remote->deleteIncidence( inR ); @@ -1134,14 +1138,16 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int ++deletedEventL; } else { if ( ! mSyncManager->mWriteBackExistingOnly ) { - 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 ); + 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 ); + } } } } else { @@ -1151,11 +1157,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int ++deletedEventL; } else { if ( ! mSyncManager->mWriteBackExistingOnly ) { - ++addedEventR; - inL->setLastModified( modifiedCalendar ); - inR = inL->clone(); - inR->setIDStr( ":" ); - remote->addIncidence( inR ); + if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ + ++addedEventR; + inL->setLastModified( modifiedCalendar ); + inR = inL->clone(); + inR->setIDStr( ":" ); + remote->addIncidence( inR ); + } } } } -- cgit v0.9.0.2