author | zautrix <zautrix> | 2005-01-16 11:22:49 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-16 11:22:49 (UTC) |
commit | d57ed4438bbd6e3d9a7a0e46283d3e7645b4e47b (patch) (unidiff) | |
tree | 522438ce187845f6d74d7888be203759138615fa /libkcal | |
parent | 92b8de5ff678bddf69b9f0a45c1d90829c50c592 (diff) | |
download | kdepimpi-d57ed4438bbd6e3d9a7a0e46283d3e7645b4e47b.zip kdepimpi-d57ed4438bbd6e3d9a7a0e46283d3e7645b4e47b.tar.gz kdepimpi-d57ed4438bbd6e3d9a7a0e46283d3e7645b4e47b.tar.bz2 |
filter impl
-rw-r--r-- | libkcal/calfilter.cpp | 29 | ||||
-rw-r--r-- | libkcal/calfilter.h | 3 |
2 files changed, 22 insertions, 10 deletions
diff --git a/libkcal/calfilter.cpp b/libkcal/calfilter.cpp index c182db5..c425dfc 100644 --- a/libkcal/calfilter.cpp +++ b/libkcal/calfilter.cpp | |||
@@ -66,5 +66,2 @@ void CalFilter::apply(QPtrList<Todo> *eventlist) | |||
66 | if (!mEnabled) return; | 66 | if (!mEnabled) return; |
67 | |||
68 | // kdDebug(5800) << "CalFilter::apply()" << endl; | ||
69 | |||
70 | Todo *event = eventlist->first(); | 67 | Todo *event = eventlist->first(); |
@@ -81,7 +78,16 @@ void CalFilter::apply(QPtrList<Todo> *eventlist) | |||
81 | } | 78 | } |
82 | 79 | bool CalFilter::filterCalendarItem(Incidence *in) | |
80 | { | ||
81 | if ( in->type() == "Event" ) | ||
82 | return filterEvent( (Event*) in ); | ||
83 | else if ( in->type() =="Todo" ) | ||
84 | return filterTodo( (Todo*) in); | ||
85 | else if ( in->type() =="Journal" ) | ||
86 | return filterJournal( (Journal*) in ); | ||
87 | return false; | ||
88 | } | ||
83 | bool CalFilter::filterEvent(Event *event) | 89 | bool CalFilter::filterEvent(Event *event) |
84 | { | 90 | { |
85 | // kdDebug(5800) << "CalFilter::filterEvent(): " << event->getSummary() << endl; | 91 | if (mCriteria & HideEvents) |
86 | 92 | return false; | |
87 | if (mCriteria & HideRecurring) { | 93 | if (mCriteria & HideRecurring) { |
@@ -92,7 +98,12 @@ bool CalFilter::filterEvent(Event *event) | |||
92 | } | 98 | } |
93 | 99 | bool CalFilter::filterJournal(Journal *j) | |
100 | { | ||
101 | if (mCriteria & HideJournals) | ||
102 | return false; | ||
103 | return true; | ||
104 | } | ||
94 | bool CalFilter::filterTodo(Todo *todo) | 105 | bool CalFilter::filterTodo(Todo *todo) |
95 | { | 106 | { |
96 | // kdDebug(5800) << "CalFilter::filterEvent(): " << event->getSummary() << endl; | 107 | if (mCriteria & HideTodos) |
97 | 108 | return false; | |
98 | if (mCriteria & HideCompleted) { | 109 | if (mCriteria & HideCompleted) { |
diff --git a/libkcal/calfilter.h b/libkcal/calfilter.h index 5ad0064..29db441 100644 --- a/libkcal/calfilter.h +++ b/libkcal/calfilter.h | |||
@@ -63,3 +63,4 @@ class CalFilter { | |||
63 | void apply(QPtrList<Todo> *todolist); | 63 | void apply(QPtrList<Todo> *todolist); |
64 | 64 | bool CalFilter::filterCalendarItem(Incidence *in); | |
65 | bool CalFilter::filterJournal(Journal *in); | ||
65 | /** | 66 | /** |