summaryrefslogtreecommitdiffabout
path: root/libkcal
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /libkcal
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/alarm.cpp10
-rw-r--r--libkcal/alarm.h12
-rw-r--r--libkcal/calendar.cpp66
-rw-r--r--libkcal/calendar.h40
-rw-r--r--libkcal/calendarlocal.cpp66
-rw-r--r--libkcal/calendarlocal.h28
-rw-r--r--libkcal/calfilter.cpp6
-rw-r--r--libkcal/calfilter.h10
-rw-r--r--libkcal/customproperties.cpp32
-rw-r--r--libkcal/customproperties.h22
-rw-r--r--libkcal/dndfactory.cpp9
-rw-r--r--libkcal/dndfactory.h2
-rw-r--r--libkcal/dndfactory_dummy.h2
-rw-r--r--libkcal/dummyscheduler.cpp16
-rw-r--r--libkcal/dummyscheduler.h4
-rw-r--r--libkcal/event.cpp2
-rw-r--r--libkcal/event.h4
-rw-r--r--libkcal/filestorage.cpp2
-rw-r--r--libkcal/freebusy.cpp11
-rw-r--r--libkcal/freebusy.h14
-rw-r--r--libkcal/icaldrag.cpp2
-rw-r--r--libkcal/icaldrag.h4
-rw-r--r--libkcal/icalformat.cpp32
-rw-r--r--libkcal/icalformat.h4
-rw-r--r--libkcal/icalformatimpl.cpp35
-rw-r--r--libkcal/icalformatimpl.h6
-rw-r--r--libkcal/imipscheduler.cpp6
-rw-r--r--libkcal/imipscheduler.h4
-rw-r--r--libkcal/incidence.cpp38
-rw-r--r--libkcal/incidence.h20
-rw-r--r--libkcal/incidencebase.cpp14
-rw-r--r--libkcal/incidencebase.h16
-rw-r--r--libkcal/journal.h4
-rw-r--r--libkcal/kincidenceformatter.cpp10
-rw-r--r--libkcal/libkcal.pro6
-rw-r--r--libkcal/libkcalE.pro2
-rw-r--r--libkcal/listbase.h24
-rw-r--r--libkcal/phoneformat.cpp23
-rw-r--r--libkcal/qtopiaformat.cpp8
-rw-r--r--libkcal/recurrence.cpp187
-rw-r--r--libkcal/recurrence.h26
-rw-r--r--libkcal/scheduler.cpp12
-rw-r--r--libkcal/scheduler.h4
-rw-r--r--libkcal/sharpformat.cpp48
-rw-r--r--libkcal/todo.cpp2
-rw-r--r--libkcal/todo.h4
-rw-r--r--libkcal/vcaldrag.cpp2
-rw-r--r--libkcal/vcaldrag.h4
-rw-r--r--libkcal/vcalformat.cpp52
-rw-r--r--libkcal/vcalformat.h13
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
@@ -25,8 +25,10 @@
#include "incidence.h"
#include "todo.h"
#include "alarm.h"
+//Added by qt3to4:
+#include <Q3ValueList>
using namespace KCal;
#include <qwidget.h>
Alarm::Alarm(Incidence *parent)
@@ -211,9 +213,9 @@ QString Alarm::programArguments() const
return (mType == Procedure) ? mDescription : QString::null;
}
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;
mDescription = text;
@@ -230,9 +232,9 @@ void Alarm::setMailAddress(const Person &mailAddress)
mParent->updated();
}
}
-void Alarm::setMailAddresses(const QValueList<Person> &mailAddresses)
+void Alarm::setMailAddresses(const Q3ValueList<Person> &mailAddresses)
{
if (mType == Email) {
mMailAddresses = mailAddresses;
mParent->updated();
@@ -246,11 +248,11 @@ void Alarm::addMailAddress(const Person &mailAddress)
mParent->updated();
}
}
-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
@@ -21,9 +21,9 @@
#ifndef KCAL_ALARM_H
#define KCAL_ALARM_H
#include <qstring.h>
-#include <qvaluelist.h>
+#include <q3valuelist.h>
#include "customproperties.h"
#include "duration.h"
#include "person.h"
@@ -38,9 +38,9 @@ class Incidence;
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);
/** Destruct Alarm object. */
@@ -111,9 +111,9 @@ class Alarm : public CustomProperties
@param text body of email.
@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.
Ignored if the alarm is not an email alarm.
@@ -121,15 +121,15 @@ class Alarm : public CustomProperties
void setMailAddress(const Person &mailAlarmAddress);
/** 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.
*/
@@ -225,9 +225,9 @@ class Alarm : public CustomProperties
Type mType; // type of alarm
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
// snooze before ringing again
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index 9b38d3f..bf095cf 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -29,8 +29,10 @@
#include "calfilter.h"
#include "calendar.h"
#include "syncdefines.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
Calendar::Calendar()
@@ -270,107 +272,107 @@ 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;
}
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;
}
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 );
}
}
@@ -406,11 +408,11 @@ 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;
}
@@ -454,9 +456,9 @@ 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 );
mOrphanUids.insert( i->uid(), i );
@@ -470,9 +472,9 @@ 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 );
}
@@ -486,9 +488,9 @@ void Calendar::removeRelations( Incidence *incidence )
#if 0
// 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
@@ -24,10 +24,10 @@
#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"
#include "todo.h"
@@ -87,9 +87,9 @@ 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; }
/**
@@ -154,14 +154,14 @@ public:
void addIncidenceBranch( Incidence * );
/**
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.
@param anEvent a pointer to the event to add
@@ -184,29 +184,29 @@ public:
Builds and then returns a list of all events that match for the
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.
@@ -221,9 +221,9 @@ public:
virtual void deleteJournal( Journal * ) = 0;
/**
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.
*/
@@ -231,13 +231,13 @@ public:
virtual Todo *todo( QString, QString ) = 0;
/**
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.
@@ -247,17 +247,17 @@ 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.
*/
virtual Journal *journal( const QString &UID ) = 0;
/**
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
string identifier, returns a pointer or null.
@@ -334,19 +334,19 @@ public:
protected:
/**
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;
Incidence *mUndoIncidence;
@@ -375,10 +375,10 @@ 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
@@ -21,9 +21,9 @@
*/
#include <qdatetime.h>
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <kdebug.h>
#include <kconfig.h>
#include <kglobal.h>
@@ -191,17 +191,17 @@ bool CalendarLocal::mergeCalendar( Calendar* remote )
// if inc not in remote, delete in local
// 2 look for raw inc in remote
// if inc in local, replace it
// if not in local, add it to default calendar
- QPtrList<Incidence> localInc = rawIncidences();
+ Q3PtrList<Incidence> localInc = rawIncidences();
Incidence* inL = localInc.first();
while ( inL ) {
if ( ! inL->isReadOnly () )
if ( !remote->incidenceForUid( inL->uid(), true ))
deleteIncidence( inL );
inL = localInc.next();
}
- QPtrList<Incidence> er = remote->rawIncidences();
+ Q3PtrList<Incidence> er = remote->rawIncidences();
Incidence* inR = er.first();
while ( inR ) {
inL = incidenceForUid( inR->uid(),false );
if ( inL ) {
@@ -258,11 +258,11 @@ void CalendarLocal::setSyncEventsReadOnly()
void CalendarLocal::addCalendar( Calendar* cal )
{
cal->setDontDeleteIncidencesOnClose();
setSyncEventsEnabled();
- QPtrList<Incidence> incList;
+ Q3PtrList<Incidence> incList;
{
- QPtrList<Event> EventList = cal->rawEvents();
+ Q3PtrList<Event> EventList = cal->rawEvents();
Event * ev = EventList.first();
while ( ev ) {
if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) {
ev->setCalID_block( 1 );
@@ -278,9 +278,9 @@ void CalendarLocal::addCalendar( Calendar* cal )
}
{
- QPtrList<Todo> TodoList = cal->rawTodos();
+ Q3PtrList<Todo> TodoList = cal->rawTodos();
Todo * ev = TodoList.first();
while ( ev ) {
ev->resetRelatedTo();
Todo * se = todo( ev->uid() );
@@ -298,9 +298,9 @@ void CalendarLocal::addCalendar( Calendar* cal )
ev = TodoList.next();
}
}
{
- QPtrList<Journal> JournalList = cal->journals();
+ Q3PtrList<Journal> JournalList = cal->journals();
Journal * ev = JournalList.first();
while ( ev ) {
Journal * se = journal( ev->uid() );
if ( se )
@@ -480,11 +480,11 @@ void CalendarLocal::deleteTodo( Todo *todo )
if ( dup )
setupRelations( dup );
}
-QPtrList<Todo> CalendarLocal::rawTodos()
+Q3PtrList<Todo> CalendarLocal::rawTodos()
{
- QPtrList<Todo> el;
+ Q3PtrList<Todo> el;
for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
if ( it->calEnabled() ) el.append( it );
return el;
}
@@ -498,15 +498,15 @@ Todo *CalendarLocal::todo( QString syncProf, QString id )
return 0;
}
void CalendarLocal::removeSyncInfo( QString syncProfile)
{
- QPtrList<Incidence> all = rawIncidences() ;
+ Q3PtrList<Incidence> all = rawIncidences() ;
Incidence *inc;
for ( inc = all.first(); inc; inc = all.next() ) {
inc->removeID( syncProfile );
}
if ( syncProfile.isEmpty() ) {
- QPtrList<Event> el;
+ Q3PtrList<Event> el;
Event *todo;
for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
el.append( todo );
@@ -519,11 +519,11 @@ void CalendarLocal::removeSyncInfo( QString syncProfile)
if ( lse )
deleteIncidence ( lse );
}
}
-QPtrList<Event> CalendarLocal::getExternLastSyncEvents()
+Q3PtrList<Event> CalendarLocal::getExternLastSyncEvents()
{
- QPtrList<Event> el;
+ Q3PtrList<Event> el;
Event *todo;
for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
if ( todo->summary().left(3) == "E: " )
@@ -684,11 +684,11 @@ void CalendarLocal::deRegisterAlarm()
// AlarmServer::deleteAlarm (mNextAlarmDateTime ,"koalarm" ,mLastAlarmNotificationString.latin1() );
// #endif
}
-QPtrList<Todo> CalendarLocal::todos( const QDate &date )
+Q3PtrList<Todo> CalendarLocal::todos( const QDate &date )
{
- QPtrList<Todo> todos;
+ Q3PtrList<Todo> todos;
Todo *todo;
for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
if ( !todo->calEnabled() ) continue;
@@ -785,9 +785,9 @@ 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()
// << "': " << alarm->time().toString() << " - " << alarm->enabled() << endl;
@@ -804,9 +804,9 @@ void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms,
const QDateTime &from,
const QDateTime &to )
{
- QPtrList<Alarm> alarmList = incidence->alarms();
+ Q3PtrList<Alarm> alarmList = incidence->alarms();
Alarm *alarm;
QDateTime qdt;
for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) {
if (incidence->recursOn(from.date())) {
@@ -843,11 +843,11 @@ void CalendarLocal::insertEvent( Event *event )
if ( mEventList.findRef( event ) < 0 ) mEventList.append( event );
}
-QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
+Q3PtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
{
- QPtrList<Event> eventList;
+ Q3PtrList<Event> eventList;
Event *event;
for( event = mEventList.first(); event; event = mEventList.next() ) {
if ( !event->calEnabled() ) continue;
@@ -877,9 +877,9 @@ 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();
int i = 0;
@@ -893,14 +893,14 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
return eventListSorted;
}
-QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
+Q3PtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
bool inclusive )
{
Event *event = 0;
- QPtrList<Event> eventList;
+ Q3PtrList<Event> eventList;
// Get non-recurring events
for( event = mEventList.first(); event; event = mEventList.next() ) {
if ( !event->calEnabled() ) continue;
@@ -922,9 +922,9 @@ 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;
}
@@ -971,16 +971,16 @@ 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;
}
@@ -1005,11 +1005,11 @@ void CalendarLocal::deleteJournal( Journal *journal )
setModified( true );
}
}
-QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date )
+Q3PtrList<Journal> CalendarLocal::journals4Date( const QDate & date )
{
- QPtrList<Journal> el;
+ Q3PtrList<Journal> el;
for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
if ( it->calEnabled() && it->dtStart().date() == date) el.append( it );
return el;
}
@@ -1039,20 +1039,20 @@ 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;
}
void CalendarLocal::setCalendarRemove( int id )
{
{
- QPtrList<Event> EventList = mEventList;
+ Q3PtrList<Event> EventList = mEventList;
Event * ev = EventList.first();
while ( ev ) {
if ( ev->calID() == id && ev->uid().left( 15 ) != QString("last-syncEvent-") )
deleteEvent( ev );
@@ -1060,18 +1060,18 @@ void CalendarLocal::setCalendarRemove( int id )
}
}
{
- QPtrList<Todo> TodoList = mTodoList;
+ Q3PtrList<Todo> TodoList = mTodoList;
Todo * ev = TodoList.first();
while ( ev ) {
if ( ev->calID() == id )
deleteTodo( ev );
ev = TodoList.next();
}
}
{
- QPtrList<Journal> JournalList = mJournalList;
+ Q3PtrList<Journal> JournalList = mJournalList;
Journal * ev = JournalList.first();
while ( ev ) {
if ( ev->calID() == id )
deleteJournal( ev );
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index 1ceabce..1df65c7 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -22,8 +22,10 @@
#ifndef KCAL_CALENDARLOCAL_H
#define KCAL_CALENDARLOCAL_H
#include "calendar.h"
+//Added by qt3to4:
+#include <Q3PtrList>
namespace KCal {
class CalFormat;
@@ -92,10 +94,10 @@ class CalendarLocal : public Calendar
Event *event( const QString &uid );
/**
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.
*/
bool addTodo( Todo *todo );
@@ -111,19 +113,19 @@ class CalendarLocal : public Calendar
Todo *todo( const QString &uid );
/**
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.
*/
@@ -135,17 +137,17 @@ 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.
*/
Journal *journal( const QString &uid );
/**
Return list of all Journals stored in calendar.
*/
- QPtrList<Journal> journals();
+ Q3PtrList<Journal> journals();
/**
Return all alarms, which ocur in the given time interval.
*/
@@ -173,18 +175,18 @@ 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 );
void getIncidenceCount( int calId, int& events, int & todos, int & journals);
@@ -223,11 +225,11 @@ 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
@@ -20,8 +20,10 @@
#include <kdebug.h>
#include "calfilter.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
CalFilter::CalFilter()
@@ -40,9 +42,9 @@ CalFilter::CalFilter(const QString &name)
CalFilter::~CalFilter()
{
}
-void CalFilter::apply(QPtrList<Event> *eventlist)
+void CalFilter::apply(Q3PtrList<Event> *eventlist)
{
if (!mEnabled) return;
// kdDebug(5800) << "CalFilter::apply()" << endl;
@@ -60,9 +62,9 @@ void CalFilter::apply(QPtrList<Event> *eventlist)
// kdDebug(5800) << "CalFilter::apply() done" << endl;
}
// TODO: avoid duplicating apply() code
-void CalFilter::apply(QPtrList<Todo> *eventlist)
+void CalFilter::apply(Q3PtrList<Todo> *eventlist)
{
if (!mEnabled) return;
Todo *event = eventlist->first();
while(event) {
diff --git a/libkcal/calfilter.h b/libkcal/calfilter.h
index e349770..821149f 100644
--- a/libkcal/calfilter.h
+++ b/libkcal/calfilter.h
@@ -21,9 +21,9 @@
#ifndef _CALFILTER_H
#define _CALFILTER_H
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include "event.h"
#include "todo.h"
#include "journal.h"
@@ -54,17 +54,17 @@ 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
@@ -18,8 +18,10 @@
Boston, MA 02111-1307, USA.
*/
#include "customproperties.h"
+//Added by qt3to4:
+#include <Q3CString>
using namespace KCal;
CustomProperties::CustomProperties()
@@ -34,67 +36,67 @@ CustomProperties::CustomProperties(const CustomProperties &cp)
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();
}
}
}
-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
const char* n = name;
diff --git a/libkcal/customproperties.h b/libkcal/customproperties.h
index 0cbfdcd..75eb3ad 100644
--- a/libkcal/customproperties.h
+++ b/libkcal/customproperties.h
@@ -22,8 +22,10 @@
#define KCAL_CUSTOM_PROPERTIES_H
#include <qstring.h>
#include <qmap.h>
+//Added by qt3to4:
+#include <Q3CString>
namespace KCal {
/**
@@ -48,49 +50,49 @@ class CustomProperties
@param key Property identifier specific to the application.
@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
@@ -21,8 +21,11 @@
*/
#include <qapplication.h>
#include <qclipboard.h>
+//Added by qt3to4:
+#include <QDropEvent>
+#include <Q3PtrList>
#include <kiconloader.h>
#include <kdebug.h>
#include <kmessagebox.h>
@@ -67,9 +70,9 @@ 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;
}
@@ -86,9 +89,9 @@ 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;
}
@@ -132,9 +135,9 @@ Incidence *DndFactory::pasteIncidence(const QDate &newDate, const QTime *newTime
kdDebug(5800) << "Can't parse clipboard" << endl;
return 0;
}
- QPtrList<Incidence> incList = cal.incidences();
+ Q3PtrList<Incidence> incList = cal.incidences();
Incidence *inc = incList.first();
if ( !incList.isEmpty() && inc ) {
inc = inc->clone();
diff --git a/libkcal/dndfactory.h b/libkcal/dndfactory.h
index 2df5259..a873c37 100644
--- a/libkcal/dndfactory.h
+++ b/libkcal/dndfactory.h
@@ -1,4 +1,6 @@
+//Added by qt3to4:
+#include <QDropEvent>
/*
This file is part of libkcal.
Copyright (c) 1998 Preston Brown
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
@@ -24,8 +24,10 @@
#ifndef KCAL_DNDFACTORY_H
#define KCAL_DNDFACTORY_H
#include "vcalformat.h"
+//Added by qt3to4:
+#include <QDropEvent>
class QDropEvent;
namespace KCal {
diff --git a/libkcal/dummyscheduler.cpp b/libkcal/dummyscheduler.cpp
index ae40e6d..73eb3d0 100644
--- a/libkcal/dummyscheduler.cpp
+++ b/libkcal/dummyscheduler.cpp
@@ -22,9 +22,11 @@
// DummyScheduler - iMIP implementation of iTIP methods
//
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#include <kdebug.h>
#include "event.h"
@@ -67,28 +69,28 @@ 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;
} else {
return false;
}
}
-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()) {
// kdDebug(5800) << "++++++++" << messageLine << endl;
diff --git a/libkcal/dummyscheduler.h b/libkcal/dummyscheduler.h
index df42153..f86d583 100644
--- a/libkcal/dummyscheduler.h
+++ b/libkcal/dummyscheduler.h
@@ -23,8 +23,10 @@
// Dummy implementation of iTIP methods
//
#include "scheduler.h"
+//Added by qt3to4:
+#include <Q3PtrList>
namespace KCal {
/**
@@ -38,9 +40,9 @@ 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
@@ -383,9 +383,9 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_
// if ( QDateTime::currentDateTime() > incidenceStart ){
// *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 ) {
alarmStart = alarm->time();
diff --git a/libkcal/event.h b/libkcal/event.h
index 6a58618..da44f81 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -24,8 +24,10 @@
// Event component, representing a VEVENT object
//
#include "incidence.h"
+//Added by qt3to4:
+#include <Q3CString>
namespace KCal {
/**
This class provides an Event in the sense of RFC2445.
@@ -39,9 +41,9 @@ class Event : public Incidence
Event(const Event &);
~Event();
bool matchTime(QDateTime*startDT, QDateTime* endDT);
- QCString type() const { return "Event"; }
+ Q3CString type() const { return "Event"; }
IncTypeID typeID() const { return eventID; }
Incidence *clone();
QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
diff --git a/libkcal/filestorage.cpp b/libkcal/filestorage.cpp
index a139124..3d1309f 100644
--- a/libkcal/filestorage.cpp
+++ b/libkcal/filestorage.cpp
@@ -21,9 +21,9 @@
#include <stdlib.h>
#include <qdatetime.h>
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <kdebug.h>
#include "calendar.h"
diff --git a/libkcal/freebusy.cpp b/libkcal/freebusy.cpp
index ba15d6d..e4e9ec9 100644
--- a/libkcal/freebusy.cpp
+++ b/libkcal/freebusy.cpp
@@ -20,8 +20,11 @@
#include <kdebug.h>
#include "freebusy.h"
+//Added by qt3to4:
+#include <Q3ValueList>
+#include <Q3PtrList>
using namespace KCal;
FreeBusy::FreeBusy()
@@ -42,9 +45,9 @@ FreeBusy::FreeBusy( Calendar *calendar, const QDateTime &start, const QDateTime
setDtStart(start);
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;
duration = start.daysTo(end);
@@ -112,9 +115,9 @@ QDateTime FreeBusy::dtEnd() const
{
return mDtEnd;
}
-QValueList<Period> FreeBusy::busyPeriods() const
+Q3ValueList<Period> FreeBusy::busyPeriods() const
{
return mBusyPeriods;
}
@@ -145,16 +148,16 @@ 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;
QDateTime earlyTime;
diff --git a/libkcal/freebusy.h b/libkcal/freebusy.h
index d741c72..bd14cb7 100644
--- a/libkcal/freebusy.h
+++ b/libkcal/freebusy.h
@@ -23,10 +23,12 @@
// FreeBusy - information about free/busy times
//
#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"
@@ -42,19 +44,19 @@ class FreeBusy : public IncidenceBase
public:
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();
@@ -63,9 +65,9 @@ class FreeBusy : public IncidenceBase
//This is used for creating a freebusy object for the current user
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
@@ -27,9 +27,9 @@
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
@@ -21,15 +21,15 @@
#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. */
ICalDrag( Calendar *cal, QWidget *parent = 0, const char *name = 0 );
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp
index 6f3a799..3829bc1 100644
--- a/libkcal/icalformat.cpp
+++ b/libkcal/icalformat.cpp
@@ -19,13 +19,13 @@
*/
#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>
#include <kdebug.h>
@@ -69,16 +69,16 @@ 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();
return fromString( calendar, text );
@@ -97,16 +97,16 @@ 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() );
return true;
@@ -155,25 +155,25 @@ Incidence *ICalFormat::fromString( const QString &text )
CalendarLocal cal( mTimeZoneId );
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();
}
}
}
return ical;
}
-#include <qapp.h>
+#include <qapplication.h>
QString ICalFormat::toString( Calendar *cal )
{
@@ -183,10 +183,10 @@ 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);
//qDebug(" todos ");
@@ -195,9 +195,9 @@ QString ICalFormat::toString( Calendar *cal )
qApp->processEvents();
}
}
// 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);
icalcomponent_add_component(calendar,component);
@@ -206,9 +206,9 @@ QString ICalFormat::toString( Calendar *cal )
qApp->processEvents();
}
// 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);
icalcomponent_add_component(calendar,component);
diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h
index a770dbb..a454b35 100644
--- a/libkcal/icalformat.h
+++ b/libkcal/icalformat.h
@@ -20,8 +20,10 @@
#ifndef ICALFORMAT_H
#define ICALFORMAT_H
#include <qstring.h>
+//Added by qt3to4:
+#include <Q3CString>
#include "scheduler.h"
#include "calformat.h"
@@ -105,9 +107,9 @@ class ICalFormat : public CalFormat {
private:
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
@@ -19,10 +19,13 @@
*/
#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>
#include <kglobal.h>
@@ -220,10 +223,10 @@ icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy,
freebusy->uid().utf8()));
}
//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());
period.end = writeICalDateTime((*it).end());
@@ -383,14 +386,14 @@ 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()) {
kdDebug(5800) << "Write alarm for " << incidence->summary() << endl;
@@ -422,10 +425,10 @@ void ICalFormatImpl::writeIncidenceBase(icalcomponent *parent,IncidenceBase *inc
("MAILTO:" + incidenceBase->organizer()).utf8()));
// 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()));
}
}
@@ -435,10 +438,10 @@ 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);
}
@@ -545,10 +548,10 @@ 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;
int day;
@@ -703,10 +706,10 @@ 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()));
}
@@ -762,10 +765,10 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm)
icaldurationtype_from_int(alarm->snoozeTime()*60)));
}
// 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);
}
@@ -1338,9 +1341,9 @@ 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);
while (p) {
diff --git a/libkcal/icalformatimpl.h b/libkcal/icalformatimpl.h
index 203c302..3a35b4c 100644
--- a/libkcal/icalformatimpl.h
+++ b/libkcal/icalformatimpl.h
@@ -20,8 +20,10 @@
#ifndef ICALFORMATIMPL_H
#define ICALFORMATIMPL_H
#include <qstring.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#include "scheduler.h"
#include "freebusy.h"
@@ -92,10 +94,10 @@ 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;
static const int mSecondsPerHour;
diff --git a/libkcal/imipscheduler.cpp b/libkcal/imipscheduler.cpp
index e186f8e..e6d56a6 100644
--- a/libkcal/imipscheduler.cpp
+++ b/libkcal/imipscheduler.cpp
@@ -25,8 +25,10 @@
#include "event.h"
#include "icalformat.h"
#include "imipscheduler.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
IMIPScheduler::IMIPScheduler(Calendar *calendar)
@@ -49,10 +51,10 @@ 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
@@ -22,9 +22,9 @@
//
// iMIP implementation of iTIP methods
//
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include "scheduler.h"
namespace KCal {
@@ -39,9 +39,9 @@ class IMIPScheduler : public Scheduler {
virtual ~IMIPScheduler();
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
@@ -25,8 +25,10 @@
#include "calformat.h"
#include "incidence.h"
#include "todo.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
Incidence::Incidence() :
@@ -58,9 +60,9 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
mRelatedTo = 0;
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 );
mAttachments.append( a );
@@ -72,9 +74,9 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
mPriority = i.mPriority;
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 );
b->setParent( this );
@@ -97,9 +99,9 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
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);
}
if (relatedTo()) relatedTo()->removeRelation(this);
@@ -215,10 +217,10 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
return false;
}
}
#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;
}
@@ -321,9 +323,9 @@ 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();
cloneInc->setRelatedTo( newInc );
@@ -355,9 +357,9 @@ QDateTime Incidence::lastModifiedSub()
if ( mLastModifiedSub.isValid() )
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();
}
@@ -446,9 +448,9 @@ void Incidence::addCategories(const QStringList &categories, bool addToRelations
checkCategories();
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 );
}
}
@@ -461,9 +463,9 @@ void Incidence::setCategories(const QStringList &categories, bool setForRelation
checkCategories();
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 );
}
}
@@ -549,17 +551,17 @@ 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 );
}
if ( rel->findRef( this ) == -1 )
@@ -646,17 +648,17 @@ void Incidence::deleteAttachments(const QString& mime)
at = mAttachments.next();
}
}
-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)
attachments.append(at);
@@ -736,9 +738,9 @@ QStringList Incidence::secrecyList()
return list;
}
-QPtrList<Alarm> Incidence::alarms() const
+Q3PtrList<Alarm> Incidence::alarms() const
{
return mAlarms;
}
@@ -770,9 +772,9 @@ 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;
}
return false;
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index f89942f..2940129 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -24,9 +24,11 @@
//
#include <qdatetime.h>
#include <qstringlist.h>
-#include <qvaluelist.h>
+#include <q3valuelist.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#include "recurrence.h"
#include "alarm.h"
#include "attachment.h"
@@ -112,9 +114,9 @@ class Incidence : public IncidenceBase
virtual bool accept(Visitor &) { return false; }
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 );
@@ -176,9 +178,9 @@ class Incidence : public IncidenceBase
void resetRelatedTo();
/** 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 */
void removeRelation(Incidence *);
@@ -201,11 +203,11 @@ class Incidence : public IncidenceBase
void deleteAttachment(Attachment *attachment);
/** 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. */
void setSecrecy(int);
@@ -234,9 +236,9 @@ class Incidence : public IncidenceBase
/** get the event's priority */
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 */
void addAlarm(Alarm*);
@@ -287,10 +289,10 @@ class Incidence : public IncidenceBase
virtual QString durationText();
QString durationText4Time( int secs );
Recurrence *mRecurrence;
protected:
- QPtrList<Alarm> mAlarms;
- QPtrList<Incidence> mRelations;
+ Q3PtrList<Alarm> mAlarms;
+ Q3PtrList<Incidence> mRelations;
QDateTime mRecurrenceID;
bool mHasRecurrenceID;
private:
void checkCategories();
@@ -307,9 +309,9 @@ protected:
QStringList mCategories;
Incidence *mRelatedTo;
QString mRelatedToUid;
DateList mExDates;
- QPtrList<Attachment> mAttachments;
+ Q3PtrList<Attachment> mAttachments;
QStringList mResources;
bool mHasStartDate; // if todo has associated start date
int mSecrecy;
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 56c0560..f11ec54 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -26,8 +26,10 @@
#include "calformat.h"
#include "syncdefines.h"
#include "incidencebase.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
IncidenceBase::IncidenceBase() :
@@ -63,9 +65,9 @@ IncidenceBase::IncidenceBase(const IncidenceBase &i) :
mUid = i.mUid;
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 ) );
}
mFloats = i.mFloats;
@@ -299,9 +301,9 @@ bool IncidenceBase::addAttendee(Attendee *a, bool doupdate)
if (mReadOnly) return false;
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) {
if (*qli.current() == *a)
@@ -342,9 +344,9 @@ void IncidenceBase::clearAttendees()
#if 0
Attendee *IncidenceBase::getAttendee(const char *n) const
{
- QPtrListIterator<Attendee> qli(mAttendees);
+ Q3PtrListIterator<Attendee> qli(mAttendees);
qli.toFirst();
while (qli) {
if (qli.current()->getName() == n)
@@ -356,9 +358,9 @@ Attendee *IncidenceBase::getAttendee(const char *n) const
#endif
Attendee *IncidenceBase::attendeeByMail(const QString &email)
{
- QPtrListIterator<Attendee> qli(mAttendees);
+ Q3PtrListIterator<Attendee> qli(mAttendees);
qli.toFirst();
while (qli) {
if (qli.current()->email().lower() == email.lower())
@@ -369,9 +371,9 @@ 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()) {
mails.append(email);
@@ -490,9 +492,9 @@ 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;
o->incidenceUpdated( this );
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h
index 3edc03b..d97f524 100644
--- a/libkcal/incidencebase.h
+++ b/libkcal/incidencebase.h
@@ -24,17 +24,19 @@
//
#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 };
/**
This class provides the base class common to all calendar components.
@@ -50,9 +52,9 @@ class IncidenceBase : public CustomProperties
IncidenceBase();
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 */
void setUid(const QString &);
@@ -108,9 +110,9 @@ class IncidenceBase : public CustomProperties
// void removeAttendee(const char *n);
/** 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 */
Attendee* attendeeByMail(const QString &);
@@ -167,9 +169,9 @@ class IncidenceBase : public CustomProperties
int mCalID;
bool mCalEnabled;
bool mAlarmEnabled;
QDateTime mLastModified;
- QPtrList<Attendee> mAttendees;
+ Q3PtrList<Attendee> mAttendees;
bool mFloats;
int mDuration;
@@ -180,9 +182,9 @@ class IncidenceBase : public CustomProperties
// PILOT SYNCHRONIZATION STUFF
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
@@ -23,8 +23,10 @@
// Journal component, representing a VJOURNAL object
//
#include "incidence.h"
+//Added by qt3to4:
+#include <Q3CString>
namespace KCal {
/**
@@ -35,9 +37,9 @@ class Journal : public Incidence
public:
Journal();
~Journal();
- QCString type() const { return "Journal"; }
+ Q3CString type() const { return "Journal"; }
IncTypeID typeID() const { return journalID; }
Incidence *clone();
QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 733b897..bce68b0 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -3,8 +3,10 @@
#include <kglobal.h>
#include <klocale.h>
#ifdef DEKTOP_VERSION
#include <kabc/stdaddressbook.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#define size count
#endif
KIncidenceFormatter* KIncidenceFormatter::mInstance = 0;
@@ -309,9 +311,9 @@ 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;
if(number !=-1)
@@ -338,9 +340,9 @@ 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);
addTag("h3",i18n("Organizer"));
@@ -361,9 +363,9 @@ 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";
}
@@ -401,9 +403,9 @@ void KIncidenceFormatter::formatAttendees(Incidence *event)
mText += "</a>\n";
#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 + "\">";
else
diff --git a/libkcal/libkcal.pro b/libkcal/libkcal.pro
index 33c63c3..1f43b10 100644
--- a/libkcal/libkcal.pro
+++ b/libkcal/libkcal.pro
@@ -1,7 +1,7 @@
TEMPLATE = lib
CONFIG += qt warn_on
-TARGET = microkcal
+TARGET = xmicrokcal
include( ../variables.pri )
INCLUDEPATH += ../libkdepim ../microkde versit ../microkde/kdecore
@@ -105,4 +105,8 @@ dndfactory.cpp \
versit/vcc.c \
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,7 +1,7 @@
TEMPLATE = lib
CONFIG += qt warn_on
-TARGET = microkcal
+TARGET = xmicrokcal
INCLUDEPATH += ../libkdepim ../microkde ../qtcompat versit ../microkde/kdecore $(QPEDIR)/include
INCLUDEPATH += ../libical/src/libical
INCLUDEPATH += ../libical/src/libicalss
diff --git a/libkcal/listbase.h b/libkcal/listbase.h
index 085b13d..6c942ef 100644
--- a/libkcal/listbase.h
+++ b/libkcal/listbase.h
@@ -20,9 +20,11 @@
*/
#ifndef KCAL_LISTBASE_H
#define KCAL_LISTBASE_H
-#include <qvaluelist.h>
+#include <q3valuelist.h>
+//Added by qt3to4:
+#include <Q3PtrList>
namespace KCal {
class Event;
class Todo;
@@ -30,35 +32,35 @@ namespace KCal {
This class provides a template for lists of pointers. It extends QValueList<T
*> 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;
}
}
}
ListBase &operator=( const ListBase &l )
{
if ( this == &l ) return *this;
- QValueList<T *>::operator=( l );
+ Q3ValueList<T *>::operator=( l );
return *this;
}
void setAutoDelete( bool autoDelete )
@@ -67,19 +69,19 @@ 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;
remove( it );
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 );
++it;
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 900fc04..794e4b4 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -21,17 +21,18 @@
#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>
#include <kglobal.h>
@@ -200,9 +201,9 @@ 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;
else
@@ -240,9 +241,9 @@ ulong PhoneFormat::getCsumEvent( Event* event )
if ( writeEndDate ) {
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" );
}
@@ -304,9 +305,9 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
qDebug("loading file ...");
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 ) {
QStringList cat = ev->categories();
@@ -339,9 +340,9 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
ev = er.next();
}
{
qDebug("reading todos... ");
- QPtrList<Todo> tr = calendar->rawTodos();
+ Q3PtrList<Todo> tr = calendar->rawTodos();
Todo* ev = tr.first();
while ( ev ) {
QStringList cat = ev->categories();
@@ -464,9 +465,9 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from )
else
to->setPriority(from->priority());
}
-#include <qcstring.h>
+#include <q3cstring.h>
void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum)
{
inc->setID( mProfileName, id );
@@ -496,9 +497,9 @@ 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 ) {
calendar->deleteEvent( ev );
@@ -507,9 +508,9 @@ 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 ) {
calendar->deleteTodo( to );
@@ -551,9 +552,9 @@ bool PhoneFormat::save( Calendar *calendar)
//algo 6 compare event
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 ) {
//qDebug("event new ID %s",ev->summary().latin1());
@@ -579,9 +580,9 @@ bool PhoneFormat::save( Calendar *calendar)
//algo 6 compare todo
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 ) {
status.setText ( message + QString::number ( ++procCount ) );
diff --git a/libkcal/qtopiaformat.cpp b/libkcal/qtopiaformat.cpp
index 0a4a031..2dfe1a4 100644
--- a/libkcal/qtopiaformat.cpp
+++ b/libkcal/qtopiaformat.cpp
@@ -20,13 +20,13 @@
*/
#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>
#include <klocale.h>
@@ -308,14 +308,14 @@ 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();
return true;
diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp
index 6ee5499..9a4e540 100644
--- a/libkcal/recurrence.cpp
+++ b/libkcal/recurrence.cpp
@@ -28,8 +28,11 @@
#include "incidence.h"
#include "recurrence.h"
+//Added by qt3to4:
+#include <Q3ValueList>
+#include <Q3PtrList>
using namespace KCal;
Recurrence::Feb29Type Recurrence::mFeb29YearlyDefaultType = Recurrence::rMar1;
@@ -55,9 +58,9 @@ 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),
mRecurStart(r.mRecurStart),
@@ -69,21 +72,21 @@ Recurrence::Recurrence(const Recurrence &r, Incidence *parent)
mCompatRecurs(r.mCompatRecurs),
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);
}
@@ -123,48 +126,48 @@ bool Recurrence::operator==( const Recurrence& r2 ) const
case rWeekly:
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() )
return false;
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() )
return false;
return *MonthDays.first() == *MonthDays2.first() ;
}
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() )
return false;
return MonthPositions.first()->rPos == MonthPositions2.first()->rPos;
}
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:
case rMinutely:
@@ -356,9 +359,9 @@ QDateTime Recurrence::endDateTime() const
return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*60);
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);
break;
@@ -505,19 +508,19 @@ 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;
}
@@ -758,9 +761,9 @@ void Recurrence::addYearlyMonthPos(short _rPos, const QBitArray &_rDays)
if (recurs == rYearlyPos)
addMonthlyPos_(_rPos, _rDays);
}
-const QPtrList<int> &Recurrence::yearNums() const
+const Q3PtrList<int> &Recurrence::yearNums() const
{
return rYearNums;
}
void Recurrence::addYearlyMonth(short _rPos )
@@ -1046,15 +1049,15 @@ bool Recurrence::recursMonthly(const QDate &qd) const
&& ((rDuration > 0 && qd <= endDate()) ||
(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;
}
// no dates matched
@@ -1100,9 +1103,9 @@ bool Recurrence::recursYearlyByMonth(const QDate &qd) const
(rDuration == 0 && qd <= rEndDateTime.date()) ||
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;
}
}
@@ -1126,14 +1129,14 @@ bool Recurrence::recursYearlyByPos(const QDate &qd) const
&& ((rDuration > 0 && qd <= endDate()) ||
(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;
}
}
@@ -1156,9 +1159,9 @@ bool Recurrence::recursYearlyByDay(const QDate &qd) const
(rDuration == 0 && qd <= rEndDateTime.date()) ||
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;
}
}
@@ -1548,9 +1551,9 @@ int Recurrence::recurCalc(PeriodFunc func, QDate &enddate) const
switch (func) {
case END_DATE_AND_COUNT:
case NEXT_AFTER_DATE:
if (count == 0)
- endtime = QDate();
+ endtime = QDateTime();
else if (timed)
enddate = endtime.date();
break;
case COUNT_TO_DATE:
@@ -1792,10 +1795,10 @@ struct Recurrence::MonthlyData {
int month; // current month 0..11
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())
{ recurDays[0] = &days28;
@@ -1804,14 +1807,14 @@ struct Recurrence::MonthlyData {
recurDays[3] = &days31;
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())
recurrence->getMonthlyDayDays(*days, daysInMonth);
@@ -1843,10 +1846,10 @@ int Recurrence::monthlyCalc(PeriodFunc func, QDate &enddate) const
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
for (it = days->begin(); it != days->end(); ++it) {
@@ -1909,10 +1912,10 @@ int Recurrence::monthlyCalcToDate(const QDate &enddate, MonthlyData &data) const
int endYear = enddate.year();
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
for (it = days->begin(); it != days->end(); ++it) {
@@ -1968,10 +1971,10 @@ int Recurrence::monthlyCalcNextAfter(QDate &enddate, MonthlyData &data) const
int countGone = 0;
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
for (it = days->begin(); it != days->end(); ++it) {
@@ -2051,19 +2054,19 @@ struct Recurrence::YearlyMonthData {
int day; // current day of month 1..31
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); }
};
int Recurrence::yearlyMonthCalc(PeriodFunc func, QDate &enddate) const
@@ -2087,10 +2090,10 @@ int Recurrence::yearlyMonthCalc(PeriodFunc func, QDate &enddate) const
int Recurrence::yearlyMonthCalcEndDate(QDate &enddate, YearlyMonthData &data) const
{
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
for (it = mons->begin(); it != mons->end(); ++it) {
@@ -2198,10 +2201,10 @@ int Recurrence::yearlyMonthCalcToDate(const QDate &enddate, YearlyMonthData &dat
endMonth = 12;
--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
for (it = mons->begin(); it != mons->end(); ++it) {
@@ -2269,10 +2272,10 @@ int Recurrence::yearlyMonthCalcNextAfter(QDate &enddate, YearlyMonthData &data)
endMonth = 12;
--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
for (it = mons->begin(); it != mons->end(); ++it) {
@@ -2389,17 +2392,17 @@ struct Recurrence::YearlyPosData {
int daysPerMonth; // number of days which recur each month, or -1 if variable
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)
{ if ((daysPerMonth = r->countMonthlyPosDays()) > 0)
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;
}
@@ -2427,14 +2430,14 @@ int Recurrence::yearlyPosCalc(PeriodFunc func, QDate &enddate) const
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
|| static_cast<uint>(data.daysPerMonth) >= countTogo) {
@@ -2465,9 +2468,9 @@ 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();
if (static_cast<uint>(n) >= countTogo) {
@@ -2495,9 +2498,9 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const
countGone += wholeYears * data.count;
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();
days = data.dayList();
@@ -2530,14 +2533,14 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c
endMonth = 12;
--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)
return countGone;
@@ -2575,9 +2578,9 @@ 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) {
if (data.yearMonth() > endYearMonth)
@@ -2610,9 +2613,9 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c
return countGone; // end year isn't a recurrence year
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)
return countGone;
@@ -2645,16 +2648,16 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons
endMonth = 12;
--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();
int ended = data.yearMonth() - endYearMonth;
@@ -2688,9 +2691,9 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons
} else {
// 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();
int ended = data.yearMonth() - endYearMonth;
@@ -2733,9 +2736,9 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons
data.year += recurYears * rFreq;
}
// 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) {
// This is the end month, so check each day
@@ -2807,9 +2810,9 @@ 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;
if (--countTogo == 0) {
@@ -2845,9 +2848,9 @@ int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const
countTogo -= wholeYears * daysPerYear;
}
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();
break;
@@ -2868,9 +2871,9 @@ 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)
return countGone;
@@ -2907,9 +2910,9 @@ 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)
return countMax;
@@ -2927,9 +2930,9 @@ 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;
if (data.year == endYear && d > endDay) {
@@ -2976,9 +2979,9 @@ 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) {
data.day = d;
@@ -2994,15 +2997,15 @@ 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) {
// nth days before the end of the month
@@ -3038,9 +3041,9 @@ 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) {
// nth days before the end of the month
@@ -3071,14 +3074,14 @@ 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
if (day <= daysInMonth)
@@ -3105,14 +3108,14 @@ bool Recurrence::getMonthlyDayDays(QValueList<int> &list, int daysInMonth) const
// Get the months which recur, in numerical order, for both leap years and non-leap years.
// 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) {
list.append(month); // date appears in February
@@ -3186,9 +3189,9 @@ QDate Recurrence::getFirstDateInMonth(const QDate &earliestDate) const
int daysInMonth = earliestDate.daysInMonth();
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;
if (day >= earliestDay && day < minday)
@@ -3200,11 +3203,11 @@ 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);
}
break;
@@ -3223,9 +3226,9 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const
int daysInMonth = latestDate.daysInMonth();
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;
if (day <= latestDay && day > maxday)
@@ -3237,11 +3240,11 @@ 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);
}
break;
@@ -3255,9 +3258,9 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const
* Note that rYearNums is sorted in numerical order.
*/
QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const
{
- QPtrListIterator<int> it(rYearNums);
+ Q3PtrListIterator<int> it(rYearNums);
switch (recurs) {
case rYearlyMonth: {
int day = recurStart().date().day();
int earliestYear = earliestDate.year();
@@ -3291,18 +3294,18 @@ 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();
for ( ; it.current(); ++it) {
int month = *it.current();
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);
}
earliestDay = 1;
@@ -3328,9 +3331,9 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const
* Note that rYearNums is sorted in numerical order.
*/
QDate Recurrence::getLastDateInYear(const QDate &latestDate) const
{
- QPtrListIterator<int> it(rYearNums);
+ Q3PtrListIterator<int> it(rYearNums);
switch (recurs) {
case rYearlyMonth: {
int day = recurStart().date().day();
int latestYear = latestDate.year();
@@ -3363,18 +3366,18 @@ 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();
for (it.toLast(); it.current(); --it) {
int month = *it.current();
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);
}
latestDay = 31;
diff --git a/libkcal/recurrence.h b/libkcal/recurrence.h
index b13d14f..5b5aab1 100644
--- a/libkcal/recurrence.h
+++ b/libkcal/recurrence.h
@@ -23,9 +23,11 @@
#define KCAL_RECURRENCE_H
#include <qstring.h>
#include <qbitarray.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
+//Added by qt3to4:
+#include <Q3ValueList>
namespace KCal {
class Incidence;
@@ -247,11 +249,11 @@ class Recurrence
* @var _rDay the date in the month to recur.
*/
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
* @var freq the frequency to recur, e.g. 3 for every third year.
@@ -278,11 +280,11 @@ class Recurrence
* Parameters are the same as for addMonthlyPos().
*/
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. */
static void setFeb29YearlyTypeDefault(Feb29Type t) { mFeb29YearlyDefaultType = t; }
@@ -293,10 +295,10 @@ class Recurrence
Debug output.
*/
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 };
struct MonthlyData; friend struct MonthlyData;
@@ -344,11 +346,11 @@ class Recurrence
int yearlyDayCalcToDate(const QDate& enddate, YearlyDayData&) const;
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;
QDate getFirstDateInMonth(const QDate& earliestDate) const;
@@ -365,15 +367,15 @@ 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
@@ -19,9 +19,11 @@
*/
#include <qdir.h>
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#include <klocale.h>
#include <kdebug.h>
#include <kstandarddirs.h>
@@ -263,10 +265,10 @@ bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status sta
Todo *to = mCalendar->todo(incidence->uid());
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;
Attendee *attEv;
@@ -341,13 +343,13 @@ bool Scheduler::acceptFreeBusy(IncidenceBase *incidence, Method method)
freebusy->setOrganizer(from);
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();
deleteTransaction(incidence);
diff --git a/libkcal/scheduler.h b/libkcal/scheduler.h
index a9f43b9..357e98e 100644
--- a/libkcal/scheduler.h
+++ b/libkcal/scheduler.h
@@ -22,9 +22,9 @@
// iTIP transactions base class
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
namespace KCal {
class IncidenceBase;
@@ -94,9 +94,9 @@ class Scheduler {
method is specified as the method argumanet and can be any valid iTIP
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
on which the transaction acts. The status is the result of processing a
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index 9b757f7..b8c2aa7 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -21,14 +21,14 @@
#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>
@@ -365,13 +365,13 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
fileName = "/tmp/events.txt";
}
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();
status.setText( i18n("Processing events ...") );
@@ -387,9 +387,9 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
} else {
fileName = "/tmp/todo.txt";
}
file.setName( fileName );
- if (!file.open( IO_ReadOnly ) ) {
+ if (!file.open( QIODevice::ReadOnly ) ) {
return false;
}
ts.setDevice( &file );
@@ -474,9 +474,9 @@ bool SharpFormat::save( Calendar *calendar)
QString answer;
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;
QString changeString = ePrefix;
@@ -502,12 +502,12 @@ 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();
//command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName;
@@ -516,13 +516,13 @@ bool SharpFormat::save( Calendar *calendar)
//qDebug("%s ",command.latin1());
//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();
//qDebug("answer \n%s ", answer.latin1());
@@ -543,13 +543,13 @@ bool SharpFormat::save( Calendar *calendar)
qApp->processEvents();
//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();
command = "db2file datebook -w -g -c " + codec+ " < "+ fileName;
@@ -561,13 +561,13 @@ bool SharpFormat::save( Calendar *calendar)
qApp->processEvents();
//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();
command = "db2file datebook -d -c " + codec+ " < "+ fileName;
@@ -579,9 +579,9 @@ bool SharpFormat::save( Calendar *calendar)
changeString = tPrefix;
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 # ");
procCount = 0;
@@ -604,22 +604,22 @@ 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();
//qDebug("answer \n%s ", answer.latin1());
@@ -641,13 +641,13 @@ bool SharpFormat::save( Calendar *calendar)
qApp->processEvents();
//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();
command = "db2file todo -w -g -c " + codec+ " < "+ fileName;
@@ -659,13 +659,13 @@ bool SharpFormat::save( Calendar *calendar)
qApp->processEvents();
//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();
command = "db2file todo -d -c " + codec+ " < "+ fileName;
@@ -782,9 +782,9 @@ 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;
else
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index cc1c5ae..5a0c32e 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -622,9 +622,9 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_d
// if ( QDateTime::currentDateTime() > incidenceStart ){
// *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 ) {
alarmStart = alarm->time();
diff --git a/libkcal/todo.h b/libkcal/todo.h
index 2131732..cea976c 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -25,8 +25,10 @@
#include "incidence.h"
#include <qtimer.h>
+//Added by qt3to4:
+#include <Q3CString>
namespace KCal {
/**
@@ -39,9 +41,9 @@ namespace KCal {
Todo();
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. */
Incidence *clone();
diff --git a/libkcal/vcaldrag.cpp b/libkcal/vcaldrag.cpp
index f01f332..324981e 100644
--- a/libkcal/vcaldrag.cpp
+++ b/libkcal/vcaldrag.cpp
@@ -25,9 +25,9 @@
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
@@ -21,17 +21,17 @@
#ifndef VCALDRAG_H
#define VCALDRAG_H
-#include <qdragobject.h>
+#include <q3dragobject.h>
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 );
~VCalDrag() {};
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 2e19740..9cbaf16 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -21,13 +21,15 @@
#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>
#include <kmessagebox.h>
@@ -107,17 +109,17 @@ bool VCalFormat::save(Calendar *calendar, const QString &fileName)
addPropValue(vcal,VCTimeZoneProp, tmpStr.local8Bit());
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);
addVObjectProp(vcal, vo);
@@ -137,9 +139,9 @@ bool VCalFormat::save(Calendar *calendar, const QString &fileName)
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;
VObject *vcal = Parse_MIME( data.data(), data.size());
@@ -209,9 +211,9 @@ QString VCalFormat::toString( Calendar *calendar )
addPropValue( vcal, VCTimeZoneProp, tmpStr.local8Bit() );
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;
VObject *vevent = eventToVEvent( event );
@@ -270,10 +272,10 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
addPropValue(vtodo, ICOrganizerProp, tmpStr.local8Bit());
// 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) {
curAttendee = ai.current();
@@ -325,9 +327,9 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
tmpStr.sprintf("%i",anEvent->priority());
addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit());
// related event
- if (anEvent->relatedToUid()) {
+ if (!anEvent->relatedToUid().isEmpty()) {
addPropValue(vtodo, VCRelatedToProp,
anEvent->relatedToUid().local8Bit());
}
@@ -354,9 +356,9 @@ 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()) {
VObject *a;
@@ -432,10 +434,10 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
tmpStr = "MAILTO:" + anEvent->organizer();
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
for (; ai.current(); ++ai) {
@@ -460,10 +462,10 @@ 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;
int i;
@@ -544,9 +546,9 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
tmpStr += tmpStr2;
} 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());
} // event repeats
@@ -624,9 +626,9 @@ 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());
// resources
@@ -635,9 +637,9 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
if (!tmpStr.isEmpty())
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()) {
VObject *a ;
@@ -671,9 +673,9 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
tmpStr.sprintf("%i",anEvent->transparency());
addPropValue(vevent, VCTranspProp, tmpStr.local8Bit());
// related event
- if (anEvent->relatedToUid()) {
+ if (!anEvent->relatedToUid().isEmpty()) {
addPropValue(vevent, VCRelatedToProp,
anEvent->relatedToUid().local8Bit());
}
@@ -1407,9 +1409,9 @@ Event* VCalFormat::VEventToEvent(VObject *vevent)
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());
return tmpStr;
@@ -1419,10 +1421,10 @@ QString VCalFormat::qDateToISO(const QDate &qd)
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",
tmpDT.date().year(), tmpDT.date().month(),
@@ -1453,10 +1455,10 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr)
second = tmpStr.mid(13,2).toInt();
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')
tmpDT = tmpDT.addSecs (KGlobal::locale()->localTimeOffset( tmpDT )*60);
@@ -1647,9 +1649,9 @@ 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";
return "ATTENDEE";
@@ -1685,9 +1687,9 @@ 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:
case Attendee::NeedsAction:
diff --git a/libkcal/vcalformat.h b/libkcal/vcalformat.h
index 6dae3d2..cac9634 100644
--- a/libkcal/vcalformat.h
+++ b/libkcal/vcalformat.h
@@ -22,8 +22,11 @@
#ifndef _VCALFORMAT_H
#define _VCALFORMAT_H
#include "calformat.h"
+//Added by qt3to4:
+#include <Q3CString>
+#include <Q3PtrList>
#define _VCAL_VERSION "1.0"
class VObject;
@@ -94,19 +97,19 @@ class VCalFormat : public CalFormat {
* i.e. MO, TU, WE, etc. */
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
};
}