-rw-r--r-- | libkcal/calendar.h | 1 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 14 | ||||
-rw-r--r-- | libkcal/calendarlocal.h | 1 |
3 files changed, 10 insertions, 6 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 2efa355..4652fe5 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -243,6 +243,7 @@ public: Return Journal for given date. */ virtual Journal *journal( const QDate & ) = 0; + virtual QPtrList<Journal> journals4Date( const QDate & ) = 0; /** Return Journal with given UID. */ diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 418bfca..ca64e66 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -776,12 +776,7 @@ QPtrList<Event> CalendarLocal::rawEvents() bool CalendarLocal::addJournal(Journal *journal) { - if ( journal->dtStart().isValid()) - kdDebug(5800) << "Adding Journal on " << journal->dtStart().toString() << endl; - else - kdDebug(5800) << "Adding Journal without a DTSTART" << endl; - - mJournalList.append(journal); + mJournalList.append(journal); journal->registerObserver( this ); @@ -801,6 +796,13 @@ void CalendarLocal::deleteJournal( Journal *journal ) } } +QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) +{ + QPtrList<Journal> el; + for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) + if ( it->calEnabled() && it->dtStart().date() == date) el.append( it ); + return el; +} Journal *CalendarLocal::journal( const QDate &date ) { // kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index d32597f..98d16a3 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h @@ -131,6 +131,7 @@ class CalendarLocal : public Calendar Return Journal for given date. */ Journal *journal( const QDate & ); + QPtrList<Journal> journals4Date( const QDate & ); /** Return Journal with given UID. */ |