summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calfilter.cpp29
-rw-r--r--libkcal/calfilter.h3
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)
if (!mEnabled) return;
-
-// kdDebug(5800) << "CalFilter::apply()" << endl;
-
Todo *event = eventlist->first();
@@ -81,7 +78,16 @@ void CalFilter::apply(QPtrList<Todo> *eventlist)
}
-
+bool CalFilter::filterCalendarItem(Incidence *in)
+{
+ if ( in->type() == "Event" )
+ return filterEvent( (Event*) in );
+ else if ( in->type() =="Todo" )
+ return filterTodo( (Todo*) in);
+ else if ( in->type() =="Journal" )
+ return filterJournal( (Journal*) in );
+ return false;
+}
bool CalFilter::filterEvent(Event *event)
{
-// kdDebug(5800) << "CalFilter::filterEvent(): " << event->getSummary() << endl;
-
+ if (mCriteria & HideEvents)
+ return false;
if (mCriteria & HideRecurring) {
@@ -92,7 +98,12 @@ bool CalFilter::filterEvent(Event *event)
}
-
+bool CalFilter::filterJournal(Journal *j)
+{
+ if (mCriteria & HideJournals)
+ return false;
+ return true;
+}
bool CalFilter::filterTodo(Todo *todo)
{
-// kdDebug(5800) << "CalFilter::filterEvent(): " << event->getSummary() << endl;
-
+ if (mCriteria & HideTodos)
+ return false;
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 {
void apply(QPtrList<Todo> *todolist);
-
+ bool CalFilter::filterCalendarItem(Incidence *in);
+ bool CalFilter::filterJournal(Journal *in);
/**