-rw-r--r-- | libkcal/calendar.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index a3977d7..eeb5f48 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -203,96 +203,112 @@ void Calendar::setLocalTime() setModified( true ); } bool Calendar::isLocalTime() const { return mLocalTime; } const QString &Calendar::getEmail() { return mOwnerEmail; } void Calendar::setEmail(const QString &e) { mOwnerEmail = e; setModified( true ); } void Calendar::setFilter(CalFilter *filter) { mFilter = filter; } CalFilter *Calendar::filter() { return mFilter; } QPtrList<Incidence> Calendar::incidences() { QPtrList<Incidence> incidences; Incidence *i; QPtrList<Event> e = events(); for( i = e.first(); i; i = e.next() ) incidences.append( i ); QPtrList<Todo> t = todos(); for( i = t.first(); i; i = t.next() ) incidences.append( i ); QPtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) incidences.append( i ); return incidences; } + +void Calendar::resetPilotStat() +{ + QPtrList<Incidence> incidences; + + Incidence *i; + + QPtrList<Event> e = rawEvents(); + for( i = e.first(); i; i = e.next() ) i->setPilotId( 0 ); + + QPtrList<Todo> t = rawTodos(); + for( i = t.first(); i; i = t.next() ) i->setPilotId( 0 ); + + QPtrList<Journal> j = journals(); + for( i = j.first(); i; i = j.next() ) i->setPilotId( 0 ); +} void Calendar::resetTempSyncStat() { QPtrList<Incidence> incidences; Incidence *i; QPtrList<Event> e = rawEvents(); for( i = e.first(); i; i = e.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); QPtrList<Todo> t = rawTodos(); for( i = t.first(); i; i = t.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); QPtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); } QPtrList<Incidence> Calendar::rawIncidences() { QPtrList<Incidence> incidences; Incidence *i; QPtrList<Event> e = rawEvents(); for( i = e.first(); i; i = e.next() ) incidences.append( i ); QPtrList<Todo> t = rawTodos(); for( i = t.first(); i; i = t.next() ) incidences.append( i ); QPtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) incidences.append( i ); return incidences; } QPtrList<Event> Calendar::events( const QDate &date, bool sorted ) { QPtrList<Event> el = rawEventsForDate(date,sorted); mFilter->apply(&el); return el; } QPtrList<Event> Calendar::events( const QDateTime &qdt ) { QPtrList<Event> el = rawEventsForDate(qdt); mFilter->apply(&el); return el; } QPtrList<Event> Calendar::events( const QDate &start, const QDate &end, |