author | zautrix <zautrix> | 2005-01-16 11:22:49 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-16 11:22:49 (UTC) |
commit | d57ed4438bbd6e3d9a7a0e46283d3e7645b4e47b (patch) (side-by-side diff) | |
tree | 522438ce187845f6d74d7888be203759138615fa /korganizer | |
parent | 92b8de5ff678bddf69b9f0a45c1d90829c50c592 (diff) | |
download | kdepimpi-d57ed4438bbd6e3d9a7a0e46283d3e7645b4e47b.zip kdepimpi-d57ed4438bbd6e3d9a7a0e46283d3e7645b4e47b.tar.gz kdepimpi-d57ed4438bbd6e3d9a7a0e46283d3e7645b4e47b.tar.bz2 |
filter impl
-rw-r--r-- | korganizer/calendarview.cpp | 8 | ||||
-rw-r--r-- | korganizer/filtereditdialog.cpp | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8258c74..02c5e45 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1077,6 +1077,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int //remote->deleteIncidence( inR ); ++deletedEventR; } else { + if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ inR->setLastModified( modifiedCalendar ); inL = inR->clone(); inL->setIDStr( ":" ); @@ -1085,13 +1086,16 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int local->addIncidence( inL ); ++addedEvent; } + } } else { if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { + 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,6 +1138,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int ++deletedEventL; } else { if ( ! mSyncManager->mWriteBackExistingOnly ) { + if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ inL->removeID(mCurrentSyncDevice ); ++addedEventR; //qDebug("remote added Incidence %s ", inL->summary().latin1()); @@ -1144,6 +1149,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int remote->addIncidence( inR ); } } + } } else { if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { checkExternSyncEvent(eventLSyncSharp, inL); @@ -1151,6 +1157,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int ++deletedEventL; } else { if ( ! mSyncManager->mWriteBackExistingOnly ) { + if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ ++addedEventR; inL->setLastModified( modifiedCalendar ); inR = inL->clone(); @@ -1161,6 +1168,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } } } + } inL = el.next(); } int delFut = 0; diff --git a/korganizer/filtereditdialog.cpp b/korganizer/filtereditdialog.cpp index ca09844..df84911 100644 --- a/korganizer/filtereditdialog.cpp +++ b/korganizer/filtereditdialog.cpp @@ -236,6 +236,10 @@ void FilterEditDialog::readFilter(CalFilter *filter) mEditor->mPrivateCheck->setChecked(c & CalFilter::ShowPrivate); mEditor->mConfidentialCheck->setChecked(c & CalFilter::ShowConfidential); + mEditor->mEventCheck->setChecked(c & CalFilter::HideEvents); + mEditor->mTodoCheck->setChecked(c & CalFilter::HideTodos); + mEditor->mJournalCheck->setChecked(c & CalFilter::HideJournals); + if (c & CalFilter::ShowCategories) { mEditor->mCatShowCheck->setChecked(true); } else { @@ -259,6 +263,9 @@ void FilterEditDialog::writeFilter(CalFilter *filter) if (mEditor->mPublicCheck->isChecked()) c |= CalFilter::ShowPublic; if (mEditor->mPrivateCheck->isChecked()) c |= CalFilter::ShowPrivate; if (mEditor->mConfidentialCheck->isChecked()) c |= CalFilter::ShowConfidential; + if (mEditor->mEventCheck->isChecked()) c |= CalFilter::HideEvents; + if (mEditor->mTodoCheck->isChecked()) c |= CalFilter::HideTodos; + if (mEditor->mJournalCheck->isChecked()) c |= CalFilter::HideJournals; filter->setCriteria(c); |