50 files changed, 521 insertions, 449 deletions
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index 3157214..3c4a81c 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp @@ -26,6 +26,8 @@ #include "todo.h" #include "alarm.h" +//Added by qt3to4: +#include <Q3ValueList> using namespace KCal; #include <qwidget.h> @@ -212,7 +214,7 @@ QString Alarm::programArguments() const } void Alarm::setEmailAlarm(const QString &subject, const QString &text, - const QValueList<Person> &addressees, const QStringList &attachments) + const Q3ValueList<Person> &addressees, const QStringList &attachments) { mType = Email; mMailSubject = subject; @@ -231,7 +233,7 @@ void Alarm::setMailAddress(const Person &mailAddress) } } -void Alarm::setMailAddresses(const QValueList<Person> &mailAddresses) +void Alarm::setMailAddresses(const Q3ValueList<Person> &mailAddresses) { if (mType == Email) { mMailAddresses = mailAddresses; @@ -247,9 +249,9 @@ void Alarm::addMailAddress(const Person &mailAddress) } } -QValueList<Person> Alarm::mailAddresses() const +Q3ValueList<Person> Alarm::mailAddresses() const { - return (mType == Email) ? mMailAddresses : QValueList<Person>(); + return (mType == Email) ? mMailAddresses : Q3ValueList<Person>(); } void Alarm::setMailSubject(const QString &mailAlarmSubject) diff --git a/libkcal/alarm.h b/libkcal/alarm.h index ac6ea0d..b24f0f7 100644 --- a/libkcal/alarm.h +++ b/libkcal/alarm.h @@ -22,7 +22,7 @@ #define KCAL_ALARM_H #include <qstring.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include "customproperties.h" #include "duration.h" @@ -39,7 +39,7 @@ class Alarm : public CustomProperties { public: enum Type { Invalid, Display, Procedure, Email, Audio }; - typedef QValueList<Alarm *> List; + typedef Q3ValueList<Alarm *> List; /** Construct a new alarm with variables initialized to "sane" values. */ explicit Alarm(Incidence *parent); @@ -112,7 +112,7 @@ class Alarm : public CustomProperties @param addressees email addresses of recipient(s). @param attachments optional names of files to attach to the email. */ - void setEmailAlarm(const QString &subject, const QString &text, const QValueList<Person> &addressees, + void setEmailAlarm(const QString &subject, const QString &text, const Q3ValueList<Person> &addressees, const QStringList &attachments = QStringList()); /** Send mail to this address when the alarm is triggered. @@ -122,13 +122,13 @@ class Alarm : public CustomProperties /** Send mail to these addresses when the alarm is triggered. Ignored if the alarm is not an email alarm. */ - void setMailAddresses(const QValueList<Person> &mailAlarmAddresses); + void setMailAddresses(const Q3ValueList<Person> &mailAlarmAddresses); /** Add this address to the list of addresses to send mail to when the alarm is triggered. Ignored if the alarm is not an email alarm. */ void addMailAddress(const Person &mailAlarmAddress); /** return the addresses to send mail to when an alarm goes off */ - QValueList<Person> mailAddresses() const; + Q3ValueList<Person> mailAddresses() const; /** Set the subject line of the mail. Ignored if the alarm is not an email alarm. @@ -226,7 +226,7 @@ class Alarm : public CustomProperties QString mDescription; // text to display/email body/procedure arguments QString mFile; // procedure program to run/optional audio file to play QStringList mMailAttachFiles; // filenames to attach to email - QValueList<Person> mMailAddresses; // who to mail for reminder + Q3ValueList<Person> mMailAddresses; // who to mail for reminder QString mMailSubject; // subject of email int mAlarmSnoozeTime; // number of minutes after alarm to 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 <Q3PtrList> using namespace KCal; @@ -271,19 +273,19 @@ CalFilter *Calendar::filter() return mFilter; } -QPtrList<Incidence> Calendar::incidences() +Q3PtrList<Incidence> Calendar::incidences() { - QPtrList<Incidence> incidences; + Q3PtrList<Incidence> incidences; Incidence *i; - QPtrList<Event> e = events(); + Q3PtrList<Event> e = events(); for( i = e.first(); i; i = e.next() ) incidences.append( i ); - QPtrList<Todo> t = todos(); + Q3PtrList<Todo> t = todos(); for( i = t.first(); i; i = t.next() ) incidences.append( i ); - QPtrList<Journal> j = journals(); + Q3PtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) incidences.append( i ); return incidences; @@ -291,77 +293,77 @@ QPtrList<Incidence> Calendar::incidences() void Calendar::resetPilotStat(int id ) { - QPtrList<Incidence> incidences; + Q3PtrList<Incidence> incidences; Incidence *i; - QPtrList<Event> e = rawEvents(); + Q3PtrList<Event> e = rawEvents(); for( i = e.first(); i; i = e.next() ) i->setPilotId( id ); - QPtrList<Todo> t = rawTodos(); + Q3PtrList<Todo> t = rawTodos(); for( i = t.first(); i; i = t.next() ) i->setPilotId( id ); - QPtrList<Journal> j = journals(); + Q3PtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) i->setPilotId( id ); } void Calendar::resetTempSyncStat() { - QPtrList<Incidence> incidences; + Q3PtrList<Incidence> incidences; Incidence *i; - QPtrList<Event> e = rawEvents(); + Q3PtrList<Event> e = rawEvents(); for( i = e.first(); i; i = e.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); - QPtrList<Todo> t = rawTodos(); + Q3PtrList<Todo> t = rawTodos(); for( i = t.first(); i; i = t.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); - QPtrList<Journal> j = journals(); + Q3PtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); } -QPtrList<Incidence> Calendar::rawIncidences() +Q3PtrList<Incidence> Calendar::rawIncidences() { - QPtrList<Incidence> incidences; + Q3PtrList<Incidence> incidences; Incidence *i; - QPtrList<Event> e = rawEvents(); + Q3PtrList<Event> e = rawEvents(); for( i = e.first(); i; i = e.next() ) incidences.append( i ); - QPtrList<Todo> t = rawTodos(); + Q3PtrList<Todo> t = rawTodos(); for( i = t.first(); i; i = t.next() ) incidences.append( i ); - QPtrList<Journal> j = journals(); + Q3PtrList<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 ) +Q3PtrList<Event> Calendar::events( const QDate &date, bool sorted ) { - QPtrList<Event> el = rawEventsForDate(date,sorted); + Q3PtrList<Event> el = rawEventsForDate(date,sorted); mFilter->apply(&el); return el; } -QPtrList<Event> Calendar::events( const QDateTime &qdt ) +Q3PtrList<Event> Calendar::events( const QDateTime &qdt ) { - QPtrList<Event> el = rawEventsForDate(qdt); + Q3PtrList<Event> el = rawEventsForDate(qdt); mFilter->apply(&el); return el; } -QPtrList<Event> Calendar::events( const QDate &start, const QDate &end, +Q3PtrList<Event> Calendar::events( const QDate &start, const QDate &end, bool inclusive) { - QPtrList<Event> el = rawEvents(start,end,inclusive); + Q3PtrList<Event> el = rawEvents(start,end,inclusive); mFilter->apply(&el); return el; } -QPtrList<Event> Calendar::events() +Q3PtrList<Event> Calendar::events() { - QPtrList<Event> el = rawEvents(); + Q3PtrList<Event> el = rawEvents(); mFilter->apply(&el); return el; } @@ -369,7 +371,7 @@ void Calendar::addIncidenceBranch(Incidence *i) { addIncidence( i ); Incidence * inc; - QPtrList<Incidence> Relations = i->relations(); + Q3PtrList<Incidence> 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<Todo> Calendar::todos() +Q3PtrList<Todo> Calendar::todos() { - QPtrList<Todo> tl = rawTodos(); + Q3PtrList<Todo> tl = rawTodos(); mFilter->apply( &tl ); return tl; } @@ -455,7 +457,7 @@ void Calendar::removeRelations( Incidence *incidence ) // qDebug("Calendar::removeRelations "); QString uid = incidence->uid(); - QPtrList<Incidence> relations = incidence->relations(); + Q3PtrList<Incidence> 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<Incidence> tempList; + Q3PtrList<Incidence> 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<Incidence> it( mOrphans ); it.current(); ++it ) { + for( Q3DictIterator<Incidence> it( mOrphans ); it.current(); ++it ) { if( it.current()->uid() == uid ) { mOrphans.remove( it.currentKey() ); break; diff --git a/libkcal/calendar.h b/libkcal/calendar.h index fbc40ad..5845f44 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -25,8 +25,8 @@ #include <qobject.h> #include <qstring.h> #include <qdatetime.h> -#include <qptrlist.h> -#include <qdict.h> +#include <q3ptrlist.h> +#include <q3dict.h> #include "customproperties.h" #include "event.h" @@ -88,7 +88,7 @@ public: Sync changes in memory to persistant storage. */ virtual void save() = 0; - virtual QPtrList<Event> getExternLastSyncEvents() = 0; + virtual Q3PtrList<Event> getExternLastSyncEvents() = 0; virtual void removeSyncInfo( QString syncProfile) = 0; virtual bool isSaving() { return false; } @@ -155,12 +155,12 @@ public: /** Return filtered list of all incidences of this calendar. */ - virtual QPtrList<Incidence> incidences(); + virtual Q3PtrList<Incidence> incidences(); /** Return unfiltered list of all incidences of this calendar. */ - virtual QPtrList<Incidence> rawIncidences(); + virtual Q3PtrList<Incidence> rawIncidences(); /** Adds a Event to this calendar object. @@ -185,27 +185,27 @@ public: date specified. useful for dayView, etc. etc. The calendar filter is applied. */ - QPtrList<Event> events( const QDate &date, bool sorted = false); + Q3PtrList<Event> events( const QDate &date, bool sorted = false); /** Get events, which occur on the given date. The calendar filter is applied. */ - QPtrList<Event> events( const QDateTime &qdt ); + Q3PtrList<Event> events( const QDateTime &qdt ); /** Get events in a range of dates. If inclusive is set to true, only events are returned, which are completely included in the range. The calendar filter is applied. */ - QPtrList<Event> events( const QDate &start, const QDate &end, + Q3PtrList<Event> events( const QDate &start, const QDate &end, bool inclusive = false); /** Return filtered list of all events in calendar. */ - virtual QPtrList<Event> events(); + virtual Q3PtrList<Event> events(); /** Return unfiltered list of all events in calendar. */ - virtual QPtrList<Event> rawEvents() = 0; + virtual Q3PtrList<Event> rawEvents() = 0; /** Add a todo to the todolist. @@ -222,7 +222,7 @@ public: /** Return filterd list of todos. */ - virtual QPtrList<Todo> todos(); + virtual Q3PtrList<Todo> todos(); /** Searches todolist for an event with this unique string identifier, returns a pointer or null. @@ -232,11 +232,11 @@ public: /** Returns list of todos due on the specified date. */ - virtual QPtrList<Todo> todos( const QDate &date ) = 0; + virtual Q3PtrList<Todo> todos( const QDate &date ) = 0; /** Return unfiltered list of todos. */ - virtual QPtrList<Todo> rawTodos() = 0; + virtual Q3PtrList<Todo> rawTodos() = 0; /** Add a Journal entry to calendar. @@ -248,7 +248,7 @@ public: Return Journal for given date. */ virtual Journal *journal( const QDate & ) = 0; - virtual QPtrList<Journal> journals4Date( const QDate & ) = 0; + virtual Q3PtrList<Journal> journals4Date( const QDate & ) = 0; /** Return Journal with given UID. */ @@ -256,7 +256,7 @@ public: /** Return list of all Journal entries. */ - virtual QPtrList<Journal> journals() = 0; + virtual Q3PtrList<Journal> journals() = 0; /** Searches all incidence types for an incidence with this unique @@ -335,17 +335,17 @@ public: /** Get unfiltered events, which occur on the given date. */ - virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; + virtual Q3PtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; /** Get unfiltered events, which occur on the given date. */ - virtual QPtrList<Event> rawEventsForDate( const QDate &date, + virtual Q3PtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ) = 0; /** Get events in a range of dates. If inclusive is set to true, only events are returned, which are completely included in the range. */ - virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, + virtual Q3PtrList<Event> rawEvents( const QDate &start, const QDate &end, bool inclusive = false ) = 0; Incidence *mNextAlarmIncidence; @@ -376,8 +376,8 @@ private: QString mLoadedProductId; // This list is used to put together related todos - QDict<Incidence> mOrphans; - QDict<Incidence> mOrphanUids; + Q3Dict<Incidence> mOrphans; + Q3Dict<Incidence> mOrphanUids; }; } diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index ce3cd09..cb52b7c 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -22,7 +22,7 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <kdebug.h> #include <kconfig.h> @@ -192,7 +192,7 @@ bool CalendarLocal::mergeCalendar( Calendar* remote ) // 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 () ) @@ -200,7 +200,7 @@ bool CalendarLocal::mergeCalendar( Calendar* remote ) 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 ); @@ -259,9 +259,9 @@ 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-") ) { @@ -279,7 +279,7 @@ void CalendarLocal::addCalendar( Calendar* cal ) } { - QPtrList<Todo> TodoList = cal->rawTodos(); + Q3PtrList<Todo> TodoList = cal->rawTodos(); Todo * ev = TodoList.first(); while ( ev ) { ev->resetRelatedTo(); @@ -299,7 +299,7 @@ void CalendarLocal::addCalendar( Calendar* cal ) } } { - QPtrList<Journal> JournalList = cal->journals(); + Q3PtrList<Journal> JournalList = cal->journals(); Journal * ev = JournalList.first(); while ( ev ) { Journal * se = journal( ev->uid() ); @@ -481,9 +481,9 @@ void CalendarLocal::deleteTodo( Todo *todo ) 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; @@ -499,13 +499,13 @@ Todo *CalendarLocal::todo( QString syncProf, QString id ) } 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-") ) @@ -520,9 +520,9 @@ void CalendarLocal::removeSyncInfo( QString syncProfile) 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-") ) @@ -685,9 +685,9 @@ void CalendarLocal::deRegisterAlarm() // #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() ) { @@ -786,7 +786,7 @@ Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) 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() @@ -805,7 +805,7 @@ void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, 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() ) { @@ -844,9 +844,9 @@ void CalendarLocal::insertEvent( Event *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() ) { @@ -878,7 +878,7 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) // 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(); @@ -894,12 +894,12 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) } -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() ) { @@ -923,7 +923,7 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, } } 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; @@ -972,14 +972,14 @@ 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; @@ -1006,9 +1006,9 @@ void CalendarLocal::deleteJournal( Journal *journal ) } } -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; @@ -1040,9 +1040,9 @@ Journal *CalendarLocal::journal( const QString &uid ) 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; @@ -1051,7 +1051,7 @@ 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-") ) @@ -1061,7 +1061,7 @@ void CalendarLocal::setCalendarRemove( int id ) } { - QPtrList<Todo> TodoList = mTodoList; + Q3PtrList<Todo> TodoList = mTodoList; Todo * ev = TodoList.first(); while ( ev ) { if ( ev->calID() == id ) @@ -1070,7 +1070,7 @@ void CalendarLocal::setCalendarRemove( int id ) } } { - QPtrList<Journal> JournalList = mJournalList; + Q3PtrList<Journal> JournalList = mJournalList; Journal * ev = JournalList.first(); while ( ev ) { if ( ev->calID() == id ) diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index 1ceabce..1df65c7 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h @@ -23,6 +23,8 @@ #define KCAL_CALENDARLOCAL_H #include "calendar.h" +//Added by qt3to4: +#include <Q3PtrList> namespace KCal { @@ -93,8 +95,8 @@ class CalendarLocal : public Calendar /** Return unfiltered list of all events in calendar. */ - QPtrList<Event> rawEvents(); - QPtrList<Event> getExternLastSyncEvents(); + Q3PtrList<Event> rawEvents(); + Q3PtrList<Event> getExternLastSyncEvents(); /** Add a todo to the todolist. */ @@ -112,17 +114,17 @@ class CalendarLocal : public Calendar /** Return list of all todos. */ - QPtrList<Todo> rawTodos(); + Q3PtrList<Todo> rawTodos(); /** Returns list of todos due on the specified date. */ - QPtrList<Todo> todos( const QDate &date ); + Q3PtrList<Todo> todos( const QDate &date ); /** Return list of all todos. Workaround because compiler does not recognize function of base class. */ - QPtrList<Todo> todos() { return Calendar::todos(); } + Q3PtrList<Todo> todos() { return Calendar::todos(); } /** Add a Journal entry to calendar. @@ -136,7 +138,7 @@ class CalendarLocal : public Calendar Return Journal for given date. */ Journal *journal( const QDate & ); - QPtrList<Journal> journals4Date( const QDate & ); + Q3PtrList<Journal> journals4Date( const QDate & ); /** Return Journal with given UID. */ @@ -144,7 +146,7 @@ class CalendarLocal : public Calendar /** Return list of all Journals stored in calendar. */ - QPtrList<Journal> journals(); + Q3PtrList<Journal> journals(); /** Return all alarms, which ocur in the given time interval. @@ -174,16 +176,16 @@ class CalendarLocal : public Calendar Builds and then returns a list of all events that match for the date specified. useful for dayView, etc. etc. */ - QPtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ); + Q3PtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ); /** Get unfiltered events for date \a qdt. */ - QPtrList<Event> rawEventsForDate( const QDateTime &qdt ); + Q3PtrList<Event> rawEventsForDate( const QDateTime &qdt ); /** Get unfiltered events in a range of dates. If inclusive is set to true, only events are returned, which are completely included in the range. */ - QPtrList<Event> rawEvents( const QDate &start, const QDate &end, + Q3PtrList<Event> rawEvents( const QDate &start, const QDate &end, bool inclusive = false ); Todo *todo( QString, QString ); Event *event( QString, QString ); @@ -224,9 +226,9 @@ public slots: private: void init(); - QPtrList<Event> mEventList; - QPtrList<Todo> mTodoList; - QPtrList<Journal> mJournalList; + Q3PtrList<Event> mEventList; + Q3PtrList<Todo> mTodoList; + Q3PtrList<Journal> mJournalList; }; } diff --git a/libkcal/calfilter.cpp b/libkcal/calfilter.cpp index 72f70c2..fa1dbd5 100644 --- a/libkcal/calfilter.cpp +++ b/libkcal/calfilter.cpp @@ -21,6 +21,8 @@ #include <kdebug.h> #include "calfilter.h" +//Added by qt3to4: +#include <Q3PtrList> using namespace KCal; @@ -41,7 +43,7 @@ CalFilter::~CalFilter() { } -void CalFilter::apply(QPtrList<Event> *eventlist) +void CalFilter::apply(Q3PtrList<Event> *eventlist) { if (!mEnabled) return; @@ -61,7 +63,7 @@ void CalFilter::apply(QPtrList<Event> *eventlist) } // TODO: avoid duplicating apply() code -void CalFilter::apply(QPtrList<Todo> *eventlist) +void CalFilter::apply(Q3PtrList<Todo> *eventlist) { if (!mEnabled) return; Todo *event = eventlist->first(); diff --git a/libkcal/calfilter.h b/libkcal/calfilter.h index e349770..821149f 100644 --- a/libkcal/calfilter.h +++ b/libkcal/calfilter.h @@ -22,7 +22,7 @@ #define _CALFILTER_H #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include "event.h" #include "todo.h" @@ -55,15 +55,15 @@ class CalFilter { Apply filter to eventlist, all events not matching filter criterias are removed from the list. */ - void apply(QPtrList<Event> *eventlist); + void apply(Q3PtrList<Event> *eventlist); /** Apply filter to todolist, all todos not matching filter criterias are removed from the list. */ - void apply(QPtrList<Todo> *todolist); - bool CalFilter::filterCalendarItem(Incidence *in); - bool CalFilter::filterJournal(Journal *in); + void apply(Q3PtrList<Todo> *todolist); + bool filterCalendarItem(Incidence *in); + bool filterJournal(Journal *in); /** Apply filter criteria on the specified event. Return true, if event passes criteria, otherwise return false. diff --git a/libkcal/customproperties.cpp b/libkcal/customproperties.cpp index adc1710..16f4a28 100644 --- a/libkcal/customproperties.cpp +++ b/libkcal/customproperties.cpp @@ -19,6 +19,8 @@ */ #include "customproperties.h" +//Added by qt3to4: +#include <Q3CString> using namespace KCal; @@ -35,52 +37,52 @@ CustomProperties::~CustomProperties() { } -void CustomProperties::setCustomProperty(const QCString &app, const QCString &key, +void CustomProperties::setCustomProperty(const Q3CString &app, const Q3CString &key, const QString &value) { if (value.isNull() || key.isEmpty() || app.isEmpty()) return; - QCString property = "X-KDE-" + app + "-" + key; + Q3CString property = "X-KDE-" + app + "-" + key; if (!checkName(property)) return; mProperties[property] = value; } -void CustomProperties::removeCustomProperty(const QCString &app, const QCString &key) +void CustomProperties::removeCustomProperty(const Q3CString &app, const Q3CString &key) { - removeNonKDECustomProperty(QCString("X-KDE-" + app + "-" + key)); + removeNonKDECustomProperty(Q3CString("X-KDE-" + app + "-" + key)); } -QString CustomProperties::customProperty(const QCString &app, const QCString &key) const +QString CustomProperties::customProperty(const Q3CString &app, const Q3CString &key) const { - return nonKDECustomProperty(QCString("X-KDE-" + app + "-" + key)); + return nonKDECustomProperty(Q3CString("X-KDE-" + app + "-" + key)); } -void CustomProperties::setNonKDECustomProperty(const QCString &name, const QString &value) +void CustomProperties::setNonKDECustomProperty(const Q3CString &name, const QString &value) { if (value.isNull() || !checkName(name)) return; mProperties[name] = value; } -void CustomProperties::removeNonKDECustomProperty(const QCString &name) +void CustomProperties::removeNonKDECustomProperty(const Q3CString &name) { - QMap<QCString, QString>::Iterator it = mProperties.find(name); + QMap<Q3CString, QString>::Iterator it = mProperties.find(name); if (it != mProperties.end()) mProperties.remove(it); } -QString CustomProperties::nonKDECustomProperty(const QCString &name) const +QString CustomProperties::nonKDECustomProperty(const Q3CString &name) const { - QMap<QCString, QString>::ConstIterator it = mProperties.find(name); + QMap<Q3CString, QString>::ConstIterator it = mProperties.find(name); if (it == mProperties.end()) return QString::null; return it.data(); } -void CustomProperties::setCustomProperties(const QMap<QCString, QString> &properties) +void CustomProperties::setCustomProperties(const QMap<Q3CString, QString> &properties) { - for (QMap<QCString, QString>::ConstIterator it = properties.begin(); it != properties.end(); ++it) { + for (QMap<Q3CString, QString>::ConstIterator it = properties.begin(); it != properties.end(); ++it) { // Validate the property name and convert any null string to empty string if (checkName(it.key())) { mProperties[it.key()] = it.data().isNull() ? QString("") : it.data(); @@ -88,12 +90,12 @@ void CustomProperties::setCustomProperties(const QMap<QCString, QString> &proper } } -QMap<QCString, QString> CustomProperties::customProperties() const +QMap<Q3CString, QString> CustomProperties::customProperties() const { return mProperties; } -bool CustomProperties::checkName(const QCString &name) +bool CustomProperties::checkName(const Q3CString &name) { // Check that the property name starts with 'X-' and contains // only the permitted characters diff --git a/libkcal/customproperties.h b/libkcal/customproperties.h index 0cbfdcd..75eb3ad 100644 --- a/libkcal/customproperties.h +++ b/libkcal/customproperties.h @@ -23,6 +23,8 @@ #include <qstring.h> #include <qmap.h> +//Added by qt3to4: +#include <Q3CString> namespace KCal { @@ -49,47 +51,47 @@ class CustomProperties @param value The property's value. A call with a value of QString::null will be ignored. */ - void setCustomProperty(const QCString &app, const QCString &key, + void setCustomProperty(const Q3CString &app, const Q3CString &key, const QString &value); /** Delete a custom calendar property. @param app Application name as it appears in the custom property name. @param key Property identifier specific to the application. */ - void removeCustomProperty(const QCString &app, const QCString &key); + void removeCustomProperty(const Q3CString &app, const Q3CString &key); /** Return the value of a custom calendar property. @param app Application name as it appears in the custom property name. @param key Property identifier specific to the application. @return Property value, or QString::null if (and only if) the property does not exist. */ - QString customProperty(const QCString &app, const QCString &key) const; + QString customProperty(const Q3CString &app, const Q3CString &key) const; /** Create or modify a non-KDE or non-standard custom calendar property. @param name Full property name @param value The property's value. A call with a value of QString::null will be ignored. */ - void setNonKDECustomProperty(const QCString &name, const QString &value); + void setNonKDECustomProperty(const Q3CString &name, const QString &value); /** Delete a non-KDE or non-standard custom calendar property. @param name Full property name */ - void removeNonKDECustomProperty(const QCString &name); + void removeNonKDECustomProperty(const Q3CString &name); /** Return the value of a non-KDE or non-standard custom calendar property. @param name Full property name @return Property value, or QString::null if (and only if) the property does not exist. */ - QString nonKDECustomProperty(const QCString& name) const; + QString nonKDECustomProperty(const Q3CString& name) const; /** Initialise the alarm's custom calendar properties to the specified key/value pairs. */ - void setCustomProperties(const QMap<QCString, QString> &properties); + void setCustomProperties(const QMap<Q3CString, QString> &properties); /** Return all custom calendar property key/value pairs. */ - QMap<QCString, QString> customProperties() const; + QMap<Q3CString, QString> customProperties() const; private: - static bool checkName(const QCString& name); + static bool checkName(const Q3CString& name); - QMap<QCString, QString> mProperties; // custom calendar properties + QMap<Q3CString, QString> mProperties; // custom calendar properties }; } diff --git a/libkcal/dndfactory.cpp b/libkcal/dndfactory.cpp index cdcfae4..ca7e212 100644 --- a/libkcal/dndfactory.cpp +++ b/libkcal/dndfactory.cpp @@ -22,6 +22,9 @@ #include <qapplication.h> #include <qclipboard.h> +//Added by qt3to4: +#include <QDropEvent> +#include <Q3PtrList> #include <kiconloader.h> #include <kdebug.h> @@ -68,7 +71,7 @@ Event *DndFactory::createDrop(QDropEvent *de) if ( ICalDrag::decode( de, &cal ) || VCalDrag::decode( de, &cal ) ) { de->accept(); - QPtrList<Event> events = cal.events(); + Q3PtrList<Event> events = cal.events(); if ( !events.isEmpty() ) { Event *event = new Event( *events.first() ); return event; @@ -87,7 +90,7 @@ Todo *DndFactory::createDropTodo(QDropEvent *de) if ( ICalDrag::decode( de, &cal ) || VCalDrag::decode( de, &cal ) ) { de->accept(); - QPtrList<Todo> todos = cal.todos(); + Q3PtrList<Todo> todos = cal.todos(); if ( !todos.isEmpty() ) { Todo *todo = new Todo( *todos.first() ); return todo; @@ -133,7 +136,7 @@ Incidence *DndFactory::pasteIncidence(const QDate &newDate, const QTime *newTime return 0; } - QPtrList<Incidence> incList = cal.incidences(); + Q3PtrList<Incidence> incList = cal.incidences(); Incidence *inc = incList.first(); if ( !incList.isEmpty() && inc ) { diff --git a/libkcal/dndfactory.h b/libkcal/dndfactory.h index 2df5259..a873c37 100644 --- a/libkcal/dndfactory.h +++ b/libkcal/dndfactory.h @@ -1,3 +1,5 @@ +//Added by qt3to4: +#include <QDropEvent> /* This file is part of libkcal. diff --git a/libkcal/dndfactory_dummy.h b/libkcal/dndfactory_dummy.h index 44cc114..3ab6adf 100644 --- a/libkcal/dndfactory_dummy.h +++ b/libkcal/dndfactory_dummy.h @@ -25,6 +25,8 @@ #define KCAL_DNDFACTORY_H #include "vcalformat.h" +//Added by qt3to4: +#include <QDropEvent> class QDropEvent; diff --git a/libkcal/dummyscheduler.cpp b/libkcal/dummyscheduler.cpp index ae40e6d..73eb3d0 100644 --- a/libkcal/dummyscheduler.cpp +++ b/libkcal/dummyscheduler.cpp @@ -23,7 +23,9 @@ // #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <Q3PtrList> #include <kdebug.h> @@ -68,8 +70,8 @@ bool DummyScheduler::performTransaction(IncidenceBase *incidence,Method method) bool DummyScheduler::saveMessage(const QString &message) { QFile f("dummyscheduler.store"); - if (f.open(IO_WriteOnly | IO_Append)) { - QTextStream t(&f); + if (f.open(QIODevice::WriteOnly | QIODevice::Append)) { + Q3TextStream t(&f); t << message << endl; f.close(); return true; @@ -78,16 +80,16 @@ bool DummyScheduler::saveMessage(const QString &message) } } -QPtrList<ScheduleMessage> DummyScheduler::retrieveTransactions() +Q3PtrList<ScheduleMessage> DummyScheduler::retrieveTransactions() { - QPtrList<ScheduleMessage> messageList; + Q3PtrList<ScheduleMessage> messageList; QFile f("dummyscheduler.store"); - if (!f.open(IO_ReadOnly)) { + if (!f.open(QIODevice::ReadOnly)) { kdDebug(5800) << "DummyScheduler::retrieveTransactions(): Can't open file" << endl; } else { - QTextStream t(&f); + Q3TextStream t(&f); QString messageString; QString messageLine = t.readLine(); while (!messageLine.isNull()) { diff --git a/libkcal/dummyscheduler.h b/libkcal/dummyscheduler.h index df42153..f86d583 100644 --- a/libkcal/dummyscheduler.h +++ b/libkcal/dummyscheduler.h @@ -24,6 +24,8 @@ // #include "scheduler.h" +//Added by qt3to4: +#include <Q3PtrList> namespace KCal { @@ -39,7 +41,7 @@ class DummyScheduler : public Scheduler { bool publish (IncidenceBase *incidence,const QString &recipients); bool performTransaction(IncidenceBase *incidence,Method method); bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients); - QPtrList<ScheduleMessage> retrieveTransactions(); + Q3PtrList<ScheduleMessage> retrieveTransactions(); protected: bool saveMessage(const QString &); diff --git a/libkcal/event.cpp b/libkcal/event.cpp index fdf5657..060df81 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp @@ -384,7 +384,7 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_ // *ok = false; // return incidenceStart; // } - for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { + for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { if (alarm->enabled()) { if ( alarm->hasTime () ) { if ( alarm->time() < alarmStart ) { diff --git a/libkcal/event.h b/libkcal/event.h index 6a58618..da44f81 100644 --- a/libkcal/event.h +++ b/libkcal/event.h @@ -25,6 +25,8 @@ // #include "incidence.h" +//Added by qt3to4: +#include <Q3CString> namespace KCal { /** @@ -40,7 +42,7 @@ class Event : public Incidence ~Event(); bool matchTime(QDateTime*startDT, QDateTime* endDT); - QCString type() const { return "Event"; } + Q3CString type() const { return "Event"; } IncTypeID typeID() const { return eventID; } Incidence *clone(); diff --git a/libkcal/filestorage.cpp b/libkcal/filestorage.cpp index a139124..3d1309f 100644 --- a/libkcal/filestorage.cpp +++ b/libkcal/filestorage.cpp @@ -22,7 +22,7 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <kdebug.h> diff --git a/libkcal/freebusy.cpp b/libkcal/freebusy.cpp index ba15d6d..e4e9ec9 100644 --- a/libkcal/freebusy.cpp +++ b/libkcal/freebusy.cpp @@ -21,6 +21,9 @@ #include <kdebug.h> #include "freebusy.h" +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PtrList> using namespace KCal; @@ -43,7 +46,7 @@ FreeBusy::FreeBusy( Calendar *calendar, const QDateTime &start, const QDateTime setDtEnd(end); //Gets all the events in the calendar - QPtrList<Event> eventList = mCalendar->events(); + Q3PtrList<Event> eventList = mCalendar->events(); Event *event; int extraDays, i, x, duration; @@ -113,7 +116,7 @@ QDateTime FreeBusy::dtEnd() const return mDtEnd; } -QValueList<Period> FreeBusy::busyPeriods() const +Q3ValueList<Period> FreeBusy::busyPeriods() const { return mBusyPeriods; } @@ -146,14 +149,14 @@ bool FreeBusy::addLocalPeriod(const QDateTime &eventStart, const QDateTime &even return true; } -FreeBusy::FreeBusy(QValueList<Period> busyPeriods) +FreeBusy::FreeBusy(Q3ValueList<Period> busyPeriods) { mBusyPeriods = busyPeriods; } void FreeBusy::sortList() { - typedef QValueList<Period> PeriodList; + typedef Q3ValueList<Period> PeriodList; PeriodList::Iterator tmpPeriod, earlyPeriod; PeriodList sortedList; diff --git a/libkcal/freebusy.h b/libkcal/freebusy.h index d741c72..bd14cb7 100644 --- a/libkcal/freebusy.h +++ b/libkcal/freebusy.h @@ -24,8 +24,10 @@ // #include <qdatetime.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <q3valuelist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <Q3CString> #include "period.h" #include "calendar.h" @@ -43,17 +45,17 @@ class FreeBusy : public IncidenceBase FreeBusy(); FreeBusy(const QDateTime &start, const QDateTime &end); FreeBusy(Calendar *calendar, const QDateTime &start, const QDateTime &end); - FreeBusy(QValueList<Period> busyPeriods); + FreeBusy(Q3ValueList<Period> busyPeriods); ~FreeBusy(); - QCString type() const { return "FreeBusy"; } + Q3CString type() const { return "FreeBusy"; } IncTypeID typeID() const { return freebusyID; } virtual QDateTime dtEnd() const; bool setDtEnd( const QDateTime &end ); - QValueList<Period> busyPeriods() const; + Q3ValueList<Period> busyPeriods() const; void addPeriod(const QDateTime &start, const QDateTime &end); void sortList(); @@ -64,7 +66,7 @@ class FreeBusy : public IncidenceBase bool addLocalPeriod(const QDateTime &start, const QDateTime &end); QDateTime mDtEnd; - QValueList<Period> mBusyPeriods; + Q3ValueList<Period> mBusyPeriods; Calendar *mCalendar; }; diff --git a/libkcal/icaldrag.cpp b/libkcal/icaldrag.cpp index 446a115..7f5a796 100644 --- a/libkcal/icaldrag.cpp +++ b/libkcal/icaldrag.cpp @@ -28,7 +28,7 @@ using namespace KCal; ICalDrag::ICalDrag( Calendar *cal, QWidget *parent, const char *name ) - : QStoredDrag( "text/calendar", parent, name ) + : Q3StoredDrag( "text/calendar", parent, name ) { ICalFormat icf; QString scal = icf.toString( cal ); diff --git a/libkcal/icaldrag.h b/libkcal/icaldrag.h index fdf32b7..c1f73f4 100644 --- a/libkcal/icaldrag.h +++ b/libkcal/icaldrag.h @@ -22,13 +22,13 @@ #ifndef ICALDRAG_H #define ICALDRAG_H -#include <qdragobject.h> +#include <q3dragobject.h> #include "calendar.h" namespace KCal { /** iCalendar drag&drop class. */ -class ICalDrag : public QStoredDrag +class ICalDrag : public Q3StoredDrag { public: /** Create a drag&drop object for iCalendar component \a ical. */ diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp index 6f3a799..3829bc1 100644 --- a/libkcal/icalformat.cpp +++ b/libkcal/icalformat.cpp @@ -20,11 +20,11 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qclipboard.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <stdlib.h> @@ -70,14 +70,14 @@ bool ICalFormat::load( Calendar *calendar, const QString &fileName) clearException(); QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { setException(new ErrorFormat(ErrorFormat::LoadError)); return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); QString text; - ts.setEncoding( QTextStream::Latin1 ); + ts.setEncoding( Q3TextStream::Latin1 ); text = ts.read(); file.close(); @@ -98,14 +98,14 @@ bool ICalFormat::save( Calendar *calendar, const QString &fileName ) // TODO: write backup file //is.restart(); QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { setException(new ErrorFormat(ErrorFormat::SaveError, i18n("Could not open file '%1'").arg(fileName))); return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); - ts.setEncoding( QTextStream::Latin1 ); + ts.setEncoding( Q3TextStream::Latin1 ); ts << text; file.close(); //qDebug("saving file takes ms: %d ", is.elapsed() ); @@ -156,15 +156,15 @@ Incidence *ICalFormat::fromString( const QString &text ) fromString(&cal, text); Incidence *ical = 0; - QPtrList<Event> elist = cal.events(); + Q3PtrList<Event> elist = cal.events(); if ( elist.count() > 0 ) { ical = elist.first(); } else { - QPtrList<Todo> tlist = cal.todos(); + Q3PtrList<Todo> tlist = cal.todos(); if ( tlist.count() > 0 ) { ical = tlist.first(); } else { - QPtrList<Journal> jlist = cal.journals(); + Q3PtrList<Journal> jlist = cal.journals(); if ( jlist.count() > 0 ) { ical = jlist.first(); } @@ -172,7 +172,7 @@ Incidence *ICalFormat::fromString( const QString &text ) } return ical; } -#include <qapp.h> +#include <qapplication.h> QString ICalFormat::toString( Calendar *cal ) { @@ -184,8 +184,8 @@ QString ICalFormat::toString( Calendar *cal ) icalcomponent *component; // todos - QPtrList<Todo> todoList = cal->rawTodos(); - QPtrListIterator<Todo> qlt(todoList); + Q3PtrList<Todo> todoList = cal->rawTodos(); + Q3PtrListIterator<Todo> qlt(todoList); for (; qlt.current(); ++qlt) { component = mImpl->writeTodo(qlt.current()); icalcomponent_add_component(calendar,component); @@ -196,7 +196,7 @@ QString ICalFormat::toString( Calendar *cal ) } } // events - QPtrList<Event> events = cal->rawEvents(); + Q3PtrList<Event> events = cal->rawEvents(); Event *ev; for(ev=events.first();ev;ev=events.next()) { component = mImpl->writeEvent(ev); @@ -207,7 +207,7 @@ QString ICalFormat::toString( Calendar *cal ) } // journals - QPtrList<Journal> journals = cal->journals(); + Q3PtrList<Journal> journals = cal->journals(); Journal *j; for(j=journals.first();j;j=journals.next()) { component = mImpl->writeJournal(j); diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h index a770dbb..a454b35 100644 --- a/libkcal/icalformat.h +++ b/libkcal/icalformat.h @@ -21,6 +21,8 @@ #define ICALFORMAT_H #include <qstring.h> +//Added by qt3to4: +#include <Q3CString> #include "scheduler.h" @@ -106,7 +108,7 @@ class ICalFormat : public CalFormat { bool mProcessEvents; ICalFormatImpl *mImpl; QString mTimeZoneId; - QCString mTzString; + Q3CString mTzString; int tzOffsetMin; bool mUtc; }; diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index 65eabc8..ea144ee 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -20,8 +20,11 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qfile.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3CString> #include <kdebug.h> #include <klocale.h> @@ -221,8 +224,8 @@ icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy, } //Loops through all the periods in the freebusy object - QValueList<Period> list = freebusy->busyPeriods(); - QValueList<Period>::Iterator it; + Q3ValueList<Period> list = freebusy->busyPeriods(); + Q3ValueList<Period>::Iterator it; icalperiodtype period; for (it = list.begin(); it!= list.end(); ++it) { period.start = writeICalDateTime((*it).start()); @@ -384,12 +387,12 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence) } // attachments - QPtrList<Attachment> attachments = incidence->attachments(); + Q3PtrList<Attachment> attachments = incidence->attachments(); for (Attachment *at = attachments.first(); at; at = attachments.next()) icalcomponent_add_property(parent,writeAttachment(at)); // alarms - QPtrList<Alarm> alarms = incidence->alarms(); + Q3PtrList<Alarm> alarms = incidence->alarms(); Alarm* alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next()) { if (alarm->enabled()) { @@ -423,8 +426,8 @@ void ICalFormatImpl::writeIncidenceBase(icalcomponent *parent,IncidenceBase *inc // attendees if (incidenceBase->attendeeCount() != 0) { - QPtrList<Attendee> al = incidenceBase->attendees(); - QPtrListIterator<Attendee> ai(al); + Q3PtrList<Attendee> al = incidenceBase->attendees(); + Q3PtrListIterator<Attendee> ai(al); for (; ai.current(); ++ai) { icalcomponent_add_property(parent,writeAttendee(ai.current())); } @@ -436,8 +439,8 @@ void ICalFormatImpl::writeIncidenceBase(icalcomponent *parent,IncidenceBase *inc void ICalFormatImpl::writeCustomProperties(icalcomponent *parent,CustomProperties *properties) { - QMap<QCString, QString> custom = properties->customProperties(); - for (QMap<QCString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { + QMap<Q3CString, QString> custom = properties->customProperties(); + for (QMap<Q3CString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { icalproperty *p = icalproperty_new_x(c.data().utf8()); icalproperty_set_x_name(p,c.key()); icalcomponent_add_property(parent,p); @@ -546,8 +549,8 @@ icalproperty *ICalFormatImpl::writeRecurrenceRule(Recurrence *recur) int index = 0; int index2 = 0; - QPtrList<Recurrence::rMonthPos> tmpPositions; - QPtrList<int> tmpDays; + Q3PtrList<Recurrence::rMonthPos> tmpPositions; + Q3PtrList<int> tmpDays; int *tmpDay; Recurrence::rMonthPos *tmpPos; bool datetime = false; @@ -704,8 +707,8 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) break; case Alarm::Email: { action = ICAL_ACTION_EMAIL; - QValueList<Person> addresses = alarm->mailAddresses(); - for (QValueList<Person>::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) { + Q3ValueList<Person> addresses = alarm->mailAddresses(); + for (Q3ValueList<Person>::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) { icalproperty *p = icalproperty_new_attendee("MAILTO:" + (*ad).email().utf8()); if (!(*ad).name().isEmpty()) { icalproperty_add_parameter(p,icalparameter_new_cn((*ad).name().utf8())); @@ -763,8 +766,8 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) } // Custom properties - QMap<QCString, QString> custom = alarm->customProperties(); - for (QMap<QCString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { + QMap<Q3CString, QString> custom = alarm->customProperties(); + for (QMap<Q3CString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { icalproperty *p = icalproperty_new_x(c.data().utf8()); icalproperty_set_x_name(p,c.key()); icalcomponent_add_property(a,p); @@ -1339,7 +1342,7 @@ void ICalFormatImpl::readIncidenceBase(icalcomponent *parent,IncidenceBase *inci void ICalFormatImpl::readCustomProperties(icalcomponent *parent,CustomProperties *properties) { - QMap<QCString, QString> customProperties; + QMap<Q3CString, QString> customProperties; icalproperty *p = icalcomponent_get_first_property(parent,ICAL_X_PROPERTY); diff --git a/libkcal/icalformatimpl.h b/libkcal/icalformatimpl.h index 203c302..3a35b4c 100644 --- a/libkcal/icalformatimpl.h +++ b/libkcal/icalformatimpl.h @@ -21,6 +21,8 @@ #define ICALFORMATIMPL_H #include <qstring.h> +//Added by qt3to4: +#include <Q3PtrList> #include "scheduler.h" #include "freebusy.h" @@ -93,8 +95,8 @@ class ICalFormatImpl { QString mLoadedProductId; // PRODID string loaded from calendar file int mCalendarVersion; // determines backward compatibility mode on read - QPtrList<Event> mEventsRelate; // events with relations - QPtrList<Todo> mTodosRelate; // todos with relations + Q3PtrList<Event> mEventsRelate; // events with relations + Q3PtrList<Todo> mTodosRelate; // todos with relations static const int mSecondsPerWeek; static const int mSecondsPerDay; diff --git a/libkcal/imipscheduler.cpp b/libkcal/imipscheduler.cpp index e186f8e..e6d56a6 100644 --- a/libkcal/imipscheduler.cpp +++ b/libkcal/imipscheduler.cpp @@ -26,6 +26,8 @@ #include "icalformat.h" #include "imipscheduler.h" +//Added by qt3to4: +#include <Q3PtrList> using namespace KCal; @@ -50,9 +52,9 @@ bool IMIPScheduler::performTransaction(IncidenceBase *incidence,Method method) return false; } -QPtrList<ScheduleMessage> IMIPScheduler::retrieveTransactions() +Q3PtrList<ScheduleMessage> IMIPScheduler::retrieveTransactions() { - QPtrList<ScheduleMessage> messageList; + Q3PtrList<ScheduleMessage> messageList; return messageList; } diff --git a/libkcal/imipscheduler.h b/libkcal/imipscheduler.h index f142060..5a2d38e 100644 --- a/libkcal/imipscheduler.h +++ b/libkcal/imipscheduler.h @@ -23,7 +23,7 @@ // iMIP implementation of iTIP methods // -#include <qptrlist.h> +#include <q3ptrlist.h> #include "scheduler.h" @@ -40,7 +40,7 @@ class IMIPScheduler : public Scheduler { bool publish (IncidenceBase *incidence,const QString &recipients); bool performTransaction(IncidenceBase *incidence,Method method); - QPtrList<ScheduleMessage> retrieveTransactions(); + Q3PtrList<ScheduleMessage> retrieveTransactions(); }; } diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 7dd9bd2..8fcdc69 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -26,6 +26,8 @@ #include "incidence.h" #include "todo.h" +//Added by qt3to4: +#include <Q3PtrList> using namespace KCal; @@ -59,7 +61,7 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) mRelatedToUid = i.mRelatedToUid; // QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations; mExDates = i.mExDates; - QPtrListIterator<Attachment> itat( i.mAttachments ); + Q3PtrListIterator<Attachment> itat( i.mAttachments ); Attachment *at; while( (at = itat.current()) ) { Attachment *a = new Attachment( *at ); @@ -73,7 +75,7 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) mLocation = i.mLocation; mCancelled = i.mCancelled; mHasStartDate = i.mHasStartDate; - QPtrListIterator<Alarm> it( i.mAlarms ); + Q3PtrListIterator<Alarm> it( i.mAlarms ); const Alarm *a; while( (a = it.current()) ) { Alarm *b = new Alarm( *a ); @@ -98,7 +100,7 @@ Incidence::~Incidence() { Incidence *ev; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (ev=Relations.first();ev;ev=Relations.next()) { if (ev->relatedTo() == this) ev->setRelatedTo(0); } @@ -216,8 +218,8 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) } } #if 0 - QPtrListIterator<Alarm> a1( i1.alarms() ); - QPtrListIterator<Alarm> a2( i2.alarms() ); + Q3PtrListIterator<Alarm> a1( i1.alarms() ); + Q3PtrListIterator<Alarm> a2( i2.alarms() ); for( ; a1.current() && a2.current(); ++a1, ++a2 ) { if( *a1.current() == *a2.current() ) { continue; @@ -322,7 +324,7 @@ void Incidence::cloneRelations( Incidence * newInc ) // newInc is already a clone of this incidence Incidence * inc; Incidence * cloneInc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { cloneInc = inc->clone(); cloneInc->recreate(); @@ -356,7 +358,7 @@ QDateTime Incidence::lastModifiedSub() return mLastModifiedSub; mLastModifiedSub = lastModified(); Incidence * inc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { if ( inc->lastModifiedSub() > mLastModifiedSub ) mLastModifiedSub = inc->lastModifiedSub(); @@ -447,7 +449,7 @@ void Incidence::addCategories(const QStringList &categories, bool addToRelations updated(); if ( addToRelations ) { Incidence * inc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { inc->addCategories( categories, true ); } @@ -462,7 +464,7 @@ void Incidence::setCategories(const QStringList &categories, bool setForRelation updated(); if ( setForRelations ) { Incidence * inc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { inc->setCategories( categories, true ); } @@ -550,15 +552,15 @@ Incidence *Incidence::relatedTo() const return mRelatedTo; } -QPtrList<Incidence> Incidence::relations() const +Q3PtrList<Incidence> Incidence::relations() const { return mRelations; } -void Incidence::addRelationsToList(QPtrList<Incidence> *rel) +void Incidence::addRelationsToList(Q3PtrList<Incidence> *rel) { Incidence* inc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { inc->addRelationsToList( rel ); } @@ -647,15 +649,15 @@ void Incidence::deleteAttachments(const QString& mime) } } -QPtrList<Attachment> Incidence::attachments() const +Q3PtrList<Attachment> Incidence::attachments() const { return mAttachments; } -QPtrList<Attachment> Incidence::attachments(const QString& mime) const +Q3PtrList<Attachment> Incidence::attachments(const QString& mime) const { - QPtrList<Attachment> attachments; - QPtrListIterator<Attachment> it( mAttachments ); + Q3PtrList<Attachment> attachments; + Q3PtrListIterator<Attachment> it( mAttachments ); Attachment *at; while ( (at = it.current()) ) { if (at->mimeType() == mime) @@ -737,7 +739,7 @@ QStringList Incidence::secrecyList() } -QPtrList<Alarm> Incidence::alarms() const +Q3PtrList<Alarm> Incidence::alarms() const { return mAlarms; } @@ -771,7 +773,7 @@ void Incidence::clearAlarms() bool Incidence::isAlarmEnabled() const { Alarm* alarm; - for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { + for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { if (alarm->enabled()) return true; } diff --git a/libkcal/incidence.h b/libkcal/incidence.h index f89942f..2940129 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h @@ -25,7 +25,9 @@ #include <qdatetime.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> +//Added by qt3to4: +#include <Q3PtrList> #include "recurrence.h" #include "alarm.h" @@ -113,7 +115,7 @@ class Incidence : public IncidenceBase virtual Incidence *clone() = 0; virtual void cloneRelations( Incidence * ); - void addRelationsToList(QPtrList<Incidence> *rel); + void addRelationsToList(Q3PtrList<Incidence> *rel); void clearRelations(); virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; void setReadOnly( bool ); @@ -177,7 +179,7 @@ class Incidence : public IncidenceBase /** what event does this one relate to? */ Incidence *relatedTo() const; /** All events that are related to this event */ - QPtrList<Incidence> relations() const; + Q3PtrList<Incidence> relations() const; /** Add an event which is related to this event */ void addRelation(Incidence *); /** Remove event that is related to this event */ @@ -202,9 +204,9 @@ class Incidence : public IncidenceBase /** remove and delete all attachments with this mime type */ void deleteAttachments(const QString& mime); /** return list of all associated attachments */ - QPtrList<Attachment> attachments() const; + Q3PtrList<Attachment> attachments() const; /** find a list of attachments with this mime type */ - QPtrList<Attachment> attachments(const QString& mime) const; + Q3PtrList<Attachment> attachments(const QString& mime) const; /** sets the event's status the value specified. See the enumeration * above for possible values. */ @@ -235,7 +237,7 @@ class Incidence : public IncidenceBase int priority() const; /** All alarms that are associated with this incidence */ - QPtrList<Alarm> alarms() const; + Q3PtrList<Alarm> alarms() const; /** Create a new alarm which is associated with this incidence */ Alarm* newAlarm(); /** Add an alarm which is associated with this incidence */ @@ -288,8 +290,8 @@ class Incidence : public IncidenceBase QString durationText4Time( int secs ); Recurrence *mRecurrence; protected: - QPtrList<Alarm> mAlarms; - QPtrList<Incidence> mRelations; + Q3PtrList<Alarm> mAlarms; + Q3PtrList<Incidence> mRelations; QDateTime mRecurrenceID; bool mHasRecurrenceID; private: @@ -308,7 +310,7 @@ protected: Incidence *mRelatedTo; QString mRelatedToUid; DateList mExDates; - QPtrList<Attachment> mAttachments; + Q3PtrList<Attachment> mAttachments; QStringList mResources; bool mHasStartDate; // if todo has associated start date diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 56c0560..f11ec54 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -27,6 +27,8 @@ #include "syncdefines.h" #include "incidencebase.h" +//Added by qt3to4: +#include <Q3PtrList> using namespace KCal; @@ -64,7 +66,7 @@ IncidenceBase::IncidenceBase(const IncidenceBase &i) : mCalEnabled = i.mCalEnabled; mAlarmEnabled = i.mAlarmEnabled; mCalID = i.mCalID; - QPtrList<Attendee> attendees = i.attendees(); + Q3PtrList<Attendee> attendees = i.attendees(); for( Attendee *a = attendees.first(); a; a = attendees.next() ) { mAttendees.append( new Attendee( *a ) ); } @@ -300,7 +302,7 @@ bool IncidenceBase::addAttendee(Attendee *a, bool doupdate) if (a->name().left(7).upper() == "MAILTO:") a->setName(a->name().remove(0,7)); - QPtrListIterator<Attendee> qli(mAttendees); + Q3PtrListIterator<Attendee> qli(mAttendees); qli.toFirst(); while (qli) { @@ -343,7 +345,7 @@ void IncidenceBase::clearAttendees() #if 0 Attendee *IncidenceBase::getAttendee(const char *n) const { - QPtrListIterator<Attendee> qli(mAttendees); + Q3PtrListIterator<Attendee> qli(mAttendees); qli.toFirst(); while (qli) { @@ -357,7 +359,7 @@ Attendee *IncidenceBase::getAttendee(const char *n) const Attendee *IncidenceBase::attendeeByMail(const QString &email) { - QPtrListIterator<Attendee> qli(mAttendees); + Q3PtrListIterator<Attendee> qli(mAttendees); qli.toFirst(); while (qli) { @@ -370,7 +372,7 @@ Attendee *IncidenceBase::attendeeByMail(const QString &email) Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email) { - QPtrListIterator<Attendee> qli(mAttendees); + Q3PtrListIterator<Attendee> qli(mAttendees); QStringList mails = emails; if (!email.isEmpty()) { @@ -491,7 +493,7 @@ void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer ) void IncidenceBase::updated() { - QPtrListIterator<Observer> it(mObservers); + Q3PtrListIterator<Observer> it(mObservers); while( it.current() ) { Observer *o = it.current(); ++it; diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index 3edc03b..d97f524 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h @@ -25,15 +25,17 @@ #include <qdatetime.h> #include <qstringlist.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <q3valuelist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <Q3CString> #include "customproperties.h" #include "attendee.h" namespace KCal { -typedef QValueList<QDate> DateList; +typedef Q3ValueList<QDate> DateList; enum IncTypeID { eventID,todoID,journalID,freebusyID }; /** @@ -51,7 +53,7 @@ class IncidenceBase : public CustomProperties IncidenceBase(const IncidenceBase &); virtual ~IncidenceBase(); - virtual QCString type() const = 0; + virtual Q3CString type() const = 0; virtual IncTypeID typeID() const = 0; /** Set the unique id for the event */ @@ -109,7 +111,7 @@ class IncidenceBase : public CustomProperties /** Remove all Attendees. */ void clearAttendees(); /** Return list of attendees. */ - QPtrList<Attendee> attendees() const { return mAttendees; }; + Q3PtrList<Attendee> attendees() const { return mAttendees; }; /** Return number of attendees. */ int attendeeCount() const { return mAttendees.count(); }; /** Return the Attendee with this email */ @@ -168,7 +170,7 @@ class IncidenceBase : public CustomProperties bool mCalEnabled; bool mAlarmEnabled; QDateTime mLastModified; - QPtrList<Attendee> mAttendees; + Q3PtrList<Attendee> mAttendees; bool mFloats; @@ -181,7 +183,7 @@ class IncidenceBase : public CustomProperties int mPilotId; // unique id for pilot sync int mSyncStatus; // status (for sync) - QPtrList<Observer> mObservers; + Q3PtrList<Observer> mObservers; }; bool operator==( const IncidenceBase&, const IncidenceBase& ); diff --git a/libkcal/journal.h b/libkcal/journal.h index 1cd0a22..c83356f 100644 --- a/libkcal/journal.h +++ b/libkcal/journal.h @@ -24,6 +24,8 @@ // #include "incidence.h" +//Added by qt3to4: +#include <Q3CString> namespace KCal { @@ -36,7 +38,7 @@ class Journal : public Incidence Journal(); ~Journal(); - QCString type() const { return "Journal"; } + Q3CString type() const { return "Journal"; } IncTypeID typeID() const { return journalID; } Incidence *clone(); diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index 733b897..bce68b0 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -4,6 +4,8 @@ #include <klocale.h> #ifdef DEKTOP_VERSION #include <kabc/stdaddressbook.h> +//Added by qt3to4: +#include <Q3PtrList> #define size count #endif @@ -310,7 +312,7 @@ void KIncidenceFormatter::formatCategories(Incidence *event) } void KIncidenceFormatter::addTag(const QString & tag,const QString & text) { - int number=text.contains("\n"); + int number=text.count("\n"); QString str = "<" + tag + ">"; QString tmpText=text; QString tmpStr=str; @@ -339,7 +341,7 @@ void KIncidenceFormatter::addTag(const QString & tag,const QString & text) void KIncidenceFormatter::formatAttendees(Incidence *event) { - QPtrList<Attendee> attendees = event->attendees(); + Q3PtrList<Attendee> attendees = event->attendees(); if (attendees.count()) { QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); @@ -362,7 +364,7 @@ void KIncidenceFormatter::formatAttendees(Incidence *event) #else mText.append(event->organizer()); #endif - if (iconPath) { + if (!iconPath.isEmpty()) { mText += " <a href=\"mailto:" + event->organizer() + "\">"; mText += "<IMG src=\"" + iconPath + "\">"; mText += "</a>\n"; @@ -402,7 +404,7 @@ void KIncidenceFormatter::formatAttendees(Incidence *event) #endif if (!a->email().isEmpty()) { - if (iconPath) { + if (!iconPath.isEmpty()) { mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; if ( a->RSVP() ) mText += "<IMG src=\"" + iconPath + "\">"; diff --git a/libkcal/libkcal.pro b/libkcal/libkcal.pro index 33c63c3..1f43b10 100644 --- a/libkcal/libkcal.pro +++ b/libkcal/libkcal.pro @@ -1,6 +1,6 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkcal +TARGET = xmicrokcal include( ../variables.pri ) @@ -106,3 +106,7 @@ dndfactory.cpp \ versit/vobject.c \ phoneformat.cpp \ +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +QT += diff --git a/libkcal/libkcalE.pro b/libkcal/libkcalE.pro index 737be53..fe46656 100644 --- a/libkcal/libkcalE.pro +++ b/libkcal/libkcalE.pro @@ -1,6 +1,6 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkcal +TARGET = xmicrokcal INCLUDEPATH += ../libkdepim ../microkde ../qtcompat versit ../microkde/kdecore $(QPEDIR)/include INCLUDEPATH += ../libical/src/libical diff --git a/libkcal/listbase.h b/libkcal/listbase.h index 085b13d..6c942ef 100644 --- a/libkcal/listbase.h +++ b/libkcal/listbase.h @@ -21,7 +21,9 @@ #ifndef KCAL_LISTBASE_H #define KCAL_LISTBASE_H -#include <qvaluelist.h> +#include <q3valuelist.h> +//Added by qt3to4: +#include <Q3PtrList> namespace KCal { class Event; @@ -31,24 +33,24 @@ namespace KCal { *> by auto delete funtionality known from QPtrList. */ template<class T> -class ListBase : public QValueList<T *> +class ListBase : public Q3ValueList<T *> { public: ListBase() - : QValueList<T *>(), mAutoDelete( false ) + : Q3ValueList<T *>(), mAutoDelete( false ) { } ListBase( const ListBase &l ) - : QValueList<T *>( l ), mAutoDelete( false ) + : Q3ValueList<T *>( l ), mAutoDelete( false ) { } ~ListBase() { if ( mAutoDelete ) { - QValueListIterator<T *> it; - for( it = QValueList<T*>::begin(); it != QValueList<T*>::end(); ++it ) { + Q3ValueListIterator<T *> it; + for( it = Q3ValueList<T*>::begin(); it != Q3ValueList<T*>::end(); ++it ) { delete *it; } } @@ -57,7 +59,7 @@ class ListBase : public QValueList<T *> ListBase &operator=( const ListBase &l ) { if ( this == &l ) return *this; - QValueList<T *>::operator=( l ); + Q3ValueList<T *>::operator=( l ); return *this; } @@ -68,8 +70,8 @@ class ListBase : public QValueList<T *> bool removeRef( T *t ) { - QValueListIterator<T *> it = find( t ); - if ( it == QValueList<T*>::end() ) { + Q3ValueListIterator<T *> it = find( t ); + if ( it == Q3ValueList<T*>::end() ) { return false; } else { if ( mAutoDelete ) delete t; @@ -77,8 +79,8 @@ class ListBase : public QValueList<T *> return true; } } - void fill ( QPtrList<T> list ) { - QPtrListIterator<T> it (list); + void fill ( Q3PtrList<T> list ) { + Q3PtrListIterator<T> it (list); T *item; while ( (item = it.current()) != 0 ) { append( item ); diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 900fc04..794e4b4 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -22,15 +22,16 @@ #include <qdatetime.h> #include <qstring.h> #include <qapplication.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qmessagebox.h> #include <qclipboard.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qdir.h> #include <qlabel.h> +#include <QDesktopWidget> #include <kdebug.h> #include <klocale.h> @@ -201,7 +202,7 @@ ulong PhoneFormat::getCsumEvent( Event* event ) writeEndDate = true; { int count = 1; - QPtrList<Recurrence::rMonthPos> rmp; + Q3PtrList<Recurrence::rMonthPos> rmp; rmp = rec->monthPositions(); if ( rmp.first()->negative ) count = 5 - rmp.first()->rPos - 1; @@ -241,7 +242,7 @@ ulong PhoneFormat::getCsumEvent( Event* event ) if ( rec->endDate().isValid() ) { // 15 + 16 list.append( "1" ); - list.append( PhoneParser::dtToString( rec->endDate()) ); + list.append( PhoneParser::dtToString( (QDateTime)rec->endDate()) ); } else { list.append( "0" ); list.append( "20991231T000000" ); @@ -305,7 +306,7 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) if ( ! vfload.load( calendar, fileName ) ) return false; - QPtrList<Event> er = calendar->rawEvents(); + Q3PtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); qDebug("reading events... "); while ( ev ) { @@ -340,7 +341,7 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) } { qDebug("reading todos... "); - QPtrList<Todo> tr = calendar->rawTodos(); + Q3PtrList<Todo> tr = calendar->rawTodos(); Todo* ev = tr.first(); while ( ev ) { @@ -465,7 +466,7 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) to->setPriority(from->priority()); } -#include <qcstring.h> +#include <q3cstring.h> void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum) { @@ -497,7 +498,7 @@ bool PhoneFormat::save( Calendar *calendar) // 1 remove events which should be deleted - QPtrList<Event> er = calendar->rawEvents(); + Q3PtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); while ( ev ) { if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { @@ -508,7 +509,7 @@ bool PhoneFormat::save( Calendar *calendar) ev = er.next(); } // 2 remove todos which should be deleted - QPtrList<Todo> tl = calendar->rawTodos(); + Q3PtrList<Todo> tl = calendar->rawTodos(); Todo* to = tl.first(); while ( to ) { if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { @@ -552,7 +553,7 @@ bool PhoneFormat::save( Calendar *calendar) er = calendar->rawEvents(); ev = er.first(); message = i18n(" Comparing event # "); - QPtrList<Event> er1 = calendarTemp->rawEvents(); + Q3PtrList<Event> er1 = calendarTemp->rawEvents(); Event* ev1; int procCount = 0; while ( ev ) { @@ -580,7 +581,7 @@ bool PhoneFormat::save( Calendar *calendar) tl = calendar->rawTodos(); to = tl.first(); procCount = 0; - QPtrList<Todo> tl1 = calendarTemp->rawTodos(); + Q3PtrList<Todo> tl1 = calendarTemp->rawTodos(); Todo* to1 ; message = i18n(" Comparing todo # "); while ( to ) { diff --git a/libkcal/qtopiaformat.cpp b/libkcal/qtopiaformat.cpp index 0a4a031..2dfe1a4 100644 --- a/libkcal/qtopiaformat.cpp +++ b/libkcal/qtopiaformat.cpp @@ -21,11 +21,11 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qclipboard.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qxml.h> #include <kdebug.h> @@ -309,12 +309,12 @@ bool QtopiaFormat::save( Calendar *calendar, const QString &fileName ) // TODO: write backup file QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { setException(new ErrorFormat(ErrorFormat::SaveError, i18n("Could not open file '%1'").arg(fileName))); return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << text; file.close(); diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp index 6ee5499..9a4e540 100644 --- a/libkcal/recurrence.cpp +++ b/libkcal/recurrence.cpp @@ -29,6 +29,9 @@ #include "incidence.h" #include "recurrence.h" +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PtrList> using namespace KCal; @@ -56,7 +59,7 @@ Recurrence::Recurrence(Incidence *parent, int compatVersion) Recurrence::Recurrence(const Recurrence &r, Incidence *parent) : recurs(r.recurs), rWeekStart(r.rWeekStart), - rDays(r.rDays.copy()), + rDays(r.rDays), rFreq(r.rFreq), rDuration(r.rDuration), rEndDateTime(r.rEndDateTime), @@ -70,19 +73,19 @@ Recurrence::Recurrence(const Recurrence &r, Incidence *parent) mCompatDuration(r.mCompatDuration), mParent(parent) { - for (QPtrListIterator<rMonthPos> mp(r.rMonthPositions); mp.current(); ++mp) { + for (Q3PtrListIterator<rMonthPos> mp(r.rMonthPositions); mp.current(); ++mp) { rMonthPos *tmp = new rMonthPos; tmp->rPos = mp.current()->rPos; tmp->negative = mp.current()->negative; - tmp->rDays = mp.current()->rDays.copy(); + tmp->rDays = mp.current()->rDays; rMonthPositions.append(tmp); } - for (QPtrListIterator<int> md(r.rMonthDays); md.current(); ++md) { + for (Q3PtrListIterator<int> md(r.rMonthDays); md.current(); ++md) { int *tmp = new int; *tmp = *md.current(); rMonthDays.append(tmp); } - for (QPtrListIterator<int> yn(r.rYearNums); yn.current(); ++yn) { + for (Q3PtrListIterator<int> yn(r.rYearNums); yn.current(); ++yn) { int *tmp = new int; *tmp = *yn.current(); rYearNums.append(tmp); @@ -124,8 +127,8 @@ bool Recurrence::operator==( const Recurrence& r2 ) const return rDays == r2.rDays && rWeekStart == r2.rWeekStart; case rMonthlyPos: { - QPtrList<rMonthPos> MonthPositions = rMonthPositions; - QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; + Q3PtrList<rMonthPos> MonthPositions = rMonthPositions; + Q3PtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; if ( !MonthPositions.count() ) return false; if ( !MonthPositions2.count() ) @@ -133,8 +136,8 @@ bool Recurrence::operator==( const Recurrence& r2 ) const return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; } case rMonthlyDay: { - QPtrList<int> MonthDays = rMonthDays ; - QPtrList<int> MonthDays2 = r2.rMonthDays ; + Q3PtrList<int> MonthDays = rMonthDays ; + Q3PtrList<int> MonthDays2 = r2.rMonthDays ; if ( !MonthDays.count() ) return false; if ( !MonthDays2.count() ) @@ -143,12 +146,12 @@ bool Recurrence::operator==( const Recurrence& r2 ) const } case rYearlyPos: { - QPtrList<int> YearNums = rYearNums; - QPtrList<int> YearNums2 = r2.rYearNums; + Q3PtrList<int> YearNums = rYearNums; + Q3PtrList<int> YearNums2 = r2.rYearNums; if ( *YearNums.first() != *YearNums2.first() ) return false; - QPtrList<rMonthPos> MonthPositions = rMonthPositions; - QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; + Q3PtrList<rMonthPos> MonthPositions = rMonthPositions; + Q3PtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; if ( !MonthPositions.count() ) return false; if ( !MonthPositions2.count() ) @@ -157,13 +160,13 @@ bool Recurrence::operator==( const Recurrence& r2 ) const } case rYearlyMonth: { - QPtrList<int> YearNums = rYearNums; - QPtrList<int> YearNums2 = r2.rYearNums; + Q3PtrList<int> YearNums = rYearNums; + Q3PtrList<int> YearNums2 = r2.rYearNums; return ( *YearNums.first() == *YearNums2.first() && mFeb29YearlyType == r2.mFeb29YearlyType); } case rYearlyDay: { - QPtrList<int> YearNums = rYearNums; - QPtrList<int> YearNums2 = r2.rYearNums; + Q3PtrList<int> YearNums = rYearNums; + Q3PtrList<int> YearNums2 = r2.rYearNums; return ( *YearNums.first() == *YearNums2.first() ); } case rNone: @@ -357,7 +360,7 @@ QDateTime Recurrence::endDateTime() const case rHourly: return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*3600); case rDaily: - return dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq); + return (QDateTime)dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq); case rWeekly: count = weeklyCalc(END_DATE_AND_COUNT, end); @@ -506,17 +509,17 @@ const QBitArray &Recurrence::days() const return rDays; } -const QPtrList<Recurrence::rMonthPos> &Recurrence::monthPositions() const +const Q3PtrList<Recurrence::rMonthPos> &Recurrence::monthPositions() const { return rMonthPositions; } -const QPtrList<Recurrence::rMonthPos> &Recurrence::yearMonthPositions() const +const Q3PtrList<Recurrence::rMonthPos> &Recurrence::yearMonthPositions() const { return rMonthPositions; } -const QPtrList<int> &Recurrence::monthDays() const +const Q3PtrList<int> &Recurrence::monthDays() const { return rMonthDays; } @@ -759,7 +762,7 @@ void Recurrence::addYearlyMonthPos(short _rPos, const QBitArray &_rDays) addMonthlyPos_(_rPos, _rDays); } -const QPtrList<int> &Recurrence::yearNums() const +const Q3PtrList<int> &Recurrence::yearNums() const { return rYearNums; } @@ -1047,13 +1050,13 @@ bool Recurrence::recursMonthly(const QDate &qd) const (rDuration == 0 && qd <= rEndDateTime.date()) || rDuration == -1)) { // The date queried falls within the range of the event. - QValueList<int> days; + Q3ValueList<int> days; int daysInMonth = qd.daysInMonth(); if (recurs == rMonthlyDay) getMonthlyDayDays(days, daysInMonth); else if (recurs == rMonthlyPos) getMonthlyPosDays(days, daysInMonth, QDate(year, month, 1).dayOfWeek()); - for (QValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { + for (Q3ValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { if (*it == day) return true; } @@ -1101,7 +1104,7 @@ bool Recurrence::recursYearlyByMonth(const QDate &qd) const rDuration == -1)) { // The date queried falls within the range of the event. int i = qmonth; - for (QPtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { + for (Q3PtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { if (i == *qlin.current()) return true; } @@ -1127,12 +1130,12 @@ bool Recurrence::recursYearlyByPos(const QDate &qd) const (rDuration == 0 && qd <= rEndDateTime.date()) || rDuration == -1)) { // The date queried falls within the range of the event. - for (QPtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { + for (Q3PtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { if (month == *qlin.current()) { // The month recurs - QValueList<int> days; + Q3ValueList<int> days; getMonthlyPosDays(days, qd.daysInMonth(), QDate(year, month, 1).dayOfWeek()); - for (QValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { + for (Q3ValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { if (*it == day) return true; } @@ -1157,7 +1160,7 @@ bool Recurrence::recursYearlyByDay(const QDate &qd) const rDuration == -1)) { // The date queried falls within the range of the event. int i = qd.dayOfYear(); - for (QPtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { + for (Q3PtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { if (i == *qlin.current()) return true; } @@ -1549,7 +1552,7 @@ int Recurrence::recurCalc(PeriodFunc func, QDate &enddate) const case END_DATE_AND_COUNT: case NEXT_AFTER_DATE: if (count == 0) - endtime = QDate(); + endtime = QDateTime(); else if (timed) enddate = endtime.date(); break; @@ -1793,8 +1796,8 @@ struct Recurrence::MonthlyData { int day; // current day of month 1..31 bool varies; // true if recurring days vary between different months private: - QValueList<int> days28, days29, days30, days31; // recurring days in months of each length - QValueList<int> *recurDays[4]; + Q3ValueList<int> days28, days29, days30, days31; // recurring days in months of each length + Q3ValueList<int> *recurDays[4]; public: MonthlyData(const Recurrence* r, const QDate &date) : recurrence(r), year(date.year()), month(date.month()-1), day(date.day()) @@ -1805,12 +1808,12 @@ struct Recurrence::MonthlyData { varies = (recurrence->recurs == rMonthlyPos) ? true : recurrence->getMonthlyDayDays(days31, 31); } - const QValueList<int>* dayList() const { + const Q3ValueList<int>* dayList() const { if (!varies) return &days31; QDate startOfMonth(year, month + 1, 1); int daysInMonth = startOfMonth.daysInMonth(); - QValueList<int>* days = recurDays[daysInMonth - 28]; + Q3ValueList<int>* days = recurDays[daysInMonth - 28]; if (recurrence->recurs == rMonthlyPos) recurrence->getMonthlyPosDays(*days, daysInMonth, startOfMonth.dayOfWeek()); else if (days->isEmpty()) @@ -1844,8 +1847,8 @@ int Recurrence::monthlyCalcEndDate(QDate &enddate, MonthlyData &data) const { uint countTogo = rDuration + mRecurExDatesCount; int countGone = 0; - QValueList<int>::ConstIterator it; - const QValueList<int>* days = data.dayList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* days = data.dayList(); if (data.day > 1) { // Check what remains of the start month @@ -1910,8 +1913,8 @@ int Recurrence::monthlyCalcToDate(const QDate &enddate, MonthlyData &data) const int endMonth = enddate.month() - 1; // zero-based int endDay = enddate.day(); int endYearMonth = endYear*12 + endMonth; - QValueList<int>::ConstIterator it; - const QValueList<int>* days = data.dayList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* days = data.dayList(); if (data.day > 1) { // Check what remains of the start month @@ -1969,8 +1972,8 @@ int Recurrence::monthlyCalcNextAfter(QDate &enddate, MonthlyData &data) const int endYear = enddate.year(); int endDay = enddate.day(); int endYearMonth = endYear*12 + enddate.month() - 1; - QValueList<int>::ConstIterator it; - const QValueList<int>* days = data.dayList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* days = data.dayList(); if (data.day > 1) { // Check what remains of the start month @@ -2052,17 +2055,17 @@ struct Recurrence::YearlyMonthData { bool leapyear; // true if February 29th recurs and current year is a leap year bool feb29; // true if February 29th recurs private: - QValueList<int> months; // recurring months in non-leap years 1..12 - QValueList<int> leapMonths; // recurring months in leap years 1..12 + Q3ValueList<int> months; // recurring months in non-leap years 1..12 + Q3ValueList<int> leapMonths; // recurring months in leap years 1..12 public: YearlyMonthData(const Recurrence* r, const QDate &date) : recurrence(r), year(date.year()), month(date.month()), day(date.day()) { feb29 = recurrence->getYearlyMonthMonths(day, months, leapMonths); leapyear = feb29 && QDate::leapYear(year); } - const QValueList<int>* monthList() const + const Q3ValueList<int>* monthList() const { return leapyear ? &leapMonths : &months; } - const QValueList<int>* leapMonthList() const { return &leapMonths; } + const Q3ValueList<int>* leapMonthList() const { return &leapMonths; } QDate date() const { return QDate(year, month, day); } }; @@ -2088,8 +2091,8 @@ int Recurrence::yearlyMonthCalcEndDate(QDate &enddate, YearlyMonthData &data) co { uint countTogo = rDuration + mRecurExDatesCount; int countGone = 0; - QValueList<int>::ConstIterator it; - const QValueList<int>* mons = data.monthList(); // get recurring months for this year + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* mons = data.monthList(); // get recurring months for this year if (data.month > 1) { // Check what remains of the start year @@ -2199,8 +2202,8 @@ int Recurrence::yearlyMonthCalcToDate(const QDate &enddate, YearlyMonthData &dat --endYear; } } - QValueList<int>::ConstIterator it; - const QValueList<int>* mons = data.monthList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* mons = data.monthList(); if (data.month > 1) { // Check what remains of the start year @@ -2270,8 +2273,8 @@ int Recurrence::yearlyMonthCalcNextAfter(QDate &enddate, YearlyMonthData &data) --endYear; } } - QValueList<int>::ConstIterator it; - const QValueList<int>* mons = data.monthList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* mons = data.monthList(); if (data.month > 1) { // Check what remains of the start year @@ -2390,7 +2393,7 @@ struct Recurrence::YearlyPosData { int count; // number of days which recur each year, or -1 if variable bool varies; // true if number of days varies from year to year private: - mutable QValueList<int> days; + mutable Q3ValueList<int> days; public: YearlyPosData(const Recurrence* r, const QDate &date) : recurrence(r), year(date.year()), month(date.month()), day(date.day()), count(-1) @@ -2398,7 +2401,7 @@ struct Recurrence::YearlyPosData { count = daysPerMonth * r->rYearNums.count(); varies = (daysPerMonth < 0); } - const QValueList<int>* dayList() const { + const Q3ValueList<int>* dayList() const { QDate startOfMonth(year, month, 1); recurrence->getMonthlyPosDays(days, startOfMonth.daysInMonth(), startOfMonth.dayOfWeek()); return &days; @@ -2428,12 +2431,12 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const { uint countTogo = rDuration + mRecurExDatesCount; int countGone = 0; - QValueList<int>::ConstIterator id; - const QValueList<int>* days; + Q3ValueList<int>::ConstIterator id; + const Q3ValueList<int>* days; if (data.month > 1 || data.day > 1) { // Check what remains of the start year - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (*im.current() >= data.month) { // Check what remains of the start month if (data.day > 1 || data.varies @@ -2466,7 +2469,7 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const if (data.varies) { // The number of recurrences varies from year to year. for ( ; ; ) { - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { data.month = *im.current(); days = data.dayList(); int n = days->count(); @@ -2496,7 +2499,7 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const countTogo -= wholeYears * data.count; // Check the last year in the recurrence. - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (static_cast<uint>(data.daysPerMonth) >= countTogo) { // Check the last month in the recurrence data.month = *im.current(); @@ -2531,12 +2534,12 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c --endYear; } int endYearMonth = endYear*12 + endMonth; - QValueList<int>::ConstIterator id; - const QValueList<int>* days; + Q3ValueList<int>::ConstIterator id; + const Q3ValueList<int>* days; if (data.month > 1 || data.day > 1) { // Check what remains of the start year - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (*im.current() >= data.month) { data.month = *im.current(); if (data.yearMonth() > endYearMonth) @@ -2576,7 +2579,7 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c if (data.varies) { // The number of recurrences varies from year to year. for ( ; ; ) { - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { data.month = *im.current(); days = data.dayList(); if (data.yearMonth() >= endYearMonth) { @@ -2611,7 +2614,7 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c data.year = endYear; // Check the last year in the recurrence. - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { data.month = *im.current(); if (data.month >= endMonth) { if (data.month > endMonth) @@ -2646,14 +2649,14 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons --endYear; } int endYearMonth = endYear*12 + endMonth; - QValueList<int>::ConstIterator id; - const QValueList<int>* days; + Q3ValueList<int>::ConstIterator id; + const Q3ValueList<int>* days; if (data.varies) { // The number of recurrences varies from year to year. for ( ; ; ) { // Check the next year - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (*im.current() >= data.month) { // Check the next month data.month = *im.current(); @@ -2689,7 +2692,7 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons // The number of recurrences is the same every year. if (data.month > 1 || data.day > 1) { // Check what remains of the start year - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (*im.current() >= data.month) { // Check what remains of the start month data.month = *im.current(); @@ -2734,7 +2737,7 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons } // Check the last year in the recurrence - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { data.month = *im.current(); int ended = data.yearMonth() - endYearMonth; if (ended >= 0) { @@ -2808,7 +2811,7 @@ int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const if (data.day > 1) { // Check what remains of the start year bool leapOK = data.isMaxDayCount(); - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { int d = *it.current(); if (d >= data.day && (leapOK || d < 366)) { ++countGone; @@ -2846,7 +2849,7 @@ int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const } if (countTogo) { // Check the last year in the recurrence - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { ++countGone; if (--countTogo == 0) { data.day = *it.current(); @@ -2869,7 +2872,7 @@ int Recurrence::yearlyDayCalcToDate(const QDate &enddate, YearlyDayData &data) c if (data.day > 1) { // Check what remains of the start year bool leapOK = data.isMaxDayCount(); - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { int d = *it.current(); if (d >= data.day && (leapOK || d < 366)) { if (data.year == endYear && d > endDay) @@ -2908,7 +2911,7 @@ int Recurrence::yearlyDayCalcToDate(const QDate &enddate, YearlyDayData &data) c if (data.year <= endYear) { // Check the last year in the recurrence - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { if (*it.current() > endDay) return countGone; if (++countGone >= countMax) @@ -2928,7 +2931,7 @@ int Recurrence::yearlyDayCalcNextAfter(QDate &enddate, YearlyDayData &data) cons if (data.day > 1) { // Check what remains of the start year bool leapOK = data.isMaxDayCount(); - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { int d = *it.current(); if (d >= data.day && (leapOK || d < 366)) { ++countGone; @@ -2977,7 +2980,7 @@ int Recurrence::yearlyDayCalcNextAfter(QDate &enddate, YearlyDayData &data) cons } // Check the last year in the recurrence - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { ++countGone; int d = *it.current(); if (data.year > endYear || d > endDay) { @@ -2995,13 +2998,13 @@ ex: // Get the days in this month which recur, in numerical order. // Parameters: daysInMonth = number of days in this month // startDayOfWeek = day of week for first day of month. -void Recurrence::getMonthlyPosDays(QValueList<int> &list, int daysInMonth, int startDayOfWeek) const +void Recurrence::getMonthlyPosDays(Q3ValueList<int> &list, int daysInMonth, int startDayOfWeek) const { list.clear(); int endDayOfWeek = (startDayOfWeek + daysInMonth - 2) % 7 + 1; // Go through the list, compiling a bit list of actual day numbers Q_UINT32 days = 0; - for (QPtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { + for (Q3PtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { int weeknum = pos.current()->rPos - 1; // get 0-based week number QBitArray &rdays = pos.current()->rDays; if (pos.current()->negative) { @@ -3039,7 +3042,7 @@ int Recurrence::countMonthlyPosDays() const int count = 0; Q_UINT8 positive[5] = { 0, 0, 0, 0, 0 }; Q_UINT8 negative[4] = { 0, 0, 0, 0 }; - for (QPtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { + for (Q3PtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { int weeknum = pos.current()->rPos; Q_UINT8* wk; if (pos.current()->negative) { @@ -3072,12 +3075,12 @@ int Recurrence::countMonthlyPosDays() const // Get the days in this month which recur, in numerical order. // Reply = true if day numbers varies from month to month. -bool Recurrence::getMonthlyDayDays(QValueList<int> &list, int daysInMonth) const +bool Recurrence::getMonthlyDayDays(Q3ValueList<int> &list, int daysInMonth) const { list.clear(); bool variable = false; Q_UINT32 days = 0; - for (QPtrListIterator<int> it(rMonthDays); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rMonthDays); it.current(); ++it) { int day = *it.current(); if (day > 0) { // date in the month @@ -3106,12 +3109,12 @@ bool Recurrence::getMonthlyDayDays(QValueList<int> &list, int daysInMonth) const // N.B. If February 29th recurs on March 1st in non-leap years, February (not March) is // included in the non-leap year month list. // Reply = true if February 29th also recurs. -bool Recurrence::getYearlyMonthMonths(int day, QValueList<int> &list, QValueList<int> &leaplist) const +bool Recurrence::getYearlyMonthMonths(int day, Q3ValueList<int> &list, Q3ValueList<int> &leaplist) const { list.clear(); leaplist.clear(); bool feb29 = false; - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { int month = *it.current(); if (month == 2) { if (day <= 28) { @@ -3187,7 +3190,7 @@ QDate Recurrence::getFirstDateInMonth(const QDate &earliestDate) const switch (recurs) { case rMonthlyDay: { int minday = daysInMonth + 1; - for (QPtrListIterator<int> it(rMonthDays); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rMonthDays); it.current(); ++it) { int day = *it.current(); if (day < 0) day = daysInMonth + day + 1; @@ -3201,9 +3204,9 @@ QDate Recurrence::getFirstDateInMonth(const QDate &earliestDate) const case rMonthlyPos: case rYearlyPos: { QDate monthBegin(earliestDate.addDays(1 - earliestDay)); - QValueList<int> dayList; + Q3ValueList<int> dayList; getMonthlyPosDays(dayList, daysInMonth, monthBegin.dayOfWeek()); - for (QValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { + for (Q3ValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { if (*id >= earliestDay) return monthBegin.addDays(*id - 1); } @@ -3224,7 +3227,7 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const switch (recurs) { case rMonthlyDay: { int maxday = -1; - for (QPtrListIterator<int> it(rMonthDays); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rMonthDays); it.current(); ++it) { int day = *it.current(); if (day < 0) day = daysInMonth + day + 1; @@ -3238,9 +3241,9 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const case rMonthlyPos: case rYearlyPos: { QDate monthBegin(latestDate.addDays(1 - latestDay)); - QValueList<int> dayList; + Q3ValueList<int> dayList; getMonthlyPosDays(dayList, daysInMonth, monthBegin.dayOfWeek()); - for (QValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { + for (Q3ValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { if (*id <= latestDay) return monthBegin.addDays(*id - 1); } @@ -3256,7 +3259,7 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const */ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const { - QPtrListIterator<int> it(rYearNums); + Q3PtrListIterator<int> it(rYearNums); switch (recurs) { case rYearlyMonth: { int day = recurStart().date().day(); @@ -3292,7 +3295,7 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const break; } case rYearlyPos: { - QValueList<int> dayList; + Q3ValueList<int> dayList; int earliestYear = earliestDate.year(); int earliestMonth = earliestDate.month(); int earliestDay = earliestDate.day(); @@ -3301,7 +3304,7 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const if (month >= earliestMonth) { QDate monthBegin(earliestYear, month, 1); getMonthlyPosDays(dayList, monthBegin.daysInMonth(), monthBegin.dayOfWeek()); - for (QValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { + for (Q3ValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { if (*id >= earliestDay) return monthBegin.addDays(*id - 1); } @@ -3329,7 +3332,7 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const */ QDate Recurrence::getLastDateInYear(const QDate &latestDate) const { - QPtrListIterator<int> it(rYearNums); + Q3PtrListIterator<int> it(rYearNums); switch (recurs) { case rYearlyMonth: { int day = recurStart().date().day(); @@ -3364,7 +3367,7 @@ QDate Recurrence::getLastDateInYear(const QDate &latestDate) const break; } case rYearlyPos: { - QValueList<int> dayList; + Q3ValueList<int> dayList; int latestYear = latestDate.year(); int latestMonth = latestDate.month(); int latestDay = latestDate.day(); @@ -3373,7 +3376,7 @@ QDate Recurrence::getLastDateInYear(const QDate &latestDate) const if (month <= latestMonth) { QDate monthBegin(latestYear, month, 1); getMonthlyPosDays(dayList, monthBegin.daysInMonth(), monthBegin.dayOfWeek()); - for (QValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { + for (Q3ValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { if (*id <= latestDay) return monthBegin.addDays(*id - 1); } diff --git a/libkcal/recurrence.h b/libkcal/recurrence.h index b13d14f..5b5aab1 100644 --- a/libkcal/recurrence.h +++ b/libkcal/recurrence.h @@ -24,7 +24,9 @@ #include <qstring.h> #include <qbitarray.h> -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <Q3ValueList> namespace KCal { @@ -248,9 +250,9 @@ class Recurrence */ void addMonthlyDay(short _rDay); /** Returns list of day positions in months. */ - const QPtrList<rMonthPos> &monthPositions() const; + const Q3PtrList<rMonthPos> &monthPositions() const; /** Returns list of day numbers of a month. */ - const QPtrList<int> &monthDays() const; + const Q3PtrList<int> &monthDays() const; /** Sets an event to recur yearly. * @var type rYearlyMonth, rYearlyPos or rYearlyDay @@ -279,9 +281,9 @@ class Recurrence */ void addYearlyMonthPos(short _rPos, const QBitArray &_rDays); /** Returns positions of days or months in year. */ - const QPtrList<int> &yearNums() const; + const Q3PtrList<int> &yearNums() const; /** Returns list of day positions in months, for a recursYearlyPos recurrence rule. */ - const QPtrList<rMonthPos> &yearMonthPositions() const; + const Q3PtrList<rMonthPos> &yearMonthPositions() const; /** Returns how yearly recurrences of February 29th are handled. */ Feb29Type feb29YearlyType() const { return mFeb29YearlyType; } /** Sets the default method for handling yearly recurrences of February 29th. */ @@ -294,8 +296,8 @@ class Recurrence */ void dump() const; QString recurrenceText() const; - bool getYearlyMonthMonths(int day, QValueList<int>&, - QValueList<int> &leaplist) const; + bool getYearlyMonthMonths(int day, Q3ValueList<int>&, + Q3ValueList<int> &leaplist) const; protected: enum PeriodFunc { END_DATE_AND_COUNT, COUNT_TO_DATE, NEXT_AFTER_DATE }; @@ -345,9 +347,9 @@ class Recurrence int yearlyDayCalcNextAfter(QDate& enddate, YearlyDayData&) const; int countMonthlyPosDays() const; - void getMonthlyPosDays(QValueList<int>&, int daysInMonth, + void getMonthlyPosDays(Q3ValueList<int>&, int daysInMonth, int startDayOfWeek) const; - bool getMonthlyDayDays(QValueList<int>&, int daysInMonth) const; + bool getMonthlyDayDays(Q3ValueList<int>&, int daysInMonth) const; int getFirstDayInWeek(int startDay, bool useWeekStart = true) const; int getLastDayInWeek(int endDay, bool useWeekStart = true) const; @@ -366,13 +368,13 @@ class Recurrence int rWeekStart; // day which starts the week, Monday=1 .. Sunday=7 QBitArray rDays; // array of days during week it recurs - QPtrList<rMonthPos> rMonthPositions; // list of positions during a month + Q3PtrList<rMonthPos> rMonthPositions; // list of positions during a month // on which an event recurs - QPtrList<int> rMonthDays; // list of days during a month on + Q3PtrList<int> rMonthDays; // list of days during a month on // which the event recurs - QPtrList<int> rYearNums; // either months/days to recur on for rYearly, + Q3PtrList<int> rYearNums; // either months/days to recur on for rYearly, // sorted in numerical order int rFreq; // frequency of period diff --git a/libkcal/scheduler.cpp b/libkcal/scheduler.cpp index 253d8b7..234cfcf 100644 --- a/libkcal/scheduler.cpp +++ b/libkcal/scheduler.cpp @@ -20,7 +20,9 @@ #include <qdir.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <Q3PtrList> #include <klocale.h> #include <kdebug.h> @@ -264,8 +266,8 @@ bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status sta if (ev || to) { //get matching attendee in calendar kdDebug(5800) << "Scheduler::acceptTransaction match found!" << endl; - QPtrList<Attendee> attendeesIn = incidence->attendees(); - QPtrList<Attendee> attendeesEv; + Q3PtrList<Attendee> attendeesIn = incidence->attendees(); + Q3PtrList<Attendee> attendeesEv; if (ev) attendeesEv = ev->attendees(); if (to) attendeesEv = to->attendees(); Attendee *attIn; @@ -342,11 +344,11 @@ bool Scheduler::acceptFreeBusy(IncidenceBase *incidence, Method method) QString messageText = mFormat->createScheduleMessage(freebusy, Publish); - if (!f.open(IO_ReadWrite)) { + if (!f.open(QIODevice::ReadWrite)) { kdDebug() << "acceptFreeBusy: Can't open:" << filename << " for writing" << endl; return false; } - QTextStream t(&f); + Q3TextStream t(&f); t << messageText; f.close(); diff --git a/libkcal/scheduler.h b/libkcal/scheduler.h index a9f43b9..357e98e 100644 --- a/libkcal/scheduler.h +++ b/libkcal/scheduler.h @@ -23,7 +23,7 @@ // iTIP transactions base class #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> namespace KCal { @@ -95,7 +95,7 @@ class Scheduler { method. */ virtual bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients) = 0; /** Retrieve incoming iTIP transactions */ - virtual QPtrList<ScheduleMessage> retrieveTransactions() = 0; + virtual Q3PtrList<ScheduleMessage> retrieveTransactions() = 0; /** Accept transaction. The incidence argument specifies the iCal compoennt diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index 9b757f7..b8c2aa7 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -22,12 +22,12 @@ #include <qdatetime.h> #include <qstring.h> #include <qapplication.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qmessagebox.h> #include <qclipboard.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qxml.h> #include <qlabel.h> @@ -366,11 +366,11 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) } QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); text = ts.read(); file.close(); @@ -388,7 +388,7 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) fileName = "/tmp/todo.txt"; } file.setName( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } @@ -475,7 +475,7 @@ bool SharpFormat::save( Calendar *calendar) QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n"; QString tPrefix = "CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1\n"; QString command; - QPtrList<Event> er = calendar->rawEvents(); + Q3PtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); QString fileName = "/tmp/kopitempout"; int i = 0; @@ -503,10 +503,10 @@ bool SharpFormat::save( Calendar *calendar) else if ( ev->getID("Sharp_DTM").isEmpty() ) { // add new QString fileNameIn = "/tmp/kopitempin"; QFile fileIn( fileNameIn ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << ePrefix << eString ; fileIn.close(); @@ -517,11 +517,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("command -------- "); system ( command.utf8() ); QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); answer = ts.read(); file.close(); @@ -544,11 +544,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("changing... "); if ( changeEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << changeString ; file.close(); @@ -562,11 +562,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("deleting... "); if ( deleteEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << deleteString; file.close(); @@ -580,7 +580,7 @@ bool SharpFormat::save( Calendar *calendar) deleteString = tPrefix; status.setText ( i18n("Processing todos ...") ); qApp->processEvents(); - QPtrList<Todo> tl = calendar->rawTodos(); + Q3PtrList<Todo> tl = calendar->rawTodos(); Todo* to = tl.first(); i = 0; message = i18n("Processing todo # "); @@ -605,20 +605,20 @@ bool SharpFormat::save( Calendar *calendar) QString fileNameIn = "/tmp/kopitempin"; QFile fileIn( fileNameIn ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << tPrefix << eString ; fileIn.close(); command = "(cat /tmp/kopitempin | db2file todo -w -g -c " + codec+ ") > "+ fileName; system ( command.utf8() ); QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); answer = ts.read(); file.close(); @@ -642,11 +642,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("changing... "); if ( changeEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << changeString ; file.close(); @@ -660,11 +660,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("deleting... "); if ( deleteEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << deleteString; file.close(); @@ -783,7 +783,7 @@ QString SharpFormat::getEventString( Event* event ) writeEndDate = true; { int count = 1; - QPtrList<Recurrence::rMonthPos> rmp; + Q3PtrList<Recurrence::rMonthPos> rmp; rmp = rec->monthPositions(); if ( rmp.first()->negative ) count = 5 - rmp.first()->rPos - 1; diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index cc1c5ae..5a0c32e 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -623,7 +623,7 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_d // *ok = false; // return incidenceStart; // } - for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { + for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { if (alarm->enabled()) { if ( alarm->hasTime () ) { if ( alarm->time() < alarmStart ) { diff --git a/libkcal/todo.h b/libkcal/todo.h index 2131732..cea976c 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h @@ -26,6 +26,8 @@ #include "incidence.h" #include <qtimer.h> +//Added by qt3to4: +#include <Q3CString> namespace KCal { @@ -40,7 +42,7 @@ namespace KCal { Todo(const Todo &); ~Todo(); typedef ListBase<Todo> List; - QCString type() const { return "Todo"; } + Q3CString type() const { return "Todo"; } IncTypeID typeID() const { return todoID; } /** Return an exact copy of this todo. */ diff --git a/libkcal/vcaldrag.cpp b/libkcal/vcaldrag.cpp index f01f332..324981e 100644 --- a/libkcal/vcaldrag.cpp +++ b/libkcal/vcaldrag.cpp @@ -26,7 +26,7 @@ using namespace KCal; VCalDrag::VCalDrag( Calendar *cal, QWidget *parent, const char *name ) - : QStoredDrag( "text/x-vCalendar", parent, name ) + : Q3StoredDrag( "text/x-vCalendar", parent, name ) { VCalFormat format; setEncodedData( format.toString( cal ).utf8() ); diff --git a/libkcal/vcaldrag.h b/libkcal/vcaldrag.h index 3048124..68a320d 100644 --- a/libkcal/vcaldrag.h +++ b/libkcal/vcaldrag.h @@ -22,7 +22,7 @@ #ifndef VCALDRAG_H #define VCALDRAG_H -#include <qdragobject.h> +#include <q3dragobject.h> namespace KCal { @@ -30,7 +30,7 @@ namespace KCal { class Calendar; /** vCalendar drag&drop class. */ -class VCalDrag : public QStoredDrag { +class VCalDrag : public Q3StoredDrag { public: /** Create a drag&drop object for vCalendar component \a vcal. */ VCalDrag( Calendar *vcal, QWidget *parent = 0, const char *name = 0 ); diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index 2e19740..9cbaf16 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp @@ -22,11 +22,13 @@ #include <qapplication.h> #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qclipboard.h> #include <qdialog.h> #include <qfile.h> +//Added by qt3to4: +#include <Q3CString> #include <kdebug.h> #include <kglobal.h> @@ -108,15 +110,15 @@ bool VCalFormat::save(Calendar *calendar, const QString &fileName) addPropValue(vcal,VCVersionProp, _VCAL_VERSION); // TODO STUFF - QPtrList<Todo> todoList = mCalendar->rawTodos(); - QPtrListIterator<Todo> qlt(todoList); + Q3PtrList<Todo> todoList = mCalendar->rawTodos(); + Q3PtrListIterator<Todo> qlt(todoList); for (; qlt.current(); ++qlt) { vo = eventToVTodo(qlt.current()); addVObjectProp(vcal, vo); } // EVENT STUFF - QPtrList<Event> events = mCalendar->rawEvents(); + Q3PtrList<Event> events = mCalendar->rawEvents(); Event *ev; for(ev=events.first();ev;ev=events.next()) { vo = eventToVEvent(ev); @@ -138,7 +140,7 @@ bool VCalFormat::fromString( Calendar *calendar, const QString &text ) { // TODO: Factor out VCalFormat::fromString() - QCString data = text.utf8(); + Q3CString data = text.utf8(); if ( !data.size() ) return false; @@ -210,7 +212,7 @@ QString VCalFormat::toString( Calendar *calendar ) addPropValue( vcal, VCVersionProp, _VCAL_VERSION ); // TODO: Use all data. - QPtrList<Event> events = calendar->events(); + Q3PtrList<Event> events = calendar->events(); Event *event = events.first(); if ( !event ) return QString::null; @@ -271,8 +273,8 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) // attendees if (anEvent->attendeeCount() != 0) { - QPtrList<Attendee> al = anEvent->attendees(); - QPtrListIterator<Attendee> ai(al); + Q3PtrList<Attendee> al = anEvent->attendees(); + Q3PtrListIterator<Attendee> ai(al); Attendee *curAttendee; for (; ai.current(); ++ai) { @@ -326,7 +328,7 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit()); // related event - if (anEvent->relatedToUid()) { + if (!anEvent->relatedToUid().isEmpty()) { addPropValue(vtodo, VCRelatedToProp, anEvent->relatedToUid().local8Bit()); } @@ -355,7 +357,7 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) // alarm stuff kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl; - QPtrList<Alarm> alarms = anEvent->alarms(); + Q3PtrList<Alarm> alarms = anEvent->alarms(); Alarm* alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next()) { if (alarm->enabled()) { @@ -433,8 +435,8 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) addPropValue(vevent, ICOrganizerProp, tmpStr.local8Bit()); if (anEvent->attendeeCount() != 0) { - QPtrList<Attendee> al = anEvent->attendees(); - QPtrListIterator<Attendee> ai(al); + Q3PtrList<Attendee> al = anEvent->attendees(); + Q3PtrListIterator<Attendee> ai(al); Attendee *curAttendee; // TODO: Put this functionality into Attendee class @@ -461,8 +463,8 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) // recurrence rule stuff if (anEvent->doesRecur()) { // some more variables - QPtrList<Recurrence::rMonthPos> tmpPositions; - QPtrList<int> tmpDays; + Q3PtrList<Recurrence::rMonthPos> tmpPositions; + Q3PtrList<int> tmpDays; int *tmpDay; Recurrence::rMonthPos *tmpPos; QString tmpStr2; @@ -545,7 +547,7 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) } else if (anEvent->recurrence()->duration() == -1) { tmpStr += "#0"; // defined as repeat forever } else { - tmpStr += qDateTimeToISO(anEvent->recurrence()->endDate(), FALSE); + tmpStr += qDateTimeToISO((QDateTime)anEvent->recurrence()->endDate(), FALSE); } addPropValue(vevent,VCRRuleProp, tmpStr.local8Bit()); @@ -625,7 +627,7 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) // attachments // TODO: handle binary attachments! - QPtrList<Attachment> attachments = anEvent->attachments(); + Q3PtrList<Attachment> attachments = anEvent->attachments(); for ( Attachment *at = attachments.first(); at; at = attachments.next() ) addPropValue(vevent, VCAttachProp, at->uri().local8Bit()); @@ -636,7 +638,7 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit()); // alarm stuff - QPtrList<Alarm> alarms = anEvent->alarms(); + Q3PtrList<Alarm> alarms = anEvent->alarms(); Alarm* alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next()) { if (alarm->enabled()) { @@ -672,7 +674,7 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) addPropValue(vevent, VCTranspProp, tmpStr.local8Bit()); // related event - if (anEvent->relatedToUid()) { + if (!anEvent->relatedToUid().isEmpty()) { addPropValue(vevent, VCRelatedToProp, anEvent->relatedToUid().local8Bit()); } @@ -1408,7 +1410,7 @@ QString VCalFormat::qDateToISO(const QDate &qd) { QString tmpStr; - ASSERT(qd.isValid()); + Q_ASSERT(qd.isValid()); tmpStr.sprintf("%.2d%.2d%.2d", qd.year(), qd.month(), qd.day()); @@ -1420,8 +1422,8 @@ QString VCalFormat::qDateTimeToISO(const QDateTime &qdt, bool zulu) { QString tmpStr; - ASSERT(qdt.date().isValid()); - ASSERT(qdt.time().isValid()); + Q_ASSERT(qdt.date().isValid()); + Q_ASSERT(qdt.time().isValid()); if (zulu && !useLocalTime ) { QDateTime tmpDT = qdt.addSecs ( -KGlobal::locale()->localTimeOffset( qdt )*60); tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2dZ", @@ -1454,8 +1456,8 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr) tmpDate.setYMD(year, month, day); tmpTime.setHMS(hour, minute, second); - ASSERT(tmpDate.isValid()); - ASSERT(tmpTime.isValid()); + Q_ASSERT(tmpDate.isValid()); + Q_ASSERT(tmpTime.isValid()); QDateTime tmpDT(tmpDate, tmpTime); // correct for GMT if string is in Zulu format if (dtStr.at(dtStr.length()-1) == 'Z') @@ -1648,7 +1650,7 @@ Attendee::Role VCalFormat::readRole(const char *s) const return role; } -QCString VCalFormat::writeRole(Attendee::Role role) const +Q3CString VCalFormat::writeRole(Attendee::Role role) const { if ( role == Attendee::Chair ) return "OWNER"; @@ -1686,7 +1688,7 @@ Attendee::PartStat VCalFormat::readStatus(const char *s) const return status; } -QCString VCalFormat::writeStatus(Attendee::PartStat status) const +Q3CString VCalFormat::writeStatus(Attendee::PartStat status) const { switch(status) { default: diff --git a/libkcal/vcalformat.h b/libkcal/vcalformat.h index 6dae3d2..cac9634 100644 --- a/libkcal/vcalformat.h +++ b/libkcal/vcalformat.h @@ -23,6 +23,9 @@ #define _VCALFORMAT_H #include "calformat.h" +//Added by qt3to4: +#include <Q3CString> +#include <Q3PtrList> #define _VCAL_VERSION "1.0" @@ -95,17 +98,17 @@ class VCalFormat : public CalFormat { const char *dayFromNum(int day); /** the reverse of the above function. */ int numFromDay(const QString &day); - Attendee::Role VCalFormat::readRole(const char *s) const; - QCString writeRole(Attendee::Role role) const; + Attendee::Role readRole(const char *s) const; + Q3CString writeRole(Attendee::Role role) const; Attendee::PartStat readStatus(const char *s) const; - QCString writeStatus(Attendee::PartStat status) const; + Q3CString writeStatus(Attendee::PartStat status) const; private: Calendar *mCalendar; bool useLocalTime; - QPtrList<Event> mEventsRelate; // events with relations - QPtrList<Todo> mTodosRelate; // todos with relations + Q3PtrList<Event> mEventsRelate; // events with relations + Q3PtrList<Todo> mTodosRelate; // todos with relations }; } |