-rw-r--r-- | libkcal/calendarlocal.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index ce3cd09..cb52b7c 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -19,13 +19,13 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <kdebug.h> #include <kconfig.h> #include <kglobal.h> #include <klocale.h> @@ -189,21 +189,21 @@ bool CalendarLocal::mergeCalendar( Calendar* remote ) { // 1 look for raw inc in local // if inc not in remote, delete in local // 2 look for raw inc in remote // if inc in local, replace it // if not in local, add it to default calendar - QPtrList<Incidence> localInc = rawIncidences(); + Q3PtrList<Incidence> localInc = rawIncidences(); Incidence* inL = localInc.first(); while ( inL ) { if ( ! inL->isReadOnly () ) if ( !remote->incidenceForUid( inL->uid(), true )) deleteIncidence( inL ); inL = localInc.next(); } - QPtrList<Incidence> er = remote->rawIncidences(); + Q3PtrList<Incidence> er = remote->rawIncidences(); Incidence* inR = er.first(); while ( inR ) { inL = incidenceForUid( inR->uid(),false ); if ( inL ) { if ( ! inL->isReadOnly () || inL->uid().left(15) == QString("last-syncEvent-") ) { int calID = inL->calID(); @@ -256,15 +256,15 @@ void CalendarLocal::setSyncEventsReadOnly() } void CalendarLocal::addCalendar( Calendar* cal ) { cal->setDontDeleteIncidencesOnClose(); setSyncEventsEnabled(); - QPtrList<Incidence> incList; + Q3PtrList<Incidence> incList; { - QPtrList<Event> EventList = cal->rawEvents(); + Q3PtrList<Event> EventList = cal->rawEvents(); Event * ev = EventList.first(); while ( ev ) { if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) { ev->setCalID_block( 1 ); } Event * se = event( ev->uid() ); @@ -276,13 +276,13 @@ void CalendarLocal::addCalendar( Calendar* cal ) ev = EventList.next(); } } { - QPtrList<Todo> TodoList = cal->rawTodos(); + Q3PtrList<Todo> TodoList = cal->rawTodos(); Todo * ev = TodoList.first(); while ( ev ) { ev->resetRelatedTo(); Todo * se = todo( ev->uid() ); if ( se ) deleteTodo( se ); @@ -296,13 +296,13 @@ void CalendarLocal::addCalendar( Calendar* cal ) mTodoList.append( ev ); setupRelations( ev ); ev = TodoList.next(); } } { - QPtrList<Journal> JournalList = cal->journals(); + Q3PtrList<Journal> JournalList = cal->journals(); Journal * ev = JournalList.first(); while ( ev ) { Journal * se = journal( ev->uid() ); if ( se ) incList.append( se ); ev->unRegisterObserver( cal ); @@ -478,15 +478,15 @@ void CalendarLocal::deleteTodo( Todo *todo ) } Todo* dup = todoForUid( uid ); if ( dup ) setupRelations( dup ); } -QPtrList<Todo> CalendarLocal::rawTodos() +Q3PtrList<Todo> CalendarLocal::rawTodos() { - QPtrList<Todo> el; + Q3PtrList<Todo> el; for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) if ( it->calEnabled() ) el.append( it ); return el; } Todo *CalendarLocal::todo( QString syncProf, QString id ) { @@ -496,19 +496,19 @@ Todo *CalendarLocal::todo( QString syncProf, QString id ) } return 0; } void CalendarLocal::removeSyncInfo( QString syncProfile) { - QPtrList<Incidence> all = rawIncidences() ; + Q3PtrList<Incidence> all = rawIncidences() ; Incidence *inc; for ( inc = all.first(); inc; inc = all.next() ) { inc->removeID( syncProfile ); } if ( syncProfile.isEmpty() ) { - QPtrList<Event> el; + Q3PtrList<Event> el; Event *todo; for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) el.append( todo ); } for ( todo = el.first(); todo; todo = el.next() ) { @@ -517,15 +517,15 @@ void CalendarLocal::removeSyncInfo( QString syncProfile) } else { Event *lse = event( "last-syncEvent-"+ syncProfile); if ( lse ) deleteIncidence ( lse ); } } -QPtrList<Event> CalendarLocal::getExternLastSyncEvents() +Q3PtrList<Event> CalendarLocal::getExternLastSyncEvents() { - QPtrList<Event> el; + Q3PtrList<Event> el; Event *todo; for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) if ( todo->summary().left(3) == "E: " ) el.append( todo ); } @@ -682,15 +682,15 @@ void CalendarLocal::deRegisterAlarm() mNextAlarmEventDateTime = QDateTime(); // #ifndef DESKTOP_VERSION // AlarmServer::deleteAlarm (mNextAlarmDateTime ,"koalarm" ,mLastAlarmNotificationString.latin1() ); // #endif } -QPtrList<Todo> CalendarLocal::todos( const QDate &date ) +Q3PtrList<Todo> CalendarLocal::todos( const QDate &date ) { - QPtrList<Todo> todos; + Q3PtrList<Todo> todos; Todo *todo; for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { if ( !todo->calEnabled() ) continue; if ( todo->hasDueDate() && todo->dtDue().date() == date ) { todos.append( todo ); @@ -783,13 +783,13 @@ Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) return alarms; } void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, const QDateTime &from, const QDateTime &to ) { - QPtrList<Alarm> alarmList = incidence->alarms(); + Q3PtrList<Alarm> alarmList = incidence->alarms(); Alarm *alarm; for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { // kdDebug(5800) << "CalendarLocal::appendAlarms() '" << alarm->text() // << "': " << alarm->time().toString() << " - " << alarm->enabled() << endl; if ( alarm->enabled() ) { if ( alarm->time() >= from && alarm->time() <= to ) { @@ -802,13 +802,13 @@ void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence, const QDateTime &from, const QDateTime &to ) { - QPtrList<Alarm> alarmList = incidence->alarms(); + Q3PtrList<Alarm> alarmList = incidence->alarms(); Alarm *alarm; QDateTime qdt; for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { if (incidence->recursOn(from.date())) { qdt.setTime(alarm->time().time()); qdt.setDate(from.date()); @@ -841,15 +841,15 @@ void CalendarLocal::update( IncidenceBase *incidence ) void CalendarLocal::insertEvent( Event *event ) { if ( mEventList.findRef( event ) < 0 ) mEventList.append( event ); } -QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) +Q3PtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) { - QPtrList<Event> eventList; + Q3PtrList<Event> eventList; Event *event; for( event = mEventList.first(); event; event = mEventList.next() ) { if ( !event->calEnabled() ) continue; if ( event->doesRecur() ) { if ( event->isMultiDay() ) { @@ -875,13 +875,13 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) if ( !sorted ) { return eventList; } // kdDebug(5800) << "Sorting events for date\n" << endl; // now, we have to sort it based on dtStart.time() - QPtrList<Event> eventListSorted; + Q3PtrList<Event> eventListSorted; Event *sortEvent; for ( event = eventList.first(); event; event = eventList.next() ) { sortEvent = eventListSorted.first(); int i = 0; while ( sortEvent && event->dtStart().time()>=sortEvent->dtStart().time() ) { @@ -891,18 +891,18 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) eventListSorted.insert( i, event ); } return eventListSorted; } -QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, +Q3PtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, bool inclusive ) { Event *event = 0; - QPtrList<Event> eventList; + Q3PtrList<Event> eventList; // Get non-recurring events for( event = mEventList.first(); event; event = mEventList.next() ) { if ( !event->calEnabled() ) continue; if ( event->doesRecur() ) { QDate rStart = event->dtStart().date(); @@ -920,13 +920,13 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, // TODO: Calculate end date from duration. Should be done in Event // For now exclude all events with a duration. } } } else { bool founOne; - QDate next = event->getNextOccurence( start, &founOne ).date(); + QDate next = event->getNextOccurence( (QDateTime)start, &founOne ).date(); if ( founOne ) { if ( next <= end ) { found = true; } } @@ -969,20 +969,20 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, } } return eventList; } -QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) +Q3PtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) { return rawEventsForDate( qdt.date() ); } -QPtrList<Event> CalendarLocal::rawEvents() +Q3PtrList<Event> CalendarLocal::rawEvents() { - QPtrList<Event> el; + Q3PtrList<Event> el; for ( Event *it = mEventList.first(); it; it = mEventList.next() ) if ( it->calEnabled() ) el.append( it ); return el; } bool CalendarLocal::addJournal(Journal *journal) @@ -1003,15 +1003,15 @@ void CalendarLocal::deleteJournal( Journal *journal ) clearUndo(journal); if ( mJournalList.removeRef(journal) ) { setModified( true ); } } -QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) +Q3PtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) { - QPtrList<Journal> el; + Q3PtrList<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 ) { @@ -1037,43 +1037,43 @@ Journal *CalendarLocal::journal( const QString &uid ) retVal = it; } } return retVal; } -QPtrList<Journal> CalendarLocal::journals() +Q3PtrList<Journal> CalendarLocal::journals() { - QPtrList<Journal> el; + Q3PtrList<Journal> el; for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) if ( it->calEnabled() ) el.append( it ); return el; } void CalendarLocal::setCalendarRemove( int id ) { { - QPtrList<Event> EventList = mEventList; + Q3PtrList<Event> EventList = mEventList; Event * ev = EventList.first(); while ( ev ) { if ( ev->calID() == id && ev->uid().left( 15 ) != QString("last-syncEvent-") ) deleteEvent( ev ); ev = EventList.next(); } } { - QPtrList<Todo> TodoList = mTodoList; + Q3PtrList<Todo> TodoList = mTodoList; Todo * ev = TodoList.first(); while ( ev ) { if ( ev->calID() == id ) deleteTodo( ev ); ev = TodoList.next(); } } { - QPtrList<Journal> JournalList = mJournalList; + Q3PtrList<Journal> JournalList = mJournalList; Journal * ev = JournalList.first(); while ( ev ) { if ( ev->calID() == id ) deleteJournal( ev ); ev = JournalList.next(); } |