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
@@ -23,12 +23,14 @@
#include <klocale.h>
#include "incidence.h"
#include "todo.h"
#include "alarm.h"
+//Added by qt3to4:
+#include <Q3ValueList>
using namespace KCal;
#include <qwidget.h>
Alarm::Alarm(Incidence *parent)
: mParent(parent),
mType(Audio),
@@ -209,13 +211,13 @@ void Alarm::setProgramArguments(const QString &arguments)
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;
mMailAddresses = addressees;
mMailAttachFiles = attachments;
@@ -228,13 +230,13 @@ void Alarm::setMailAddress(const Person &mailAddress)
mMailAddresses.clear();
mMailAddresses += mailAddress;
mParent->updated();
}
}
-void Alarm::setMailAddresses(const QValueList<Person> &mailAddresses)
+void Alarm::setMailAddresses(const Q3ValueList<Person> &mailAddresses)
{
if (mType == Email) {
mMailAddresses = mailAddresses;
mParent->updated();
}
}
@@ -244,15 +246,15 @@ void Alarm::addMailAddress(const Person &mailAddress)
if (mType == Email) {
mMailAddresses += 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)
{
if (mType == Email) {
mMailSubject = mailAlarmSubject;
diff --git a/libkcal/alarm.h b/libkcal/alarm.h
index ac6ea0d..b24f0f7 100644
--- a/libkcal/alarm.h
+++ b/libkcal/alarm.h
@@ -19,13 +19,13 @@
*/
#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"
namespace KCal {
@@ -36,13 +36,13 @@ class Incidence;
This class represents an alarm notification.
*/
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. */
~Alarm();
@@ -109,29 +109,29 @@ class Alarm : public CustomProperties
/** Set the alarm to be an email alarm.
@param subject subject line of email.
@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.
*/
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.
*/
void setMailSubject(const QString &mailAlarmSubject);
/** return the subject line of the mail */
@@ -223,13 +223,13 @@ class Alarm : public CustomProperties
private:
Incidence *mParent; // the incidence which this alarm belongs to
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
int mAlarmRepeatCount; // number of times for alarm to repeat
// after the initial time
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index 9b38d3f..bf095cf 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -27,12 +27,14 @@
#include "exceptions.h"
#include "calfilter.h"
#include "calendar.h"
#include "syncdefines.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
Calendar::Calendar()
{
@@ -268,111 +270,111 @@ void Calendar::setFilter(CalFilter *filter)
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 );
}
}
bool Calendar::addIncidence(Incidence *i)
@@ -404,15 +406,15 @@ Incidence* Calendar::incidence( const QString& uid )
if( (i = journal( uid )) != 0 )
return i;
return 0;
}
-QPtrList<Todo> Calendar::todos()
+Q3PtrList<Todo> Calendar::todos()
{
- QPtrList<Todo> tl = rawTodos();
+ Q3PtrList<Todo> tl = rawTodos();
mFilter->apply( &tl );
return tl;
}
// When this is called, the todo have already been added to the calendar.
// This method is only about linking related todos
@@ -452,13 +454,13 @@ void Calendar::setupRelations( Incidence *incidence )
// If a task with subtasks is deleted, move it's subtasks to the orphans list
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 );
i->setRelatedTo( 0 );
i->setRelatedToUid( uid );
@@ -468,13 +470,13 @@ void Calendar::removeRelations( Incidence *incidence )
if( incidence->relatedTo() )
incidence->relatedTo()->removeRelation( 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 );
}
Incidence* inc = tempList.first();
while ( inc ) {
@@ -484,13 +486,13 @@ void Calendar::removeRelations( Incidence *incidence )
}
// LR: and another big bad bug found
#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
@@ -22,14 +22,14 @@
#ifndef CALENDAR_H
#define CALENDAR_H
#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"
#include "journal.h"
#include "calfilter.h"
@@ -85,13 +85,13 @@ public:
virtual void clearUndo( Incidence * newUndo );
/**
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; }
/**
Return the owner of the calendar's full name.
*/
@@ -152,18 +152,18 @@ public:
// Adds an incidence and all relatedto incidences to the cal
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
@return true on success, false on error.
@@ -182,33 +182,33 @@ public:
virtual Event *event( QString, QString ) = 0;
/**
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.
@return true on success, false on error.
*/
@@ -219,47 +219,47 @@ public:
*/
virtual void deleteTodo( Todo * ) = 0;
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.
*/
virtual Todo *todo( const QString &uid ) = 0;
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.
@return true on success, false on error.
*/
virtual bool addJournal( Journal * ) = 0;
/**
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.
*/
Incidence* incidence( const QString&UID );
@@ -332,23 +332,23 @@ public:
void removeAlarm(const QDateTime &qdt, const QString &noti );
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;
int mDefaultCalendar;
bool mDeleteIncidencesOnClose;
@@ -373,13 +373,13 @@ private:
bool mModified;
QString mLoadedProductId;
// This list is used to put together related todos
- QDict<Incidence> mOrphans;
- QDict<Incidence> mOrphanUids;
+ Q3Dict<Incidence> mOrphans;
+ Q3Dict<Incidence> mOrphanUids;
};
}
#endif
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index ce3cd09..cb52b7c 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -19,13 +19,13 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qdatetime.h>
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <kdebug.h>
#include <kconfig.h>
#include <kglobal.h>
#include <klocale.h>
@@ -189,21 +189,21 @@ bool CalendarLocal::mergeCalendar( Calendar* remote )
{
// 1 look for raw inc in local
// if inc not in remote, delete in local
// 2 look for raw inc in remote
// if inc in local, replace it
// if not in local, add it to default calendar
- QPtrList<Incidence> localInc = rawIncidences();
+ Q3PtrList<Incidence> localInc = rawIncidences();
Incidence* inL = localInc.first();
while ( inL ) {
if ( ! inL->isReadOnly () )
if ( !remote->incidenceForUid( inL->uid(), true ))
deleteIncidence( inL );
inL = localInc.next();
}
- QPtrList<Incidence> er = remote->rawIncidences();
+ Q3PtrList<Incidence> er = remote->rawIncidences();
Incidence* inR = er.first();
while ( inR ) {
inL = incidenceForUid( inR->uid(),false );
if ( inL ) {
if ( ! inL->isReadOnly () || inL->uid().left(15) == QString("last-syncEvent-") ) {
int calID = inL->calID();
@@ -256,15 +256,15 @@ void CalendarLocal::setSyncEventsReadOnly()
}
void CalendarLocal::addCalendar( Calendar* cal )
{
cal->setDontDeleteIncidencesOnClose();
setSyncEventsEnabled();
- QPtrList<Incidence> incList;
+ Q3PtrList<Incidence> incList;
{
- QPtrList<Event> EventList = cal->rawEvents();
+ Q3PtrList<Event> EventList = cal->rawEvents();
Event * ev = EventList.first();
while ( ev ) {
if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) {
ev->setCalID_block( 1 );
}
Event * se = event( ev->uid() );
@@ -276,13 +276,13 @@ void CalendarLocal::addCalendar( Calendar* cal )
ev = EventList.next();
}
}
{
- QPtrList<Todo> TodoList = cal->rawTodos();
+ Q3PtrList<Todo> TodoList = cal->rawTodos();
Todo * ev = TodoList.first();
while ( ev ) {
ev->resetRelatedTo();
Todo * se = todo( ev->uid() );
if ( se )
deleteTodo( se );
@@ -296,13 +296,13 @@ void CalendarLocal::addCalendar( Calendar* cal )
mTodoList.append( ev );
setupRelations( ev );
ev = TodoList.next();
}
}
{
- QPtrList<Journal> JournalList = cal->journals();
+ Q3PtrList<Journal> JournalList = cal->journals();
Journal * ev = JournalList.first();
while ( ev ) {
Journal * se = journal( ev->uid() );
if ( se )
incList.append( se );
ev->unRegisterObserver( cal );
@@ -478,15 +478,15 @@ void CalendarLocal::deleteTodo( Todo *todo )
}
Todo* dup = todoForUid( uid );
if ( dup )
setupRelations( dup );
}
-QPtrList<Todo> CalendarLocal::rawTodos()
+Q3PtrList<Todo> CalendarLocal::rawTodos()
{
- QPtrList<Todo> el;
+ Q3PtrList<Todo> el;
for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
if ( it->calEnabled() ) el.append( it );
return el;
}
Todo *CalendarLocal::todo( QString syncProf, QString id )
{
@@ -496,19 +496,19 @@ Todo *CalendarLocal::todo( QString syncProf, QString id )
}
return 0;
}
void CalendarLocal::removeSyncInfo( QString syncProfile)
{
- QPtrList<Incidence> all = rawIncidences() ;
+ Q3PtrList<Incidence> all = rawIncidences() ;
Incidence *inc;
for ( inc = all.first(); inc; inc = all.next() ) {
inc->removeID( syncProfile );
}
if ( syncProfile.isEmpty() ) {
- QPtrList<Event> el;
+ Q3PtrList<Event> el;
Event *todo;
for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
el.append( todo );
}
for ( todo = el.first(); todo; todo = el.next() ) {
@@ -517,15 +517,15 @@ void CalendarLocal::removeSyncInfo( QString syncProfile)
} else {
Event *lse = event( "last-syncEvent-"+ syncProfile);
if ( lse )
deleteIncidence ( lse );
}
}
-QPtrList<Event> CalendarLocal::getExternLastSyncEvents()
+Q3PtrList<Event> CalendarLocal::getExternLastSyncEvents()
{
- QPtrList<Event> el;
+ Q3PtrList<Event> el;
Event *todo;
for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
if ( todo->summary().left(3) == "E: " )
el.append( todo );
}
@@ -682,15 +682,15 @@ void CalendarLocal::deRegisterAlarm()
mNextAlarmEventDateTime = QDateTime();
// #ifndef DESKTOP_VERSION
// AlarmServer::deleteAlarm (mNextAlarmDateTime ,"koalarm" ,mLastAlarmNotificationString.latin1() );
// #endif
}
-QPtrList<Todo> CalendarLocal::todos( const QDate &date )
+Q3PtrList<Todo> CalendarLocal::todos( const QDate &date )
{
- QPtrList<Todo> todos;
+ Q3PtrList<Todo> todos;
Todo *todo;
for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
if ( !todo->calEnabled() ) continue;
if ( todo->hasDueDate() && todo->dtDue().date() == date ) {
todos.append( todo );
@@ -783,13 +783,13 @@ Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to )
return alarms;
}
void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence,
const QDateTime &from, const QDateTime &to )
{
- QPtrList<Alarm> alarmList = incidence->alarms();
+ Q3PtrList<Alarm> alarmList = incidence->alarms();
Alarm *alarm;
for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) {
// kdDebug(5800) << "CalendarLocal::appendAlarms() '" << alarm->text()
// << "': " << alarm->time().toString() << " - " << alarm->enabled() << endl;
if ( alarm->enabled() ) {
if ( alarm->time() >= from && alarm->time() <= to ) {
@@ -802,13 +802,13 @@ void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence,
void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms,
Incidence *incidence,
const QDateTime &from,
const QDateTime &to )
{
- QPtrList<Alarm> alarmList = incidence->alarms();
+ Q3PtrList<Alarm> alarmList = incidence->alarms();
Alarm *alarm;
QDateTime qdt;
for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) {
if (incidence->recursOn(from.date())) {
qdt.setTime(alarm->time().time());
qdt.setDate(from.date());
@@ -841,15 +841,15 @@ void CalendarLocal::update( IncidenceBase *incidence )
void CalendarLocal::insertEvent( Event *event )
{
if ( mEventList.findRef( event ) < 0 ) mEventList.append( event );
}
-QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
+Q3PtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
{
- QPtrList<Event> eventList;
+ Q3PtrList<Event> eventList;
Event *event;
for( event = mEventList.first(); event; event = mEventList.next() ) {
if ( !event->calEnabled() ) continue;
if ( event->doesRecur() ) {
if ( event->isMultiDay() ) {
@@ -875,13 +875,13 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
if ( !sorted ) {
return eventList;
}
// kdDebug(5800) << "Sorting events for date\n" << endl;
// now, we have to sort it based on dtStart.time()
- QPtrList<Event> eventListSorted;
+ Q3PtrList<Event> eventListSorted;
Event *sortEvent;
for ( event = eventList.first(); event; event = eventList.next() ) {
sortEvent = eventListSorted.first();
int i = 0;
while ( sortEvent && event->dtStart().time()>=sortEvent->dtStart().time() )
{
@@ -891,18 +891,18 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
eventListSorted.insert( i, event );
}
return eventListSorted;
}
-QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
+Q3PtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
bool inclusive )
{
Event *event = 0;
- QPtrList<Event> eventList;
+ Q3PtrList<Event> eventList;
// Get non-recurring events
for( event = mEventList.first(); event; event = mEventList.next() ) {
if ( !event->calEnabled() ) continue;
if ( event->doesRecur() ) {
QDate rStart = event->dtStart().date();
@@ -920,13 +920,13 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
// TODO: Calculate end date from duration. Should be done in Event
// For now exclude all events with a duration.
}
}
} else {
bool founOne;
- QDate next = event->getNextOccurence( start, &founOne ).date();
+ QDate next = event->getNextOccurence( (QDateTime)start, &founOne ).date();
if ( founOne ) {
if ( next <= end ) {
found = true;
}
}
@@ -969,20 +969,20 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
}
}
return eventList;
}
-QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt )
+Q3PtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt )
{
return rawEventsForDate( qdt.date() );
}
-QPtrList<Event> CalendarLocal::rawEvents()
+Q3PtrList<Event> CalendarLocal::rawEvents()
{
- QPtrList<Event> el;
+ Q3PtrList<Event> el;
for ( Event *it = mEventList.first(); it; it = mEventList.next() )
if ( it->calEnabled() ) el.append( it );
return el;
}
bool CalendarLocal::addJournal(Journal *journal)
@@ -1003,15 +1003,15 @@ void CalendarLocal::deleteJournal( Journal *journal )
clearUndo(journal);
if ( mJournalList.removeRef(journal) ) {
setModified( true );
}
}
-QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date )
+Q3PtrList<Journal> CalendarLocal::journals4Date( const QDate & date )
{
- QPtrList<Journal> el;
+ Q3PtrList<Journal> el;
for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
if ( it->calEnabled() && it->dtStart().date() == date) el.append( it );
return el;
}
Journal *CalendarLocal::journal( const QDate &date )
{
@@ -1037,43 +1037,43 @@ Journal *CalendarLocal::journal( const QString &uid )
retVal = it;
}
}
return retVal;
}
-QPtrList<Journal> CalendarLocal::journals()
+Q3PtrList<Journal> CalendarLocal::journals()
{
- QPtrList<Journal> el;
+ Q3PtrList<Journal> el;
for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
if ( it->calEnabled() ) el.append( it );
return el;
}
void CalendarLocal::setCalendarRemove( int id )
{
{
- QPtrList<Event> EventList = mEventList;
+ Q3PtrList<Event> EventList = mEventList;
Event * ev = EventList.first();
while ( ev ) {
if ( ev->calID() == id && ev->uid().left( 15 ) != QString("last-syncEvent-") )
deleteEvent( ev );
ev = EventList.next();
}
}
{
- QPtrList<Todo> TodoList = mTodoList;
+ Q3PtrList<Todo> TodoList = mTodoList;
Todo * ev = TodoList.first();
while ( ev ) {
if ( ev->calID() == id )
deleteTodo( ev );
ev = TodoList.next();
}
}
{
- QPtrList<Journal> JournalList = mJournalList;
+ Q3PtrList<Journal> JournalList = mJournalList;
Journal * ev = JournalList.first();
while ( ev ) {
if ( ev->calID() == id )
deleteJournal( ev );
ev = JournalList.next();
}
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index 1ceabce..1df65c7 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -20,12 +20,14 @@
Boston, MA 02111-1307, USA.
*/
#ifndef KCAL_CALENDARLOCAL_H
#define KCAL_CALENDARLOCAL_H
#include "calendar.h"
+//Added by qt3to4:
+#include <Q3PtrList>
namespace KCal {
class CalFormat;
/**
@@ -90,14 +92,14 @@ class CalendarLocal : public Calendar
Retrieves an event on the basis of the unique string ID.
*/
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 );
bool addTodoNoDup( Todo *todo );
/**
@@ -109,23 +111,23 @@ class CalendarLocal : public Calendar
returns a pointer or null.
*/
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.
*/
bool addJournal( Journal * );
/**
@@ -133,21 +135,21 @@ class CalendarLocal : public Calendar
*/
void deleteJournal( Journal * );
/**
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.
*/
Alarm::List alarms( const QDateTime &from, const QDateTime &to );
@@ -171,22 +173,22 @@ class CalendarLocal : public Calendar
void update( IncidenceBase *incidence );
/**
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);
public slots:
@@ -221,14 +223,14 @@ public slots:
void appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence,
const QDateTime &from, const QDateTime &to );
private:
void init();
- QPtrList<Event> mEventList;
- QPtrList<Todo> mTodoList;
- QPtrList<Journal> mJournalList;
+ Q3PtrList<Event> mEventList;
+ Q3PtrList<Todo> mTodoList;
+ Q3PtrList<Journal> mJournalList;
};
}
#endif
diff --git a/libkcal/calfilter.cpp b/libkcal/calfilter.cpp
index 72f70c2..fa1dbd5 100644
--- a/libkcal/calfilter.cpp
+++ b/libkcal/calfilter.cpp
@@ -18,12 +18,14 @@
Boston, MA 02111-1307, USA.
*/
#include <kdebug.h>
#include "calfilter.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
CalFilter::CalFilter()
{
mEnabled = true;
@@ -38,13 +40,13 @@ 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;
Event *event = eventlist->first();
@@ -58,13 +60,13 @@ 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) {
if (!filterTodo(event)) {
eventlist->remove();
diff --git a/libkcal/calfilter.h b/libkcal/calfilter.h
index e349770..821149f 100644
--- a/libkcal/calfilter.h
+++ b/libkcal/calfilter.h
@@ -19,13 +19,13 @@
*/
#ifndef _CALFILTER_H
#define _CALFILTER_H
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include "event.h"
#include "todo.h"
#include "journal.h"
namespace KCal {
@@ -52,21 +52,21 @@ class CalFilter {
QString name() const { return mName; }
/**
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.
*/
bool filterEvent(Event *);
diff --git a/libkcal/customproperties.cpp b/libkcal/customproperties.cpp
index adc1710..16f4a28 100644
--- a/libkcal/customproperties.cpp
+++ b/libkcal/customproperties.cpp
@@ -16,12 +16,14 @@
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "customproperties.h"
+//Added by qt3to4:
+#include <Q3CString>
using namespace KCal;
CustomProperties::CustomProperties()
{
}
@@ -32,71 +34,71 @@ 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;
int len = name.length();
if (len < 2 || n[0] != 'X' || n[1] != '-')
diff --git a/libkcal/customproperties.h b/libkcal/customproperties.h
index 0cbfdcd..75eb3ad 100644
--- a/libkcal/customproperties.h
+++ b/libkcal/customproperties.h
@@ -20,12 +20,14 @@
#ifndef KCAL_CUSTOM_PROPERTIES_H
#define KCAL_CUSTOM_PROPERTIES_H
#include <qstring.h>
#include <qmap.h>
+//Added by qt3to4:
+#include <Q3CString>
namespace KCal {
/**
This class represents custom calendar properties.
It is used as a base class for classes which represent calendar components.
@@ -46,52 +48,52 @@ class CustomProperties
/** Create or modify a custom calendar property.
@param app Application name as it appears in the custom property name.
@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
};
}
#endif
diff --git a/libkcal/dndfactory.cpp b/libkcal/dndfactory.cpp
index cdcfae4..ca7e212 100644
--- a/libkcal/dndfactory.cpp
+++ b/libkcal/dndfactory.cpp
@@ -19,12 +19,15 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qapplication.h>
#include <qclipboard.h>
+//Added by qt3to4:
+#include <QDropEvent>
+#include <Q3PtrList>
#include <kiconloader.h>
#include <kdebug.h>
#include <kmessagebox.h>
#include <klocale.h>
@@ -65,13 +68,13 @@ Event *DndFactory::createDrop(QDropEvent *de)
CalendarLocal cal( mCalendar->timeZoneId() );
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;
}
}
@@ -84,13 +87,13 @@ Todo *DndFactory::createDropTodo(QDropEvent *de)
CalendarLocal cal( mCalendar->timeZoneId() );
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;
}
}
@@ -130,13 +133,13 @@ Incidence *DndFactory::pasteIncidence(const QDate &newDate, const QTime *newTime
if ( !ICalDrag::decode( cb->data(), &cal ) &&
!VCalDrag::decode( cb->data(), &cal ) ) {
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();
inc->recreate();
diff --git a/libkcal/dndfactory.h b/libkcal/dndfactory.h
index 2df5259..a873c37 100644
--- a/libkcal/dndfactory.h
+++ b/libkcal/dndfactory.h
@@ -1,6 +1,8 @@
+//Added by qt3to4:
+#include <QDropEvent>
/*
This file is part of libkcal.
Copyright (c) 1998 Preston Brown
Copyright (c) 2001,2002,2003 Cornelius Schumacher <schumacher@kde.org>
Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
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
@@ -22,12 +22,14 @@
// $Id$
#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
@@ -20,13 +20,15 @@
//
// 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"
#include "icalformat.h"
@@ -65,32 +67,32 @@ bool DummyScheduler::performTransaction(IncidenceBase *incidence,Method method)
return saveMessage(messageText);
}
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;
messageString += messageLine + "\n";
if (messageLine.find("END:VCALENDAR") >= 0) {
diff --git a/libkcal/dummyscheduler.h b/libkcal/dummyscheduler.h
index df42153..f86d583 100644
--- a/libkcal/dummyscheduler.h
+++ b/libkcal/dummyscheduler.h
@@ -21,12 +21,14 @@
#define DUMMYSCHEDULER_H
//
// Dummy implementation of iTIP methods
//
#include "scheduler.h"
+//Added by qt3to4:
+#include <Q3PtrList>
namespace KCal {
/**
This class implements the iTIP interface as a primitive local version for
testing. It uses a file dummyscheduler.store as inbox/outbox.
@@ -36,13 +38,13 @@ class DummyScheduler : public Scheduler {
DummyScheduler(Calendar *);
virtual ~DummyScheduler();
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
@@ -381,13 +381,13 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_
int off = 0;
QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
// 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();
enabled = true;
off = alarmStart.secsTo( incidenceStart );
diff --git a/libkcal/event.h b/libkcal/event.h
index 6a58618..da44f81 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -22,12 +22,14 @@
#define EVENT_H
//
// 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.
*/
class Event : public Incidence
@@ -37,13 +39,13 @@ class Event : public Incidence
typedef ListBase<Event> List;
Event();
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;
/** for setting an event's ending date/time with a QDateTime. */
diff --git a/libkcal/filestorage.cpp b/libkcal/filestorage.cpp
index a139124..3d1309f 100644
--- a/libkcal/filestorage.cpp
+++ b/libkcal/filestorage.cpp
@@ -19,13 +19,13 @@
*/
#include <stdlib.h>
#include <qdatetime.h>
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <kdebug.h>
#include "calendar.h"
#include "vcaldrag.h"
#include "vcalformat.h"
diff --git a/libkcal/freebusy.cpp b/libkcal/freebusy.cpp
index ba15d6d..e4e9ec9 100644
--- a/libkcal/freebusy.cpp
+++ b/libkcal/freebusy.cpp
@@ -18,12 +18,15 @@
Boston, MA 02111-1307, USA.
*/
#include <kdebug.h>
#include "freebusy.h"
+//Added by qt3to4:
+#include <Q3ValueList>
+#include <Q3PtrList>
using namespace KCal;
FreeBusy::FreeBusy()
{
}
@@ -40,13 +43,13 @@ FreeBusy::FreeBusy( Calendar *calendar, const QDateTime &start, const QDateTime
mCalendar = calendar;
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);
QDate day;
QDateTime tmpStart;
@@ -110,13 +113,13 @@ bool FreeBusy::setDtEnd( const QDateTime &end )
QDateTime FreeBusy::dtEnd() const
{
return mDtEnd;
}
-QValueList<Period> FreeBusy::busyPeriods() const
+Q3ValueList<Period> FreeBusy::busyPeriods() const
{
return mBusyPeriods;
}
bool FreeBusy::addLocalPeriod(const QDateTime &eventStart, const QDateTime &eventEnd ) {
QDateTime tmpStart;
@@ -143,20 +146,20 @@ bool FreeBusy::addLocalPeriod(const QDateTime &eventStart, const QDateTime &even
Period p(tmpStart, tmpEnd);
mBusyPeriods.append( p );
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;
while( mBusyPeriods.count() > 0 ) {
diff --git a/libkcal/freebusy.h b/libkcal/freebusy.h
index d741c72..bd14cb7 100644
--- a/libkcal/freebusy.h
+++ b/libkcal/freebusy.h
@@ -21,14 +21,16 @@
#define KCAL_FREEBUSY_H
//
// 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"
#include "incidencebase.h"
@@ -40,34 +42,34 @@ namespace KCal {
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();
private:
//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;
};
}
#endif
diff --git a/libkcal/icaldrag.cpp b/libkcal/icaldrag.cpp
index 446a115..7f5a796 100644
--- a/libkcal/icaldrag.cpp
+++ b/libkcal/icaldrag.cpp
@@ -25,13 +25,13 @@
#include <kdebug.h>
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 );
setEncodedData( scal.utf8() );
}
diff --git a/libkcal/icaldrag.h b/libkcal/icaldrag.h
index fdf32b7..c1f73f4 100644
--- a/libkcal/icaldrag.h
+++ b/libkcal/icaldrag.h
@@ -19,19 +19,19 @@
Boston, MA 02111-1307, USA.
*/
#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 );
~ICalDrag() {};
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp
index 6f3a799..3829bc1 100644
--- a/libkcal/icalformat.cpp
+++ b/libkcal/icalformat.cpp
@@ -17,17 +17,17 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qdatetime.h>
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <qregexp.h>
#include <qclipboard.h>
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qtextcodec.h>
#include <stdlib.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
@@ -67,20 +67,20 @@ ICalFormat::~ICalFormat()
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 );
}
@@ -95,20 +95,20 @@ bool ICalFormat::save( Calendar *calendar, const QString &fileName )
// qDebug("to string takes ms: %d ",is.elapsed() );
if ( text.isNull() ) return false;
// 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;
}
@@ -153,64 +153,64 @@ bool ICalFormat::fromString( Calendar *cal, const QString &text )
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 )
{
setTimeZone( cal->timeZoneId(), !cal->isLocalTime() );
icalcomponent *calendar = mImpl->createCalendarComponent(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 ");
if ( mProcessEvents ) {
//qDebug("mProcessEvents ");
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);
//qDebug("events ");
if ( mProcessEvents )
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);
//qDebug("journals ");
if ( mProcessEvents )
diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h
index a770dbb..a454b35 100644
--- a/libkcal/icalformat.h
+++ b/libkcal/icalformat.h
@@ -18,12 +18,14 @@
Boston, MA 02111-1307, USA.
*/
#ifndef ICALFORMAT_H
#define ICALFORMAT_H
#include <qstring.h>
+//Added by qt3to4:
+#include <Q3CString>
#include "scheduler.h"
#include "calformat.h"
namespace KCal {
@@ -103,13 +105,13 @@ class ICalFormat : public CalFormat {
bool utc() const;
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
@@ -17,14 +17,17 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qdatetime.h>
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <qfile.h>
+//Added by qt3to4:
+#include <Q3ValueList>
+#include <Q3CString>
#include <kdebug.h>
#include <klocale.h>
#include <kglobal.h>
extern "C" {
@@ -218,14 +221,14 @@ icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy,
if (method == Scheduler::Request) {
icalcomponent_add_property(vfreebusy,icalproperty_new_uid(
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());
icalcomponent_add_property(vfreebusy, icalproperty_new_freebusy(period) );
}
@@ -381,18 +384,18 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence)
icalcomponent_add_property(parent,icalproperty_new_exdate(
writeICalDate(*exIt)));
}
}
// 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;
icalcomponent_add_component(parent,writeAlarm(alarm));
}
@@ -420,27 +423,27 @@ void ICalFormatImpl::writeIncidenceBase(icalcomponent *parent,IncidenceBase *inc
// organizer stuff
icalcomponent_add_property(parent,icalproperty_new_organizer(
("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()));
}
}
// custom properties
writeCustomProperties(parent, incidenceBase);
}
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);
}
}
@@ -543,14 +546,14 @@ icalproperty *ICalFormatImpl::writeRecurrenceRule(Recurrence *recur)
icalrecurrencetype_clear(&r);
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;
int i;
@@ -701,14 +704,14 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm)
icalcomponent_add_property(a,icalproperty_new_attach(attach));
icalattach_unref( attach );
}
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()));
}
icalcomponent_add_property(a,p);
}
@@ -760,14 +763,14 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm)
icalcomponent_add_property(a,icalproperty_new_repeat(alarm->repeatCount()));
icalcomponent_add_property(a,icalproperty_new_duration(
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);
}
return a;
@@ -1336,13 +1339,13 @@ void ICalFormatImpl::readIncidenceBase(icalcomponent *parent,IncidenceBase *inci
// custom properties
readCustomProperties(parent, incidenceBase);
}
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) {
QString value = QString::fromUtf8(icalproperty_get_x(p));
customProperties[icalproperty_get_x_name(p)] = value;
diff --git a/libkcal/icalformatimpl.h b/libkcal/icalformatimpl.h
index 203c302..3a35b4c 100644
--- a/libkcal/icalformatimpl.h
+++ b/libkcal/icalformatimpl.h
@@ -18,12 +18,14 @@
Boston, MA 02111-1307, USA.
*/
#ifndef ICALFORMATIMPL_H
#define ICALFORMATIMPL_H
#include <qstring.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#include "scheduler.h"
#include "freebusy.h"
extern "C" {
#include <ical.h>
@@ -90,14 +92,14 @@ class ICalFormatImpl {
ICalFormat *mParent;
Calendar *mCalendar;
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;
static const int mSecondsPerMinute;
diff --git a/libkcal/imipscheduler.cpp b/libkcal/imipscheduler.cpp
index e186f8e..e6d56a6 100644
--- a/libkcal/imipscheduler.cpp
+++ b/libkcal/imipscheduler.cpp
@@ -23,12 +23,14 @@
//
#include "event.h"
#include "icalformat.h"
#include "imipscheduler.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
IMIPScheduler::IMIPScheduler(Calendar *calendar)
: Scheduler(calendar)
{
@@ -47,12 +49,12 @@ bool IMIPScheduler::performTransaction(IncidenceBase *incidence,Method method)
{
mFormat->createScheduleMessage(incidence,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
@@ -20,13 +20,13 @@
#ifndef IMIPSCHEDULER_H
#define IMIPSCHEDULER_H
//
// iMIP implementation of iTIP methods
//
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include "scheduler.h"
namespace KCal {
/*
@@ -37,13 +37,13 @@ class IMIPScheduler : public Scheduler {
public:
IMIPScheduler(Calendar *);
virtual ~IMIPScheduler();
bool publish (IncidenceBase *incidence,const QString &recipients);
bool performTransaction(IncidenceBase *incidence,Method method);
- QPtrList<ScheduleMessage> retrieveTransactions();
+ Q3PtrList<ScheduleMessage> retrieveTransactions();
};
}
#endif // IMIPSCHEDULER_H
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 7dd9bd2..8fcdc69 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -23,12 +23,14 @@
#include <kdebug.h>
#include "calformat.h"
#include "incidence.h"
#include "todo.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
Incidence::Incidence() :
IncidenceBase(),
mRelatedTo(0), mSecrecy(SecrecyPublic), mPriority(3)
@@ -56,13 +58,13 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
mCategories = i.mCategories;
// Incidence *mRelatedTo; Incidence *mRelatedTo;
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 );
++itat;
}
@@ -70,13 +72,13 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
mResources = i.mResources;
mSecrecy = i.mSecrecy;
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 );
mAlarms.append( b );
@@ -95,13 +97,13 @@ 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);
if ( mRecurrence )
delete mRecurrence;
@@ -213,14 +215,14 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
{
qDebug("alarm not equal ");
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;
}
else {
return false;
@@ -319,13 +321,13 @@ void Incidence::recreate()
}
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 );
inc->cloneRelations( cloneInc );
}
@@ -353,13 +355,13 @@ QDateTime Incidence::lastModifiedSub()
if ( !mRelations.count() )
return lastModified();
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();
}
mLastModifiedSubSortKey.sprintf("%04d%02d%02d%02d%02d%02d",
mLastModifiedSub.date().year(),
@@ -444,13 +446,13 @@ void Incidence::addCategories(const QStringList &categories, bool addToRelations
mCategories.append( categories[i] );
}
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 );
}
}
}
@@ -459,13 +461,13 @@ void Incidence::setCategories(const QStringList &categories, bool setForRelation
if (mReadOnly) return;
mCategories = categories;
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 );
}
}
}
@@ -547,21 +549,21 @@ void Incidence::setRelatedTo(Incidence *relatedTo)
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 )
rel->append( this );
}
@@ -644,21 +646,21 @@ void Incidence::deleteAttachments(const QString& mime)
mAttachments.remove();
else
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);
++it;
}
@@ -734,13 +736,13 @@ QStringList Incidence::secrecyList()
list << secrecyName(SecrecyConfidential);
return list;
}
-QPtrList<Alarm> Incidence::alarms() const
+Q3PtrList<Alarm> Incidence::alarms() const
{
return mAlarms;
}
Alarm* Incidence::newAlarm()
{
@@ -768,13 +770,13 @@ void Incidence::clearAlarms()
updated();
}
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;
}
#include <stdlib.h>
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index f89942f..2940129 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -22,13 +22,15 @@
//
// Incidence - base class of calendaring components
//
#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"
#include "listbase.h"
#include "incidencebase.h"
@@ -110,13 +112,13 @@ class Incidence : public IncidenceBase
</pre>
*/
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 );
/**
Recreate event. The event is made a new unique event, but already stored
@@ -174,13 +176,13 @@ class Incidence : public IncidenceBase
/** point at some other event to which the event relates */
void setRelatedTo(Incidence *relatedTo);
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 *);
/** returns the list of dates which are exceptions to the recurrence rule */
@@ -199,15 +201,15 @@ class Incidence : public IncidenceBase
void addAttachment(Attachment *attachment);
/** remove and delete a specific attachment */
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);
/** return the event's secrecy. */
int secrecy() const;
@@ -232,13 +234,13 @@ class Incidence : public IncidenceBase
/** set the event's priority, 0 is undefined, 1 highest (decreasing order) */
void setPriority(int priority);
/** 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*);
/** Remove an alarm that is associated with this incidence */
void removeAlarm(Alarm*);
@@ -285,14 +287,14 @@ class Incidence : public IncidenceBase
void setLastModifiedSubInvalid();
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();
QString mLastModifiedSubSortKey;
bool mHoliday, mBirthday, mAnniversary;
@@ -305,13 +307,13 @@ protected:
QString mDescription;
QString mSummary;
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;
int mPriority; // 1 = highest, 2 = less, etc.
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 56c0560..f11ec54 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -24,12 +24,14 @@
#include <kidmanager.h>
#include "calformat.h"
#include "syncdefines.h"
#include "incidencebase.h"
+//Added by qt3to4:
+#include <Q3PtrList>
using namespace KCal;
IncidenceBase::IncidenceBase() :
mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false),
mPilotId(0), mSyncStatus(SYNCMOD)
@@ -61,13 +63,13 @@ IncidenceBase::IncidenceBase(const IncidenceBase &i) :
mHasDuration = i.mHasDuration;
mOrganizer = i.mOrganizer;
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;
mLastModified = i.mLastModified;
mPilotId = i.mPilotId;
@@ -297,13 +299,13 @@ void IncidenceBase::setFloats(bool f)
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)
return false;
++qli;
@@ -340,13 +342,13 @@ void IncidenceBase::clearAttendees()
mAttendees.clear();
}
#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)
return qli.current();
++qli;
@@ -354,26 +356,26 @@ Attendee *IncidenceBase::getAttendee(const char *n) const
return 0L;
}
#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())
return qli.current();
++qli;
}
return 0L;
}
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);
}
qli.toFirst();
@@ -488,13 +490,13 @@ void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer )
{
mObservers.remove( 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
@@ -22,21 +22,23 @@
//
// Incidence - base class of calendaring components
//
#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.
*/
class IncidenceBase : public CustomProperties
@@ -48,13 +50,13 @@ 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 &);
/** Return the unique id for the event */
QString uid() const;
@@ -106,13 +108,13 @@ class IncidenceBase : public CustomProperties
bool addAttendee(Attendee *a, bool doupdate=true );
// void removeAttendee(Attendee *a);
// 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 &);
/** Return first Attendee with one of this emails */
Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null);
@@ -165,26 +167,26 @@ class IncidenceBase : public CustomProperties
QString mLastModifiedKey;
QString mUid;
int mCalID;
bool mCalEnabled;
bool mAlarmEnabled;
QDateTime mLastModified;
- QPtrList<Attendee> mAttendees;
+ Q3PtrList<Attendee> mAttendees;
bool mFloats;
int mDuration;
bool mHasDuration;
QString mExternalId;
int mTempSyncStat;
// 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& );
}
#endif
diff --git a/libkcal/journal.h b/libkcal/journal.h
index 1cd0a22..c83356f 100644
--- a/libkcal/journal.h
+++ b/libkcal/journal.h
@@ -21,25 +21,27 @@
#define JOURNAL_H
//
// Journal component, representing a VJOURNAL object
//
#include "incidence.h"
+//Added by qt3to4:
+#include <Q3CString>
namespace KCal {
/**
This class provides a Journal in the sense of RFC2445.
*/
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;
private:
bool accept(Visitor &v) { return v.visit(this); }
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 733b897..bce68b0 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -1,12 +1,14 @@
#include "kincidenceformatter.h"
#include <kstaticdeleter.h>
#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;
static KStaticDeleter<KIncidenceFormatter> insd;
@@ -307,13 +309,13 @@ void KIncidenceFormatter::formatCategories(Incidence *event)
addTag("p",i18n("<b>Categories: </b>")+event->categoriesStrWithSpace() );
//mText.append(event->categoriesStr());
}
}
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)
{
if (number > 0) {
@@ -336,13 +338,13 @@ void KIncidenceFormatter::addTag(const QString & tag,const QString & text)
mText.append(str);
}
}
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"));
mText.append("<ul><li>");
#if 0
@@ -359,13 +361,13 @@ void KIncidenceFormatter::formatAttendees(Incidence *event)
} else {
mText.append(event->organizer());
}
#else
mText.append(event->organizer());
#endif
- if (iconPath) {
+ if (!iconPath.isEmpty()) {
mText += " <a href=\"mailto:" + event->organizer() + "\">";
mText += "<IMG src=\"" + iconPath + "\">";
mText += "</a>\n";
}
mText.append("</li></ul>");
@@ -399,13 +401,13 @@ void KIncidenceFormatter::formatAttendees(Incidence *event)
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
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
mText += "<IMG src=\"" + NOiconPath + "\">";
mText += "</a>\n";
diff --git a/libkcal/libkcal.pro b/libkcal/libkcal.pro
index 33c63c3..1f43b10 100644
--- a/libkcal/libkcal.pro
+++ b/libkcal/libkcal.pro
@@ -1,9 +1,9 @@
TEMPLATE = lib
CONFIG += qt warn_on
-TARGET = microkcal
+TARGET = xmicrokcal
include( ../variables.pri )
INCLUDEPATH += ../libkdepim ../microkde versit ../microkde/kdecore
#../qtcompat
INCLUDEPATH += ../libical/src/libical
@@ -103,6 +103,10 @@ dndfactory.cpp \
vcaldrag.cpp \
vcalformat.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,9 +1,9 @@
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
OBJECTS_DIR = obj/$(PLATFORM)
MOC_DIR = moc/$(PLATFORM)
diff --git a/libkcal/listbase.h b/libkcal/listbase.h
index 085b13d..6c942ef 100644
--- a/libkcal/listbase.h
+++ b/libkcal/listbase.h
@@ -18,70 +18,72 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#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;
/**
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 )
{
mAutoDelete = autoDelete;
}
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
@@ -19,21 +19,22 @@
Boston, MA 02111-1307, USA.
*/
#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>
#include <kmessagebox.h>
#include <phoneaccess.h>
@@ -198,13 +199,13 @@ ulong PhoneFormat::getCsumEvent( Event* event )
list.append( "2" );
list.append( QString::number( rec->frequency()) );//12
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
count = rmp.first()->rPos - 1;
list.append( QString::number( count ) );
@@ -238,13 +239,13 @@ ulong PhoneFormat::getCsumEvent( Event* event )
break;
}
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" );
}
}
@@ -302,13 +303,13 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
VCalFormat vfload;
vfload.setLocalTime ( true );
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();
if ( cat.contains( "MeetingDEF" )) {
ev->setCategories( QStringList() );
@@ -337,13 +338,13 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL );
event->setID( mProfileName,QString::number( id ) );
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();
if ( cat.contains( "MeetingDEF" )) {
ev->setCategories( QStringList() );
@@ -462,13 +463,13 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from )
else if (to->priority() == 4 && from->priority() == 5 )
;
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 );
inc->setCsum( mProfileName, csum);
inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
@@ -494,24 +495,24 @@ bool PhoneFormat::writeToPhone( Calendar * calendar)
}
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 );
} else {
}
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 );
} else {
if ( to->isCompleted()) {
@@ -549,13 +550,13 @@ bool PhoneFormat::save( Calendar *calendar)
// 6 compare data
//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());
status.setText ( message + QString::number ( ++procCount ) );
qApp->processEvents();
@@ -577,13 +578,13 @@ bool PhoneFormat::save( Calendar *calendar)
ev = er.next();
}
//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 ) );
qApp->processEvents();
Todo* to1 = tl1.first();
diff --git a/libkcal/qtopiaformat.cpp b/libkcal/qtopiaformat.cpp
index 0a4a031..2dfe1a4 100644
--- a/libkcal/qtopiaformat.cpp
+++ b/libkcal/qtopiaformat.cpp
@@ -18,17 +18,17 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qdatetime.h>
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <qregexp.h>
#include <qclipboard.h>
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qxml.h>
#include <kdebug.h>
#include <klocale.h>
#include "calendar.h"
@@ -306,18 +306,18 @@ bool QtopiaFormat::save( Calendar *calendar, const QString &fileName )
if ( text.isNull() ) return false;
// 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
@@ -26,12 +26,15 @@
#include <kglobal.h>
#include <klocale.h>
#include "incidence.h"
#include "recurrence.h"
+//Added by qt3to4:
+#include <Q3ValueList>
+#include <Q3PtrList>
using namespace KCal;
Recurrence::Feb29Type Recurrence::mFeb29YearlyDefaultType = Recurrence::rMar1;
@@ -53,13 +56,13 @@ Recurrence::Recurrence(Incidence *parent, int compatVersion)
rYearNums.setAutoDelete( true );
}
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),
mFloats(r.mFloats),
mRecurReadOnly(r.mRecurReadOnly),
@@ -67,25 +70,25 @@ Recurrence::Recurrence(const Recurrence &r, Incidence *parent)
mFeb29YearlyType(r.mFeb29YearlyType),
mCompatVersion(r.mCompatVersion),
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);
}
rMonthDays.setAutoDelete( true );
rMonthPositions.setAutoDelete( true );
@@ -121,52 +124,52 @@ bool Recurrence::operator==( const Recurrence& r2 ) const
switch ( recurs )
{
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:
case rHourly:
case rDaily:
@@ -354,13 +357,13 @@ QDateTime Recurrence::endDateTime() const
{
case rMinutely:
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;
case rMonthlyPos:
case rMonthlyDay:
@@ -503,23 +506,23 @@ QString Recurrence::endDateStr(bool shortfmt) const
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;
}
void Recurrence::setMinutely(int _rFreq, int _rDuration)
{
@@ -756,13 +759,13 @@ void Recurrence::setYearlyByDate(Feb29Type type, int _rFreq, const QDate &_rEndD
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 )
{
if (mRecurReadOnly || recurs != rYearlyMonth) // invalid day/month number
@@ -1044,19 +1047,19 @@ bool Recurrence::recursMonthly(const QDate &qd) const
// The date is in a month which recurs
if (qd >= dStart
&& ((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
}
}
@@ -1098,13 +1101,13 @@ bool Recurrence::recursYearlyByMonth(const QDate &qd) const
if (qd >= dStart
&& ((rDuration > 0 && qd <= endDate()) ||
(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;
}
}
}
}
@@ -1124,18 +1127,18 @@ bool Recurrence::recursYearlyByPos(const QDate &qd) const
// The date is in a year which recurs
if (qd >= dStart
&& ((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;
}
}
}
}
@@ -1154,13 +1157,13 @@ bool Recurrence::recursYearlyByDay(const QDate &qd) const
if (qd >= dStart
&& ((rDuration > 0 && qd <= endDate()) ||
(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;
}
}
}
return false;
@@ -1546,13 +1549,13 @@ 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:
break;
}
@@ -1790,30 +1793,30 @@ struct Recurrence::MonthlyData {
const Recurrence *recurrence;
int year; // current year
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;
recurDays[1] = &days29;
recurDays[2] = &days30;
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);
return days;
}
@@ -1841,14 +1844,14 @@ 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) {
if (*it >= data.day) {
++countGone;
@@ -1907,14 +1910,14 @@ int Recurrence::monthlyCalcToDate(const QDate &enddate, MonthlyData &data) const
int countGone = 0;
int countMax = (rDuration > 0) ? rDuration + mRecurExDatesCount : INT_MAX;
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) {
if (*it >= data.day) {
if (data.yearMonth() == endYearMonth && *it > endDay)
@@ -1966,14 +1969,14 @@ int Recurrence::monthlyCalcNextAfter(QDate &enddate, MonthlyData &data) const
{
uint countTogo = (rDuration > 0) ? rDuration + mRecurExDatesCount : UINT_MAX;
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) {
if (*it >= data.day) {
++countGone;
@@ -2049,23 +2052,23 @@ struct Recurrence::YearlyMonthData {
int year; // current year
int month; // current month 1..12
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
{
if (rYearNums.isEmpty())
@@ -2085,14 +2088,14 @@ int Recurrence::yearlyMonthCalc(PeriodFunc func, QDate &enddate) const
// Find total count and end date of an annual recurrence by date.
// Reply = total number of occurrences.
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) {
if (*it >= data.month) {
++countGone;
@@ -2196,14 +2199,14 @@ int Recurrence::yearlyMonthCalcToDate(const QDate &enddate, YearlyMonthData &dat
}
else if (--endMonth == 0) {
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) {
if (*it >= data.month) {
if (data.year == endYear && *it > endMonth)
@@ -2267,14 +2270,14 @@ int Recurrence::yearlyMonthCalcNextAfter(QDate &enddate, YearlyMonthData &data)
feb28ok = true;
else if (--endMonth == 0) {
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) {
if (*it >= data.month) {
++countGone;
@@ -2387,21 +2390,21 @@ struct Recurrence::YearlyPosData {
int month; // current month 1..12
int day; // current day of month 1..31
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;
}
int yearMonth() const { return year*12 + month - 1; }
void addMonths(int diff) { month += diff - 1; year += month / 12; month = month % 12 + 1; }
@@ -2425,18 +2428,18 @@ 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) {
data.month = *im.current();
days = data.dayList();
@@ -2463,13 +2466,13 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const
data.year += rFreq;
}
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) {
// Check the last month in the recurrence
for (id = days->begin(); id != days->end(); ++id) {
@@ -2493,13 +2496,13 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const
int wholeYears = (countTogo - 1) / data.count;
data.year += wholeYears * rFreq;
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();
for (id = days->begin(); id != days->end(); ++id) {
++countGone;
@@ -2528,18 +2531,18 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c
int endDay = enddate.day();
if (endDay < data.day && --endMonth == 0) {
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;
// Check what remains of the start month
bool lastMonth = (data.yearMonth() == endYearMonth);
@@ -2573,13 +2576,13 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c
data.year += rFreq;
}
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)
return countGone;
// Check the last month in the recurrence
@@ -2608,13 +2611,13 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c
return countMax;
if (wholeYears % rFreq)
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;
// Check the last month in the recurrence
days = data.dayList();
@@ -2643,20 +2646,20 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons
int endDay = enddate.day();
if (endDay < data.day && --endMonth == 0) {
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;
days = data.dayList();
if (ended >= 0 || data.day > 1) {
@@ -2686,13 +2689,13 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons
data.year += rFreq;
}
} 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;
if (ended >= 0 || data.day > 1) {
// This is the start or end month, so check each day
@@ -2731,13 +2734,13 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons
countTogo -= n;
countGone += n;
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
days = data.dayList();
for (id = days->begin(); id != days->end(); ++id) {
@@ -2805,13 +2808,13 @@ int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const
uint countTogo = rDuration + mRecurExDatesCount;
int countGone = 0;
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) {
data.day = d;
goto ex;
@@ -2843,13 +2846,13 @@ int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const
data.year += wholeYears * rFreq;
countGone += wholeYears * daysPerYear;
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;
}
}
@@ -2866,13 +2869,13 @@ int Recurrence::yearlyDayCalcToDate(const QDate &enddate, YearlyDayData &data) c
int endYear = enddate.year();
int endDay = enddate.dayOfYear();
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;
if (++countGone >= countMax)
return countMax;
@@ -2905,13 +2908,13 @@ int Recurrence::yearlyDayCalcToDate(const QDate &enddate, YearlyDayData &data) c
return countGone; // end year isn't a recurrence year
data.year = endYear;
}
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;
}
}
@@ -2925,13 +2928,13 @@ int Recurrence::yearlyDayCalcNextAfter(QDate &enddate, YearlyDayData &data) cons
int endYear = enddate.year();
int endDay = enddate.dayOfYear();
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) {
data.day = d;
goto ex;
@@ -2974,13 +2977,13 @@ int Recurrence::yearlyDayCalcNextAfter(QDate &enddate, YearlyDayData &data) cons
countGone += n;
data.year += recurYears * rFreq;
}
}
// 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;
break;
}
@@ -2992,19 +2995,19 @@ ex:
return countGone;
}
// 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
for (uint i = 1; i <= 7; ++i) {
if (rdays.testBit(i - 1)) {
@@ -3036,13 +3039,13 @@ void Recurrence::getMonthlyPosDays(QValueList<int> &list, int daysInMonth, int s
// Reply = -1 if the number varies from month to month.
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
if (weeknum > 4)
return -1; // days in 5th week are often missing
@@ -3069,18 +3072,18 @@ int Recurrence::countMonthlyPosDays() const
}
return count;
}
// 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)
days |= 1 << (day - 1);
if (day > 28 && day <= 31)
@@ -3103,18 +3106,18 @@ 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
leaplist.append(month);
}
@@ -3184,13 +3187,13 @@ QDate Recurrence::getFirstDateInMonth(const QDate &earliestDate) const
{
int earliestDay = earliestDate.day();
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)
minday = day;
}
@@ -3198,15 +3201,15 @@ QDate Recurrence::getFirstDateInMonth(const QDate &earliestDate) const
return earliestDate.addDays(minday - earliestDay);
break;
}
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;
}
}
@@ -3221,13 +3224,13 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const
{
int latestDay = latestDate.day();
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)
maxday = day;
}
@@ -3235,15 +3238,15 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const
return QDate(latestDate.year(), latestDate.month(), maxday);
break;
}
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;
}
}
@@ -3253,13 +3256,13 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const
/* From the recurrence yearly month list or yearly day list, get the earliest
* month or day in the specified year which is >= the earliestDate.
* 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();
int earliestMonth = earliestDate.month();
int earliestDay = earliestDate.day();
@@ -3289,22 +3292,22 @@ 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;
}
}
@@ -3326,13 +3329,13 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const
/* From the recurrence yearly month list or yearly day list, get the latest
* month or day in the specified year which is <= the latestDate.
* 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();
int latestMonth = latestDate.month();
if (latestDate.day() > day) {
@@ -3361,22 +3364,22 @@ 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
@@ -21,13 +21,15 @@
*/
#ifndef KCAL_RECURRENCE_H
#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;
/**
@@ -245,15 +247,15 @@ class Recurrence
void addMonthlyPos(short _rPos, const QBitArray &_rDays);
/** Adds a position the the recursMonthlyDay list.
* @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.
* @var duration the number of times the event is to occur, or -1 to recur indefinitely.
*/
@@ -276,29 +278,29 @@ class Recurrence
/** Adds a position to the recursYearlyPos recurrence rule, if it is set.
* N.B. addYearlyNum() must also be called to add recurrence months.
* 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; }
/** Returns the default method for handling yearly recurrences of February 29th. */
static Feb29Type setFeb29YearlyTypeDefault() { return mFeb29YearlyDefaultType; }
void addYearlyMonth(short _rPos ); // added LR
/**
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;
struct YearlyMonthData; friend struct YearlyMonthData;
struct YearlyPosData; friend struct YearlyPosData;
@@ -342,15 +344,15 @@ class Recurrence
int yearlyDayCalc(PeriodFunc, QDate &enddate) const;
int yearlyDayCalcEndDate(QDate& enddate, YearlyDayData&) const;
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;
QDate getLastDateInMonth(const QDate& latestDate) const;
QDate getFirstDateInYear(const QDate& earliestDate) const;
@@ -363,19 +365,19 @@ class Recurrence
short recurs; // should be one of the enums.
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
// one of the following must be specified
int rDuration; // num times to recur (inc. first occurrence), -1 = infinite
diff --git a/libkcal/scheduler.cpp b/libkcal/scheduler.cpp
index 253d8b7..234cfcf 100644
--- a/libkcal/scheduler.cpp
+++ b/libkcal/scheduler.cpp
@@ -17,13 +17,15 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#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>
#include "event.h"
@@ -261,14 +263,14 @@ bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status sta
bool ret = false;
Event *ev = mCalendar->event(incidence->uid());
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;
for ( attIn = attendeesIn.first(); attIn; attIn = attendeesIn.next() ) {
for ( attEv = attendeesEv.first(); attEv; attEv = attendeesEv.next() ) {
@@ -339,17 +341,17 @@ bool Scheduler::acceptFreeBusy(IncidenceBase *incidence, Method method)
freebusy->clearAttendees();
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);
return true;
}
diff --git a/libkcal/scheduler.h b/libkcal/scheduler.h
index a9f43b9..357e98e 100644
--- a/libkcal/scheduler.h
+++ b/libkcal/scheduler.h
@@ -20,13 +20,13 @@
#ifndef SCHEDULER_H
#define SCHEDULER_H
// iTIP transactions base class
#include <qstring.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
namespace KCal {
class IncidenceBase;
class Event;
class Calendar;
@@ -92,13 +92,13 @@ class Scheduler {
virtual bool performTransaction(IncidenceBase *incidence,Method method) = 0;
/** Perform iTIP transaction on incidence to specified recipient(s). The
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
iTIP message with the current calendar and specifies the action to be
taken for this incidence.
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index 9b757f7..b8c2aa7 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -19,18 +19,18 @@
Boston, MA 02111-1307, USA.
*/
#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>
#include <kdebug.h>
#include <klocale.h>
@@ -363,17 +363,17 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
system ( command.latin1() );
} else {
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 ...") );
status.raise();
qApp->processEvents();
@@ -385,13 +385,13 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
QString command = "db2file todo -r -c " + codec+ " > " + fileName;
system ( command.latin1() );
} else {
fileName = "/tmp/todo.txt";
}
file.setName( fileName );
- if (!file.open( IO_ReadOnly ) ) {
+ if (!file.open( QIODevice::ReadOnly ) ) {
return false;
}
ts.setDevice( &file );
text = ts.read();
file.close();
@@ -472,13 +472,13 @@ bool SharpFormat::save( Calendar *calendar)
bool debug = DEBUGMODE;
QString codec = "utf8";
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;
QString deleteString = ePrefix;
bool deleteEnt = false;
@@ -500,31 +500,31 @@ bool SharpFormat::save( Calendar *calendar)
deleteEnt = true;
changeEnt = true;
}
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;
command = "(cat /tmp/kopitempin | db2file datebook -w -g -c " + codec+ ") > "+ fileName;
//qDebug("command ++++++++ ");
//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());
getNumFromRecord( answer, ev ) ;
@@ -541,17 +541,17 @@ bool SharpFormat::save( Calendar *calendar)
}
status.setText ( i18n("Changing events ...") );
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;
system ( command.latin1() );
//qDebug("command %s file :\n%s ", command.latin1(), changeString.latin1());
@@ -559,17 +559,17 @@ bool SharpFormat::save( Calendar *calendar)
}
status.setText ( i18n("Deleting events ...") );
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;
system ( command.latin1() );
// qDebug("command %s file :\n%s ", command.latin1(), deleteString.latin1());
@@ -577,13 +577,13 @@ 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;
while ( to ) {
if ( to->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) {
@@ -602,26 +602,26 @@ bool SharpFormat::save( Calendar *calendar)
else if ( to->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 << 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());
getNumFromRecord( answer, to ) ;
@@ -639,17 +639,17 @@ bool SharpFormat::save( Calendar *calendar)
}
status.setText ( i18n("Changing todos ...") );
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;
system ( command.latin1() );
//qDebug("command %s file :\n%s ", command.latin1(), changeString.latin1());
@@ -657,17 +657,17 @@ bool SharpFormat::save( Calendar *calendar)
}
status.setText ( i18n("Deleting todos ...") );
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;
system ( command.latin1() );
// qDebug("command %s file :\n%s ", command.latin1(), deleteString.latin1());
@@ -780,13 +780,13 @@ QString SharpFormat::getEventString( Event* event )
list.append( "2" );
list.append( QString::number( rec->frequency()) );//12
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
count = rmp.first()->rPos - 1;
list.append( QString::number( count ) );
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index cc1c5ae..5a0c32e 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -620,13 +620,13 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_d
int off = 0;
QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
// 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();
enabled = true;
off = alarmStart.secsTo( incidenceStart );
diff --git a/libkcal/todo.h b/libkcal/todo.h
index 2131732..cea976c 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -23,12 +23,14 @@
// Todo component, representing a VTODO object
//
#include "incidence.h"
#include <qtimer.h>
+//Added by qt3to4:
+#include <Q3CString>
namespace KCal {
/**
This class provides a Todo in the sense of RFC2445.
*/
@@ -37,13 +39,13 @@ namespace KCal {
Q_OBJECT
public:
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();
QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const;
diff --git a/libkcal/vcaldrag.cpp b/libkcal/vcaldrag.cpp
index f01f332..324981e 100644
--- a/libkcal/vcaldrag.cpp
+++ b/libkcal/vcaldrag.cpp
@@ -23,13 +23,13 @@
#include "vcalformat.h"
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() );
}
bool VCalDrag::canDecode( QMimeSource *me )
diff --git a/libkcal/vcaldrag.h b/libkcal/vcaldrag.h
index 3048124..68a320d 100644
--- a/libkcal/vcaldrag.h
+++ b/libkcal/vcaldrag.h
@@ -19,21 +19,21 @@
Boston, MA 02111-1307, USA.
*/
#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() {};
/** Return, if drag&drop object can be decode to vCalendar. */
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 2e19740..9cbaf16 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -19,17 +19,19 @@
Boston, MA 02111-1307, USA.
*/
#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>
#include <kiconloader.h>
#include <klocale.h>
@@ -105,21 +107,21 @@ bool VCalFormat::save(Calendar *calendar, const QString &fileName)
tmpStr = mCalendar->getTimeZoneStr();
//qDebug("mCalendar->getTimeZoneStr() %s",tmpStr.latin1() );
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);
}
@@ -135,13 +137,13 @@ 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());
if ( !vcal ) return false;
@@ -207,13 +209,13 @@ QString VCalFormat::toString( Calendar *calendar )
addPropValue( vcal, VCProdIdProp, CalFormat::productId() );
QString tmpStr = mCalendar->getTimeZoneStr();
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 );
addVObjectProp( vcal, vevent );
@@ -268,14 +270,14 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
// organizer stuff
tmpStr = "MAILTO:" + anEvent->organizer();
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();
if (!curAttendee->email().isEmpty() &&
!curAttendee->name().isEmpty())
@@ -323,13 +325,13 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
// priority
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());
}
// categories
QStringList tmpStrList = anEvent->categories();
@@ -352,13 +354,13 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
tmpStr.truncate(tmpStr.length()-1);
addPropValue(vtodo, VCCategoriesProp, tmpStr.local8Bit());
}
// 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;
tmpStr = qDateTimeToISO(alarm->time());
if (alarm->type() == Alarm::Audio) {
@@ -430,14 +432,14 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
// attendee and organizer stuff
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) {
curAttendee = ai.current();
if (!curAttendee->email().isEmpty() &&
@@ -458,14 +460,14 @@ 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;
switch(anEvent->recurrence()->doesRecur()) {
@@ -542,13 +544,13 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
if (anEvent->recurrence()->duration() > 0) {
tmpStr2.sprintf("#%i",anEvent->recurrence()->duration());
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
// exceptions to recurrence
@@ -622,24 +624,24 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
tmpStr.truncate(tmpStr.length()-1);
addPropValue(vevent, VCCategoriesProp, tmpStr.local8Bit());
}
// 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
tmpStrList = anEvent->resources();
tmpStr = tmpStrList.join(";");
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 ;
tmpStr = qDateTimeToISO(alarm->time());
if (alarm->type() == Alarm::Audio) {
@@ -669,13 +671,13 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
// transparency
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());
}
if (anEvent->pilotId()) {
// pilot sync stuff
@@ -1405,26 +1407,26 @@ 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;
}
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(),
tmpDT.date().day(), tmpDT.time().hour(),
tmpDT.time().minute(), tmpDT.time().second());
@@ -1451,14 +1453,14 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr)
hour = tmpStr.mid(9,2).toInt();
minute = tmpStr.mid(11,2).toInt();
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);
return tmpDT;
}
@@ -1645,13 +1647,13 @@ Attendee::Role VCalFormat::readRole(const char *s) const
role = Attendee::Chair;
// enum Role { ReqParticipant, OptParticipant, NonParticipant, Chair };
return role;
}
-QCString VCalFormat::writeRole(Attendee::Role role) const
+Q3CString VCalFormat::writeRole(Attendee::Role role) const
{
if ( role == Attendee::Chair )
return "OWNER";
return "ATTENDEE";
}
Attendee::PartStat VCalFormat::readStatus(const char *s) const
@@ -1683,13 +1685,13 @@ Attendee::PartStat VCalFormat::readStatus(const char *s) const
status = Attendee::NeedsAction;
}
return status;
}
-QCString VCalFormat::writeStatus(Attendee::PartStat status) const
+Q3CString VCalFormat::writeStatus(Attendee::PartStat status) const
{
switch(status) {
default:
case Attendee::NeedsAction:
return "NEEDS ACTION";
break;
diff --git a/libkcal/vcalformat.h b/libkcal/vcalformat.h
index 6dae3d2..cac9634 100644
--- a/libkcal/vcalformat.h
+++ b/libkcal/vcalformat.h
@@ -20,12 +20,15 @@
*/
#ifndef _VCALFORMAT_H
#define _VCALFORMAT_H
#include "calformat.h"
+//Added by qt3to4:
+#include <Q3CString>
+#include <Q3PtrList>
#define _VCAL_VERSION "1.0"
class VObject;
namespace KCal {
@@ -92,22 +95,22 @@ class VCalFormat : public CalFormat {
/** takes a number 0 - 6 and returns the two letter string of that day,
* 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
};
}
#endif