author | zautrix <zautrix> | 2005-10-22 16:49:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-22 16:49:42 (UTC) |
commit | 3ec18dd19fdf4eb7e763b8022f90de83249facfd (patch) (unidiff) | |
tree | abc6c8568c33b70afd8abc46ae9495e5d862cba1 /libkcal | |
parent | c643664ae97e757afda1012dc998b49e6cc2d575 (diff) | |
download | kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.zip kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.tar.gz kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.tar.bz2 |
fixxx
-rw-r--r-- | libkcal/calendar.h | 2 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 26 | ||||
-rw-r--r-- | libkcal/calendarlocal.h | 1 |
3 files changed, 28 insertions, 1 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 3f6895d..4b8b3ff 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h | |||
@@ -316,12 +316,14 @@ public: | |||
316 | void setDefaultCalendar( int ); | 316 | void setDefaultCalendar( int ); |
317 | virtual void setCalendarEnabled( int id, bool enable ) = 0; | 317 | virtual void setCalendarEnabled( int id, bool enable ) = 0; |
318 | virtual void setAlarmEnabled( int id, bool enable ) = 0; | 318 | virtual void setAlarmEnabled( int id, bool enable ) = 0; |
319 | virtual void setReadOnly( int id, bool enable ) = 0; | 319 | virtual void setReadOnly( int id, bool enable ) = 0; |
320 | virtual void setDefaultCalendarEnabledOnly() = 0; | 320 | virtual void setDefaultCalendarEnabledOnly() = 0; |
321 | virtual void setCalendarRemove( int id ) = 0; | 321 | virtual void setCalendarRemove( int id ) = 0; |
322 | virtual void getIncidenceCount( int calId, int& events, int & todos, int & journals) = 0; | ||
323 | |||
322 | signals: | 324 | signals: |
323 | void calendarChanged(); | 325 | void calendarChanged(); |
324 | void calendarSaved(); | 326 | void calendarSaved(); |
325 | void calendarLoaded(); | 327 | void calendarLoaded(); |
326 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 328 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
327 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 329 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 1a1c6be..0ddfeca 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -449,13 +449,13 @@ Event *CalendarLocal::event( QString syncProf, QString id ) | |||
449 | } | 449 | } |
450 | 450 | ||
451 | return 0; | 451 | return 0; |
452 | } | 452 | } |
453 | Todo *CalendarLocal::todo( const QString &uid ) | 453 | Todo *CalendarLocal::todo( const QString &uid ) |
454 | { | 454 | { |
455 | Todo *todo;; | 455 | Todo *todo; |
456 | Todo *retVal = 0; | 456 | Todo *retVal = 0; |
457 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 457 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
458 | if ( todo->calEnabled() && todo->uid() == uid ) { | 458 | if ( todo->calEnabled() && todo->uid() == uid ) { |
459 | if ( retVal ) { | 459 | if ( retVal ) { |
460 | if ( retVal->calID() > todo->calID() ) { | 460 | if ( retVal->calID() > todo->calID() ) { |
461 | retVal = todo; | 461 | retVal = todo; |
@@ -464,12 +464,36 @@ Todo *CalendarLocal::todo( const QString &uid ) | |||
464 | retVal = todo; | 464 | retVal = todo; |
465 | } | 465 | } |
466 | } | 466 | } |
467 | } | 467 | } |
468 | return retVal; | 468 | return retVal; |
469 | } | 469 | } |
470 | void CalendarLocal::getIncidenceCount( int calId, int& events, int & todos, int & journals) | ||
471 | { | ||
472 | events = 0; | ||
473 | todos = 0; | ||
474 | journals = 0; | ||
475 | { | ||
476 | Todo *todo; | ||
477 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | ||
478 | if ( todo->calID() == calId ) | ||
479 | ++todos; | ||
480 | } | ||
481 | } | ||
482 | { | ||
483 | Event *todo; | ||
484 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { | ||
485 | if ( todo->calID() == calId ) | ||
486 | ++events; | ||
487 | |||
488 | } | ||
489 | } | ||
490 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | ||
491 | if ( it->calID() == calId ) ++journals; | ||
492 | |||
493 | } | ||
470 | QString CalendarLocal::nextSummary() const | 494 | QString CalendarLocal::nextSummary() const |
471 | { | 495 | { |
472 | return mNextSummary; | 496 | return mNextSummary; |
473 | } | 497 | } |
474 | QDateTime CalendarLocal::nextAlarmEventDateTime() const | 498 | QDateTime CalendarLocal::nextAlarmEventDateTime() const |
475 | { | 499 | { |
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index a7a85c8..ca0bd98 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h | |||
@@ -182,12 +182,13 @@ class CalendarLocal : public Calendar | |||
182 | only events are returned, which are completely included in the range. | 182 | only events are returned, which are completely included in the range. |
183 | */ | 183 | */ |
184 | QPtrList<Event> rawEvents( const QDate &start, const QDate &end, | 184 | QPtrList<Event> rawEvents( const QDate &start, const QDate &end, |
185 | bool inclusive = false ); | 185 | bool inclusive = false ); |
186 | Todo *todo( QString, QString ); | 186 | Todo *todo( QString, QString ); |
187 | Event *event( QString, QString ); | 187 | Event *event( QString, QString ); |
188 | void getIncidenceCount( int calId, int& events, int & todos, int & journals); | ||
188 | 189 | ||
189 | public slots: | 190 | public slots: |
190 | void setCalendarEnabled( int id, bool enable ); | 191 | void setCalendarEnabled( int id, bool enable ); |
191 | void setAlarmEnabled( int id, bool enable ); | 192 | void setAlarmEnabled( int id, bool enable ); |
192 | void setReadOnly( int id, bool enable ); | 193 | void setReadOnly( int id, bool enable ); |
193 | void setDefaultCalendarEnabledOnly(); | 194 | void setDefaultCalendarEnabledOnly(); |