-rw-r--r-- | korganizer/calendarview.cpp | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8258c74..02c5e45 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1079,9 +1079,11 @@ 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; + 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; + } } @@ -1089,7 +1091,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int 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 { @@ -1136,10 +1140,12 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int 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 ); + } } @@ -1153,7 +1159,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int 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 ); + } } |