author | zautrix <zautrix> | 2005-06-29 10:36:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-29 10:36:31 (UTC) |
commit | b7044dfc9516d546683973985555c481d59fc677 (patch) (side-by-side diff) | |
tree | b521090cfc8eb6c8c6a6f6f8167c83058ea1361b /libkcal | |
parent | f226b4cd2ce06a6948811fe04d80fe3ffa44f695 (diff) | |
download | kdepimpi-b7044dfc9516d546683973985555c481d59fc677.zip kdepimpi-b7044dfc9516d546683973985555c481d59fc677.tar.gz kdepimpi-b7044dfc9516d546683973985555c481d59fc677.tar.bz2 |
journal fixxx
-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 @@ -240,12 +240,13 @@ public: */ virtual bool addJournal( Journal * ) = 0; /** Return Journal for given date. */ virtual Journal *journal( const QDate & ) = 0; + virtual QPtrList<Journal> journals4Date( const QDate & ) = 0; /** Return Journal with given UID. */ virtual Journal *journal( const QString &UID ) = 0; /** Return list of all Journal entries. diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 418bfca..ca64e66 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -773,18 +773,13 @@ QPtrList<Event> CalendarLocal::rawEvents() if ( it->calEnabled() ) el.append( it ); return el; } 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 ); setModified( true ); journal->setCalID( mDefaultCalendar ); journal->setCalEnabled( true ); @@ -798,12 +793,19 @@ void CalendarLocal::deleteJournal( Journal *journal ) mUndoIncidence->setSummary( mUndoIncidence->description().left(25)); if ( mJournalList.removeRef(journal) ) { setModified( true ); } } +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; for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) if ( it->calEnabled() && it->dtStart().date() == date ) diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index d32597f..98d16a3 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h @@ -128,12 +128,13 @@ class CalendarLocal : public Calendar */ void deleteJournal( Journal * ); /** Return Journal for given date. */ Journal *journal( const QDate & ); + QPtrList<Journal> journals4Date( const QDate & ); /** Return Journal with given UID. */ Journal *journal( const QString &uid ); /** Return list of all Journals stored in calendar. |