From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'libkcal/calendar.cpp') diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 9b38d3f..bf095cf 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -30,6 +30,8 @@ #include "calendar.h" #include "syncdefines.h" +//Added by qt3to4: +#include using namespace KCal; @@ -271,19 +273,19 @@ CalFilter *Calendar::filter() return mFilter; } -QPtrList Calendar::incidences() +Q3PtrList Calendar::incidences() { - QPtrList incidences; + Q3PtrList incidences; Incidence *i; - QPtrList e = events(); + Q3PtrList e = events(); for( i = e.first(); i; i = e.next() ) incidences.append( i ); - QPtrList t = todos(); + Q3PtrList t = todos(); for( i = t.first(); i; i = t.next() ) incidences.append( i ); - QPtrList j = journals(); + Q3PtrList j = journals(); for( i = j.first(); i; i = j.next() ) incidences.append( i ); return incidences; @@ -291,77 +293,77 @@ QPtrList Calendar::incidences() void Calendar::resetPilotStat(int id ) { - QPtrList incidences; + Q3PtrList incidences; Incidence *i; - QPtrList e = rawEvents(); + Q3PtrList e = rawEvents(); for( i = e.first(); i; i = e.next() ) i->setPilotId( id ); - QPtrList t = rawTodos(); + Q3PtrList t = rawTodos(); for( i = t.first(); i; i = t.next() ) i->setPilotId( id ); - QPtrList j = journals(); + Q3PtrList j = journals(); for( i = j.first(); i; i = j.next() ) i->setPilotId( id ); } void Calendar::resetTempSyncStat() { - QPtrList incidences; + Q3PtrList incidences; Incidence *i; - QPtrList e = rawEvents(); + Q3PtrList e = rawEvents(); for( i = e.first(); i; i = e.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); - QPtrList t = rawTodos(); + Q3PtrList t = rawTodos(); for( i = t.first(); i; i = t.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); - QPtrList j = journals(); + Q3PtrList j = journals(); for( i = j.first(); i; i = j.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); } -QPtrList Calendar::rawIncidences() +Q3PtrList Calendar::rawIncidences() { - QPtrList incidences; + Q3PtrList incidences; Incidence *i; - QPtrList e = rawEvents(); + Q3PtrList e = rawEvents(); for( i = e.first(); i; i = e.next() ) incidences.append( i ); - QPtrList t = rawTodos(); + Q3PtrList t = rawTodos(); for( i = t.first(); i; i = t.next() ) incidences.append( i ); - QPtrList j = journals(); + Q3PtrList j = journals(); for( i = j.first(); i; i = j.next() ) incidences.append( i ); return incidences; } -QPtrList Calendar::events( const QDate &date, bool sorted ) +Q3PtrList Calendar::events( const QDate &date, bool sorted ) { - QPtrList el = rawEventsForDate(date,sorted); + Q3PtrList el = rawEventsForDate(date,sorted); mFilter->apply(&el); return el; } -QPtrList Calendar::events( const QDateTime &qdt ) +Q3PtrList Calendar::events( const QDateTime &qdt ) { - QPtrList el = rawEventsForDate(qdt); + Q3PtrList el = rawEventsForDate(qdt); mFilter->apply(&el); return el; } -QPtrList Calendar::events( const QDate &start, const QDate &end, +Q3PtrList Calendar::events( const QDate &start, const QDate &end, bool inclusive) { - QPtrList el = rawEvents(start,end,inclusive); + Q3PtrList el = rawEvents(start,end,inclusive); mFilter->apply(&el); return el; } -QPtrList Calendar::events() +Q3PtrList Calendar::events() { - QPtrList el = rawEvents(); + Q3PtrList el = rawEvents(); mFilter->apply(&el); return el; } @@ -369,7 +371,7 @@ void Calendar::addIncidenceBranch(Incidence *i) { addIncidence( i ); Incidence * inc; - QPtrList Relations = i->relations(); + Q3PtrList Relations = i->relations(); for (inc=Relations.first();inc;inc=Relations.next()) { addIncidenceBranch( inc ); } @@ -407,9 +409,9 @@ Incidence* Calendar::incidence( const QString& uid ) return 0; } -QPtrList Calendar::todos() +Q3PtrList Calendar::todos() { - QPtrList tl = rawTodos(); + Q3PtrList tl = rawTodos(); mFilter->apply( &tl ); return tl; } @@ -455,7 +457,7 @@ void Calendar::removeRelations( Incidence *incidence ) // qDebug("Calendar::removeRelations "); QString uid = incidence->uid(); - QPtrList relations = incidence->relations(); + Q3PtrList relations = incidence->relations(); for( Incidence* i = relations.first(); i; i = relations.next() ) if( !mOrphanUids.find( i->uid() ) ) { mOrphans.insert( uid, i ); @@ -471,7 +473,7 @@ void Calendar::removeRelations( Incidence *incidence ) // Remove this one from the orphans list if( mOrphanUids.remove( uid ) ) { QString r2uid = incidence->relatedToUid(); - QPtrList tempList; + Q3PtrList tempList; while( Incidence* i = mOrphans[ r2uid ] ) { mOrphans.remove( r2uid ); if ( i != incidence ) tempList.append( i ); @@ -487,7 +489,7 @@ void Calendar::removeRelations( Incidence *incidence ) // This incidence is located in the orphans list - it should be removed if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) { // Removing wasn't that easy - for( QDictIterator it( mOrphans ); it.current(); ++it ) { + for( Q3DictIterator it( mOrphans ); it.current(); ++it ) { if( it.current()->uid() == uid ) { mOrphans.remove( it.currentKey() ); break; -- cgit v0.9.0.2