From b7044dfc9516d546683973985555c481d59fc677 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 29 Jun 2005 10:36:31 +0000 Subject: journal fixxx --- (limited to 'libkcal') 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 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 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 CalendarLocal::journals4Date( const QDate & date ) +{ + QPtrList 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 journals4Date( const QDate & ); /** Return Journal with given UID. */ -- cgit v0.9.0.2