From 3ec18dd19fdf4eb7e763b8022f90de83249facfd Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 22 Oct 2005 16:49:42 +0000 Subject: fixxx --- (limited to 'libkcal') diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 3f6895d..4b8b3ff 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -319,6 +319,8 @@ public: virtual void setReadOnly( int id, bool enable ) = 0; virtual void setDefaultCalendarEnabledOnly() = 0; virtual void setCalendarRemove( int id ) = 0; + virtual void getIncidenceCount( int calId, int& events, int & todos, int & journals) = 0; + signals: void calendarChanged(); void calendarSaved(); diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 1a1c6be..0ddfeca 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -452,7 +452,7 @@ Event *CalendarLocal::event( QString syncProf, QString id ) } Todo *CalendarLocal::todo( const QString &uid ) { - Todo *todo;; + Todo *todo; Todo *retVal = 0; for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { if ( todo->calEnabled() && todo->uid() == uid ) { @@ -467,6 +467,30 @@ Todo *CalendarLocal::todo( const QString &uid ) } return retVal; } +void CalendarLocal::getIncidenceCount( int calId, int& events, int & todos, int & journals) +{ + events = 0; + todos = 0; + journals = 0; + { + Todo *todo; + for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { + if ( todo->calID() == calId ) + ++todos; + } + } + { + Event *todo; + for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { + if ( todo->calID() == calId ) + ++events; + + } + } + for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) + if ( it->calID() == calId ) ++journals; + +} QString CalendarLocal::nextSummary() const { return mNextSummary; diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index a7a85c8..ca0bd98 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h @@ -185,6 +185,7 @@ class CalendarLocal : public Calendar bool inclusive = false ); Todo *todo( QString, QString ); Event *event( QString, QString ); + void getIncidenceCount( int calId, int& events, int & todos, int & journals); public slots: void setCalendarEnabled( int id, bool enable ); -- cgit v0.9.0.2