From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkcal/alarm.cpp | 92 ++++---- libkcal/alarm.h | 86 +++---- libkcal/attachment.cpp | 26 +-- libkcal/attachment.h | 24 +- libkcal/attendee.cpp | 26 +-- libkcal/attendee.h | 38 +-- libkcal/calendar.cpp | 54 ++--- libkcal/calendar.h | 104 ++++----- libkcal/calendarlocal.cpp | 80 +++---- libkcal/calendarlocal.h | 42 ++-- libkcal/calendarnull.cpp | 4 +- libkcal/calendarnull.h | 28 +-- libkcal/calendarresources.cpp | 74 +++--- libkcal/calendarresources.h | 76 +++--- libkcal/calfilter.cpp | 26 +-- libkcal/calfilter.h | 24 +- libkcal/calformat.cpp | 16 +- libkcal/calformat.h | 30 +-- libkcal/compat.cpp | 32 +-- libkcal/compat.h | 10 +- libkcal/confirmsavedialog.cpp | 18 +- libkcal/confirmsavedialog.h | 4 +- libkcal/convertqtopia.cpp | 6 +- libkcal/customproperties.cpp | 40 ++-- libkcal/customproperties.h | 34 +-- libkcal/dndfactory.cpp | 30 +-- libkcal/dndfactory.h | 8 +- libkcal/dummyscheduler.cpp | 38 +-- libkcal/dummyscheduler.h | 10 +- libkcal/duration.cpp | 4 +- libkcal/duration.h | 6 +- libkcal/event.cpp | 16 +- libkcal/event.h | 18 +- libkcal/exceptions.cpp | 10 +- libkcal/exceptions.h | 12 +- libkcal/filestorage.cpp | 12 +- libkcal/filestorage.h | 8 +- libkcal/freebusy.cpp | 32 +-- libkcal/freebusy.h | 28 +-- libkcal/freebusycache.h | 6 +- libkcal/freebusyurlstore.cpp | 6 +- libkcal/freebusyurlstore.h | 6 +- libkcal/htmlexport.cpp | 124 +++++----- libkcal/htmlexport.h | 50 ++-- libkcal/icaldrag.cpp | 14 +- libkcal/icaldrag.h | 8 +- libkcal/icalformat.cpp | 76 +++--- libkcal/icalformat.h | 34 +-- libkcal/icalformatimpl.cpp | 220 +++++++++--------- libkcal/icalformatimpl.h | 22 +- libkcal/imipscheduler.cpp | 6 +- libkcal/imipscheduler.h | 6 +- libkcal/incidence.cpp | 134 +++++------ libkcal/incidence.h | 94 ++++---- libkcal/incidencebase.cpp | 50 ++-- libkcal/incidencebase.h | 62 ++--- libkcal/incidenceformatter.cpp | 436 +++++++++++++++++------------------ libkcal/incidenceformatter.h | 20 +- libkcal/journal.h | 2 +- libkcal/listbase.h | 26 +-- libkcal/period.cpp | 16 +- libkcal/period.h | 26 +-- libkcal/person.cpp | 18 +- libkcal/person.h | 20 +- libkcal/qtopiaformat.cpp | 118 +++++----- libkcal/qtopiaformat.h | 10 +- libkcal/recurrence.cpp | 136 +++++------ libkcal/recurrence.h | 82 +++---- libkcal/recurrencerule.cpp | 228 +++++++++--------- libkcal/recurrencerule.h | 118 +++++----- libkcal/resourcecached.cpp | 80 +++---- libkcal/resourcecached.h | 62 ++--- libkcal/resourcecachedconfig.cpp | 68 +++--- libkcal/resourcecachedconfig.h | 14 +- libkcal/resourcecalendar.cpp | 28 +-- libkcal/resourcecalendar.h | 76 +++--- libkcal/resourcelocal.cpp | 38 +-- libkcal/resourcelocal.h | 14 +- libkcal/resourcelocalconfig.cpp | 24 +- libkcal/resourcelocalconfig.h | 12 +- libkcal/resourcelocaldir.cpp | 46 ++-- libkcal/resourcelocaldir.h | 6 +- libkcal/resourcelocaldirconfig.cpp | 10 +- libkcal/resourcelocaldirconfig.h | 12 +- libkcal/scheduler.cpp | 28 +-- libkcal/scheduler.h | 22 +- libkcal/tests/fbrecurring.cpp | 20 +- libkcal/tests/readandwrite.cpp | 14 +- libkcal/tests/testcalendar.cpp | 2 +- libkcal/tests/testfb.cpp | 4 +- libkcal/tests/testfields.cpp | 20 +- libkcal/tests/testincidence.cpp | 8 +- libkcal/tests/testrecurprevious.cpp | 22 +- libkcal/tests/testrecurrence.cpp | 18 +- libkcal/tests/testrecurrencetype.cpp | 18 +- libkcal/tests/testrecurson.cpp | 20 +- libkcal/tests/testresource.cpp | 36 +-- libkcal/tests/testresource.h | 8 +- libkcal/tests/testtostring.cpp | 2 +- libkcal/tests/testvcalexport.cpp | 14 +- libkcal/todo.cpp | 50 ++-- libkcal/todo.h | 42 ++-- libkcal/vcaldrag.cpp | 12 +- libkcal/vcaldrag.h | 8 +- libkcal/vcalformat.cpp | 188 +++++++-------- libkcal/vcalformat.h | 28 +-- 106 files changed, 2237 insertions(+), 2237 deletions(-) (limited to 'libkcal') diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index c4416fb7e..b5b9b515a 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp @@ -122,14 +122,14 @@ Alarm::Type Alarm::type() const return mType; } -void Alarm::setAudioAlarm(const QString &audioFile) +void Alarm::setAudioAlarm(const TQString &audioFile) { mType = Audio; mFile = audioFile; if ( mParent ) mParent->updated(); } -void Alarm::setAudioFile(const QString &audioFile) +void Alarm::setAudioFile(const TQString &audioFile) { if (mType == Audio) { mFile = audioFile; @@ -137,12 +137,12 @@ void Alarm::setAudioFile(const QString &audioFile) } } -QString Alarm::audioFile() const +TQString Alarm::audioFile() const { - return (mType == Audio) ? mFile : QString::null; + return (mType == Audio) ? mFile : TQString::null; } -void Alarm::setProcedureAlarm(const QString &programFile, const QString &arguments) +void Alarm::setProcedureAlarm(const TQString &programFile, const TQString &arguments) { mType = Procedure; mFile = programFile; @@ -150,7 +150,7 @@ void Alarm::setProcedureAlarm(const QString &programFile, const QString &argumen if ( mParent ) mParent->updated(); } -void Alarm::setProgramFile(const QString &programFile) +void Alarm::setProgramFile(const TQString &programFile) { if (mType == Procedure) { mFile = programFile; @@ -158,12 +158,12 @@ void Alarm::setProgramFile(const QString &programFile) } } -QString Alarm::programFile() const +TQString Alarm::programFile() const { - return (mType == Procedure) ? mFile : QString::null; + return (mType == Procedure) ? mFile : TQString::null; } -void Alarm::setProgramArguments(const QString &arguments) +void Alarm::setProgramArguments(const TQString &arguments) { if (mType == Procedure) { mDescription = arguments; @@ -171,13 +171,13 @@ void Alarm::setProgramArguments(const QString &arguments) } } -QString Alarm::programArguments() const +TQString Alarm::programArguments() const { - return (mType == Procedure) ? mDescription : QString::null; + return (mType == Procedure) ? mDescription : TQString::null; } -void Alarm::setEmailAlarm(const QString &subject, const QString &text, - const QValueList &addressees, const QStringList &attachments) +void Alarm::setEmailAlarm(const TQString &subject, const TQString &text, + const TQValueList &addressees, const TQStringList &attachments) { mType = Email; mMailSubject = subject; @@ -196,7 +196,7 @@ void Alarm::setMailAddress(const Person &mailAddress) } } -void Alarm::setMailAddresses(const QValueList &mailAddresses) +void Alarm::setMailAddresses(const TQValueList &mailAddresses) { if (mType == Email) { mMailAddresses = mailAddresses; @@ -212,12 +212,12 @@ void Alarm::addMailAddress(const Person &mailAddress) } } -QValueList Alarm::mailAddresses() const +TQValueList Alarm::mailAddresses() const { - return (mType == Email) ? mMailAddresses : QValueList(); + return (mType == Email) ? mMailAddresses : TQValueList(); } -void Alarm::setMailSubject(const QString &mailAlarmSubject) +void Alarm::setMailSubject(const TQString &mailAlarmSubject) { if (mType == Email) { mMailSubject = mailAlarmSubject; @@ -225,12 +225,12 @@ void Alarm::setMailSubject(const QString &mailAlarmSubject) } } -QString Alarm::mailSubject() const +TQString Alarm::mailSubject() const { - return (mType == Email) ? mMailSubject : QString::null; + return (mType == Email) ? mMailSubject : TQString::null; } -void Alarm::setMailAttachment(const QString &mailAttachFile) +void Alarm::setMailAttachment(const TQString &mailAttachFile) { if (mType == Email) { mMailAttachFiles.clear(); @@ -239,7 +239,7 @@ void Alarm::setMailAttachment(const QString &mailAttachFile) } } -void Alarm::setMailAttachments(const QStringList &mailAttachFiles) +void Alarm::setMailAttachments(const TQStringList &mailAttachFiles) { if (mType == Email) { mMailAttachFiles = mailAttachFiles; @@ -247,7 +247,7 @@ void Alarm::setMailAttachments(const QStringList &mailAttachFiles) } } -void Alarm::addMailAttachment(const QString &mailAttachFile) +void Alarm::addMailAttachment(const TQString &mailAttachFile) { if (mType == Email) { mMailAttachFiles += mailAttachFile; @@ -255,12 +255,12 @@ void Alarm::addMailAttachment(const QString &mailAttachFile) } } -QStringList Alarm::mailAttachments() const +TQStringList Alarm::mailAttachments() const { - return (mType == Email) ? mMailAttachFiles : QStringList(); + return (mType == Email) ? mMailAttachFiles : TQStringList(); } -void Alarm::setMailText(const QString &text) +void Alarm::setMailText(const TQString &text) { if (mType == Email) { mDescription = text; @@ -268,12 +268,12 @@ void Alarm::setMailText(const QString &text) } } -QString Alarm::mailText() const +TQString Alarm::mailText() const { - return (mType == Email) ? mDescription : QString::null; + return (mType == Email) ? mDescription : TQString::null; } -void Alarm::setDisplayAlarm(const QString &text) +void Alarm::setDisplayAlarm(const TQString &text) { mType = Display; if ( !text.isNull() ) @@ -281,7 +281,7 @@ void Alarm::setDisplayAlarm(const QString &text) if ( mParent ) mParent->updated(); } -void Alarm::setText(const QString &text) +void Alarm::setText(const TQString &text) { if (mType == Display) { mDescription = text; @@ -289,12 +289,12 @@ void Alarm::setText(const QString &text) } } -QString Alarm::text() const +TQString Alarm::text() const { - return (mType == Display) ? mDescription : QString::null; + return (mType == Display) ? mDescription : TQString::null; } -void Alarm::setTime(const QDateTime &alarmTime) +void Alarm::setTime(const TQDateTime &alarmTime) { mAlarmTime = alarmTime; mHasTime = true; @@ -302,7 +302,7 @@ void Alarm::setTime(const QDateTime &alarmTime) if ( mParent ) mParent->updated(); } -QDateTime Alarm::time() const +TQDateTime Alarm::time() const { if ( hasTime() ) return mAlarmTime; @@ -316,7 +316,7 @@ QDateTime Alarm::time() const } else { return mOffset.end( mParent->dtStart() ); } - } else return QDateTime(); + } else return TQDateTime(); } bool Alarm::hasTime() const @@ -353,41 +353,41 @@ int Alarm::duration() const return mAlarmRepeatCount * mAlarmSnoozeTime * 60; } -QDateTime Alarm::nextRepetition(const QDateTime& preTime) const +TQDateTime Alarm::nextRepetition(const TQDateTime& preTime) const { // This method is coded to avoid 32-bit integer overflow using - // QDateTime::secsTo(), which occurs with time spans > 68 years. - QDateTime at = time(); + // TQDateTime::secsTo(), which occurs with time spans > 68 years. + TQDateTime at = time(); if (at > preTime) return at; if (!mAlarmRepeatCount) - return QDateTime(); // there isn't an occurrence after the specified time + return TQDateTime(); // there isn't an occurrence after the specified time int snoozeSecs = mAlarmSnoozeTime * 60; - QDateTime lastRepetition = at.addSecs(mAlarmRepeatCount * snoozeSecs); + TQDateTime lastRepetition = at.addSecs(mAlarmRepeatCount * snoozeSecs); if (lastRepetition <= preTime) - return QDateTime(); // all repetitions have finished before the specified time + return TQDateTime(); // all repetitions have finished before the specified time int repetition = (at.secsTo(preTime) + snoozeSecs) / snoozeSecs; return at.addSecs(repetition * snoozeSecs); } -QDateTime Alarm::previousRepetition(const QDateTime& afterTime) const +TQDateTime Alarm::previousRepetition(const TQDateTime& afterTime) const { // This method is coded to avoid 32-bit integer overflow using - // QDateTime::secsTo(), which occurs with time spans > 68 years. - QDateTime at = time(); + // TQDateTime::secsTo(), which occurs with time spans > 68 years. + TQDateTime at = time(); if (at >= afterTime) - return QDateTime(); // alarm's first/only time is at/after the specified time + return TQDateTime(); // alarm's first/only time is at/after the specified time if (!mAlarmRepeatCount) return at; int snoozeSecs = mAlarmSnoozeTime * 60; - QDateTime lastRepetition = at.addSecs(mAlarmRepeatCount * snoozeSecs); + TQDateTime lastRepetition = at.addSecs(mAlarmRepeatCount * snoozeSecs); if (lastRepetition < afterTime) return lastRepetition; // all repetitions have finished before the specified time int repetition = (at.secsTo(afterTime) - 1) / snoozeSecs; return at.addSecs(repetition * snoozeSecs); } -QDateTime Alarm::endTime() const +TQDateTime Alarm::endTime() const { if (mAlarmRepeatCount) return time().addSecs(mAlarmRepeatCount * mAlarmSnoozeTime * 60); diff --git a/libkcal/alarm.h b/libkcal/alarm.h index 64970e639..7d82cf65d 100644 --- a/libkcal/alarm.h +++ b/libkcal/alarm.h @@ -22,9 +22,9 @@ #ifndef KCAL_ALARM_H #define KCAL_ALARM_H -#include -#include -#include +#include +#include +#include #include "customproperties.h" #include "duration.h" @@ -81,34 +81,34 @@ class LIBKCAL_EXPORT Alarm : public CustomProperties @param text text to display when the alarm is triggered. */ - void setDisplayAlarm( const QString &text = QString::null ); + void setDisplayAlarm( const TQString &text = TQString::null ); /** Set the text to be displayed when the alarm is triggered. Ignored if the alarm is not a display alarm. */ - void setText( const QString &text ); + void setText( const TQString &text ); /** Return the text string that displays when the alarm is triggered. */ - QString text() const; + TQString text() const; /** Set the alarm to be an audio alarm. @param audioFile optional file to play when the alarm is triggered. */ - void setAudioAlarm( const QString &audioFile = QString::null ); + void setAudioAlarm( const TQString &audioFile = TQString::null ); /** Set the file to play when the audio alarm is triggered. Ignored if the alarm is not an audio alarm. */ - void setAudioFile( const QString &audioFile ); + void setAudioFile( const TQString &audioFile ); /** Return the name of the audio file for the alarm. - @return The audio file for the alarm, or QString::null if not an audio alarm. + @return The audio file for the alarm, or TQString::null if not an audio alarm. */ - QString audioFile() const; + TQString audioFile() const; /** Set the alarm to be a procedure alarm. @@ -116,30 +116,30 @@ class LIBKCAL_EXPORT Alarm : public CustomProperties @param programFile program to execute when the alarm is triggered. @param arguments arguments to supply to programFile. */ - void setProcedureAlarm( const QString &programFile, - const QString &arguments = QString::null ); + void setProcedureAlarm( const TQString &programFile, + const TQString &arguments = TQString::null ); /** Set the program file to execute when the alarm is triggered. Ignored if the alarm is not a procedure alarm. */ - void setProgramFile( const QString &programFile ); + void setProgramFile( const TQString &programFile ); /** Return the name of the program file to execute when the alarm is triggered. - @return the program file name, or QString::null if not a procedure alarm. + @return the program file name, or TQString::null if not a procedure alarm. */ - QString programFile() const; + TQString programFile() const; /** Set the arguments to the program to execute when the alarm is triggered. Ignored if the alarm is not a procedure alarm. */ - void setProgramArguments( const QString &arguments ); + void setProgramArguments( const TQString &arguments ); /** Return the arguments to the program to run when the alarm is triggered. - @return the program arguments, or QString::null if not a procedure alarm. + @return the program arguments, or TQString::null if not a procedure alarm. */ - QString programArguments() const; + TQString programArguments() const; /** Set the alarm to be an email alarm. @@ -149,9 +149,9 @@ class LIBKCAL_EXPORT Alarm : public CustomProperties @param addressees email addresses of recipient(s). @param attachments optional names of files to attach to the email. */ - void setEmailAlarm( const QString &subject, const QString &text, - const QValueList &addressees, - const QStringList &attachments = QStringList() ); + void setEmailAlarm( const TQString &subject, const TQString &text, + const TQValueList &addressees, + const TQStringList &attachments = TQStringList() ); /** Send mail to this address when the alarm is triggered. @@ -162,7 +162,7 @@ class LIBKCAL_EXPORT Alarm : public CustomProperties Send mail to these addresses when the alarm is triggered. Ignored if the alarm is not an email alarm. */ - void setMailAddresses( const QValueList &mailAlarmAddresses ); + void setMailAddresses( const TQValueList &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. @@ -171,63 +171,63 @@ class LIBKCAL_EXPORT Alarm : public CustomProperties /** Return the addresses to send mail to when an alarm goes off. */ - QValueList mailAddresses() const; + TQValueList mailAddresses() const; /** Set the subject line of the mail. Ignored if the alarm is not an email alarm. */ - void setMailSubject( const QString &mailAlarmSubject ); + void setMailSubject( const TQString &mailAlarmSubject ); /** Return the subject line of the mail. */ - QString mailSubject() const; + TQString mailSubject() const; /** Attach this filename to the email. Ignored if the alarm is not an email alarm. */ - void setMailAttachment( const QString &mailAttachFile ); + void setMailAttachment( const TQString &mailAttachFile ); /** Attach these filenames to the email. Ignored if the alarm is not an email alarm. */ - void setMailAttachments( const QStringList &mailAttachFiles ); + void setMailAttachments( const TQStringList &mailAttachFiles ); /** Add this filename to the list of files to attach to the email. Ignored if the alarm is not an email alarm. */ - void addMailAttachment( const QString &mailAttachFile ); + void addMailAttachment( const TQString &mailAttachFile ); /** Return the filenames to attach to the email. */ - QStringList mailAttachments() const; + TQStringList mailAttachments() const; /** Set the email body text. Ignored if the alarm is not an email alarm. */ - void setMailText( const QString &text ); + void setMailText( const TQString &text ); /** Return the email body text. - @return the body text, or QString::null if not an email alarm. + @return the body text, or TQString::null if not an email alarm. */ - QString mailText() const; + TQString mailText() const; /** Set the time to trigger an alarm. */ - void setTime( const QDateTime &alarmTime ); + void setTime( const TQDateTime &alarmTime ); /** Return the date/time when an alarm goes off. */ - QDateTime time() const; + TQDateTime time() const; /** Return the date/time when the last repetition of the alarm goes off. If the alarm does not repeat, this is equivalent to calling time(). */ - QDateTime endTime() const; + TQDateTime endTime() const; /** Return true, if the alarm has an explicit date/time. */ @@ -295,7 +295,7 @@ class LIBKCAL_EXPORT Alarm : public CustomProperties @return the date and time of the next repetition, or an invalid date/time if the specified time is at or after the alarm's last repetition. */ - QDateTime nextRepetition(const QDateTime& preTime) const; + TQDateTime nextRepetition(const TQDateTime& preTime) const; /** Get the time of the alarm's latest repetition, or its initial occurrence if none, before a given time. @@ -303,7 +303,7 @@ class LIBKCAL_EXPORT Alarm : public CustomProperties @return the date and time of the latest repetition, or an invalid date/time if the specified time is at or before the alarm's initial occurrence. */ - QDateTime previousRepetition(const QDateTime& afterTime) const; + TQDateTime previousRepetition(const TQDateTime& afterTime) const; /** Get how long between the alarm's initial occurrence and its final repetition. @return the number of seconds between the initial occurrence and final repetition. @@ -344,18 +344,18 @@ class LIBKCAL_EXPORT 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 mMailAddresses; // who to mail for reminder - QString mMailSubject; // subject of email + TQString mDescription; // text to display/email body/procedure arguments + TQString mFile; // procedure program to run/optional audio file to play + TQStringList mMailAttachFiles; // filenames to attach to email + TQValueList mMailAddresses; // who to mail for reminder + TQString 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 - QDateTime mAlarmTime; // time at which to trigger the alarm + TQDateTime mAlarmTime; // time at which to trigger the alarm Duration mOffset; // time relative to incidence DTSTART to trigger the alarm bool mEndOffset; // if true, mOffset relates to DTEND, not DTSTART bool mHasTime; // use mAlarmTime, not mOffset diff --git a/libkcal/attachment.cpp b/libkcal/attachment.cpp index 58a540062..fc319b735 100644 --- a/libkcal/attachment.cpp +++ b/libkcal/attachment.cpp @@ -32,22 +32,22 @@ Attachment::Attachment( const Attachment &attachment) mLabel = attachment.mLabel; } -Attachment::Attachment(const QString& uri, const QString& mime) +Attachment::Attachment(const TQString& uri, const TQString& mime) { mMimeType = mime; mData = uri; mBinary = false; mShowInline = false; - mLabel = QString::null; + mLabel = TQString::null; } -Attachment::Attachment(const char *base64, const QString& mime) +Attachment::Attachment(const char *base64, const TQString& mime) { mMimeType = mime; - mData = QString::fromUtf8(base64); + mData = TQString::fromUtf8(base64); mBinary = true; mShowInline = false; - mLabel = QString::null; + mLabel = TQString::null; } bool Attachment::isUri() const @@ -55,15 +55,15 @@ bool Attachment::isUri() const return !mBinary; } -QString Attachment::uri() const +TQString Attachment::uri() const { if (!mBinary) return mData; else - return QString::null; + return TQString::null; } -void Attachment::setUri(const QString& uri) +void Attachment::setUri(const TQString& uri) { mData = uri; mBinary = false; @@ -85,16 +85,16 @@ char *Attachment::data() const void Attachment::setData(const char *base64) { - mData = QString::fromUtf8(base64); + mData = TQString::fromUtf8(base64); mBinary = true; } -QString Attachment::mimeType() const +TQString Attachment::mimeType() const { return mMimeType; } -void Attachment::setMimeType(const QString& mime) +void Attachment::setMimeType(const TQString& mime) { mMimeType = mime; } @@ -109,12 +109,12 @@ void Attachment::setShowInline( bool showinline ) mShowInline = showinline; } -QString Attachment::label() const +TQString Attachment::label() const { return mLabel; } -void Attachment::setLabel( const QString& label ) +void Attachment::setLabel( const TQString& label ) { mLabel = label; } diff --git a/libkcal/attachment.h b/libkcal/attachment.h index 6e3907099..416701850 100644 --- a/libkcal/attachment.h +++ b/libkcal/attachment.h @@ -24,7 +24,7 @@ #include "listbase.h" #include "libkcal_export.h" -#include +#include namespace KCal { @@ -49,7 +49,7 @@ class KDE_EXPORT Attachment @param uri the uri this attachment refers to @param mime the mime type of the resource being linked to */ - Attachment( const QString &uri, const QString &mime = QString::null ); + Attachment( const TQString &uri, const TQString &mime = TQString::null ); /** Create a binary attachment. @@ -57,35 +57,35 @@ class KDE_EXPORT Attachment @param base64 the attachment in base64 format @param mime the mime type of the attachment */ - Attachment( const char *base64, const QString &mime = QString::null ); + Attachment( const char *base64, const TQString &mime = TQString::null ); /* The VALUE parameter in iCal */ bool isUri() const; - QString uri() const; - void setUri( const QString &uri ); + TQString uri() const; + void setUri( const TQString &uri ); bool isBinary() const; char *data() const; void setData( const char *base64 ); /* The optional FMTTYPE parameter in iCal */ - QString mimeType() const; - void setMimeType( const QString &mime ); + TQString mimeType() const; + void setMimeType( const TQString &mime ); /* The custom X-CONTENT-DISPOSITION parameter, used by OGo etc. */ bool showInline() const; void setShowInline( bool showinline ); /* The custom X-LABEL parameter to show a human-readable title */ - QString label() const; - void setLabel( const QString &label ); + TQString label() const; + void setLabel( const TQString &label ); private: - QString mMimeType; - QString mData; + TQString mMimeType; + TQString mData; bool mBinary; bool mShowInline; - QString mLabel; + TQString mLabel; class Private; Private *d; diff --git a/libkcal/attendee.cpp b/libkcal/attendee.cpp index 7594c8eb3..3cb2afedf 100644 --- a/libkcal/attendee.cpp +++ b/libkcal/attendee.cpp @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -28,8 +28,8 @@ using namespace KCal; -Attendee::Attendee( const QString &name, const QString &email, bool _rsvp, - Attendee::PartStat s, Attendee::Role r, const QString &u) +Attendee::Attendee( const TQString &name, const TQString &email, bool _rsvp, + Attendee::PartStat s, Attendee::Role r, const TQString &u) : Person( name, email ) { mRSVP = _rsvp; @@ -63,12 +63,12 @@ Attendee::PartStat Attendee::status() const return mStatus; } -QString Attendee::statusStr() const +TQString Attendee::statusStr() const { return statusName( mStatus ); } -QString Attendee::statusName( Attendee::PartStat s ) +TQString Attendee::statusName( Attendee::PartStat s ) { switch ( s ) { default: @@ -96,9 +96,9 @@ QString Attendee::statusName( Attendee::PartStat s ) } } -QStringList Attendee::statusList() +TQStringList Attendee::statusList() { - QStringList list; + TQStringList list; list << statusName( NeedsAction ); list << statusName( Accepted ); list << statusName( Declined ); @@ -121,22 +121,22 @@ Attendee::Role Attendee::role() const return mRole; } -QString Attendee::roleStr() const +TQString Attendee::roleStr() const { return roleName( mRole ); } -void Attendee::setUid( const QString &uid ) +void Attendee::setUid( const TQString &uid ) { mUid = uid; } -QString Attendee::uid() const +TQString Attendee::uid() const { return mUid; } -QString Attendee::roleName( Attendee::Role r ) +TQString Attendee::roleName( Attendee::Role r ) { switch ( r ) { case Chair: @@ -155,9 +155,9 @@ QString Attendee::roleName( Attendee::Role r ) } } -QStringList Attendee::roleList() +TQStringList Attendee::roleList() { - QStringList list; + TQStringList list; list << roleName( ReqParticipant ); list << roleName( OptParticipant ); list << roleName( NonParticipant ); diff --git a/libkcal/attendee.h b/libkcal/attendee.h index 1cdc7b546..f460665b6 100644 --- a/libkcal/attendee.h +++ b/libkcal/attendee.h @@ -22,8 +22,8 @@ #ifndef KCAL_ATTENDEE_H #define KCAL_ATTENDEE_H -#include -#include +#include +#include #include "listbase.h" #include "person.h" @@ -52,9 +52,9 @@ class LIBKCAL_EXPORT Attendee : public Person @param role Role @param u the uid for the attendee */ - Attendee( const QString &name, const QString &email, + Attendee( const TQString &name, const TQString &email, bool rsvp = false, PartStat status = NeedsAction, - Role role = ReqParticipant, const QString &u = QString::null ); + Role role = ReqParticipant, const TQString &u = TQString::null ); /** Destruct Attendee. */ @@ -74,24 +74,24 @@ class LIBKCAL_EXPORT Attendee : public Person /** Return role as clear text string. */ - QString roleStr() const; + TQString roleStr() const; /** Return string represenation of role. */ - static QString roleName( Role ); + static TQString roleName( Role ); /** Return string representations of all available roles. */ - static QStringList roleList(); + static TQStringList roleList(); /** Return unique id of the attendee. */ - QString uid() const; + TQString uid() const; /** Set unique id of attendee. */ - void setUid ( const QString & ); + void setUid ( const TQString & ); /** Set status. See enum for definitions of possible values. @@ -106,15 +106,15 @@ class LIBKCAL_EXPORT Attendee : public Person /** Return status as human-readable string. */ - QString statusStr() const; + TQString statusStr() const; /** Return string representation of attendee status. */ - static QString statusName( PartStat ); + static TQString statusName( PartStat ); /** Return string representations of all available attendee status values. */ - static QStringList statusList(); + static TQStringList statusList(); /** Set if Attendee is asked to reply. @@ -128,28 +128,28 @@ class LIBKCAL_EXPORT Attendee : public Person /** Sets the delegate. */ - void setDelegate( const QString &delegate ) { mDelegate = delegate; } + void setDelegate( const TQString &delegate ) { mDelegate = delegate; } /** Returns the delegate. */ - QString delegate() const { return mDelegate; } + TQString delegate() const { return mDelegate; } /** Sets the delegator. */ - void setDelegator( const QString &delegator ) { mDelegator = delegator; } + void setDelegator( const TQString &delegator ) { mDelegator = delegator; } /** Returns the delegator. */ - QString delegator() const { return mDelegator; } + TQString delegator() const { return mDelegator; } private: bool mRSVP; Role mRole; PartStat mStatus; - QString mUid; - QString mDelegate; - QString mDelegator; + TQString mUid; + TQString mDelegate; + TQString mDelegator; class Private; Private *d; diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 4c9e568a3..3d57e7546 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -40,7 +40,7 @@ using namespace KCal; -Calendar::Calendar( const QString &timeZoneId ) +Calendar::Calendar( const TQString &timeZoneId ) { mTimeZoneId = timeZoneId; mLocalTime = false; @@ -81,7 +81,7 @@ void Calendar::setOwner( const Person &owner ) setModified( true ); } -void Calendar::setTimeZoneId( const QString &timeZoneId ) +void Calendar::setTimeZoneId( const TQString &timeZoneId ) { mTimeZoneId = timeZoneId; mLocalTime = false; @@ -90,7 +90,7 @@ void Calendar::setTimeZoneId( const QString &timeZoneId ) doSetTimeZoneId( timeZoneId ); } -QString Calendar::timeZoneId() const +TQString Calendar::timeZoneId() const { return mTimeZoneId; } @@ -122,16 +122,16 @@ CalFilter *Calendar::filter() return mFilter; } -QStringList Calendar::categories() +TQStringList Calendar::categories() { Incidence::List rawInc( rawIncidences() ); - QStringList cats, thisCats; + TQStringList cats, thisCats; // @TODO: For now just iterate over all incidences. In the future, // the list of categories should be built when reading the file. for ( Incidence::List::ConstIterator i = rawInc.constBegin(); i != rawInc.constEnd(); ++i ) { thisCats = (*i)->categories(); - for ( QStringList::ConstIterator si = thisCats.constBegin(); + for ( TQStringList::ConstIterator si = thisCats.constBegin(); si != thisCats.constEnd(); ++si ) { if ( cats.find( *si ) == cats.end() ) { cats.append( *si ); @@ -141,7 +141,7 @@ QStringList Calendar::categories() return cats; } -Incidence::List Calendar::incidences( const QDate &date ) +Incidence::List Calendar::incidences( const TQDate &date ) { return mergeIncidenceList( events( date ), todos( date ), journals( date ) ); } @@ -248,7 +248,7 @@ Event::List Calendar::sortEvents( Event::List *eventList, } -Event::List Calendar::events( const QDate &date, +Event::List Calendar::events( const TQDate &date, EventSortField sortField, SortDirection sortDirection ) { @@ -257,14 +257,14 @@ Event::List Calendar::events( const QDate &date, return el; } -Event::List Calendar::events( const QDateTime &qdt ) +Event::List Calendar::events( const TQDateTime &qdt ) { Event::List el = rawEventsForDate( qdt ); mFilter->apply( &el ); return el; } -Event::List Calendar::events( const QDate &start, const QDate &end, +Event::List Calendar::events( const TQDate &start, const TQDate &end, bool inclusive) { Event::List el = rawEvents( start, end, inclusive ); @@ -301,7 +301,7 @@ bool Calendar::deleteIncidence( Incidence *incidence ) /** Dissociate a single occurrence or all future occurrences from a recurring sequence. The new incidence is returned, but not automatically inserted into the calendar, which is left to the calling application */ -Incidence *Calendar::dissociateOccurrence( Incidence *incidence, QDate date, +Incidence *Calendar::dissociateOccurrence( Incidence *incidence, TQDate date, bool single ) { if ( !incidence || !incidence->doesRecur() ) @@ -332,7 +332,7 @@ Incidence *Calendar::dissociateOccurrence( Incidence *incidence, QDate date, // Adjust the date of the incidence if ( incidence->type() == "Event" ) { Event *ev = static_cast( newInc ); - QDateTime start( ev->dtStart() ); + TQDateTime start( ev->dtStart() ); int daysTo = start.date().daysTo( date ); ev->setDtStart( start.addDays( daysTo ) ); ev->setDtEnd( ev->dtEnd().addDays( daysTo ) ); @@ -341,13 +341,13 @@ Incidence *Calendar::dissociateOccurrence( Incidence *incidence, QDate date, bool haveOffset = false; int daysTo = 0; if ( td->hasDueDate() ) { - QDateTime due( td->dtDue() ); + TQDateTime due( td->dtDue() ); daysTo = due.date().daysTo( date ); td->setDtDue( due.addDays( daysTo ), true ); haveOffset = true; } if ( td->hasStartDate() ) { - QDateTime start( td->dtStart() ); + TQDateTime start( td->dtStart() ); if ( !haveOffset ) daysTo = start.date().daysTo( date ); td->setDtStart( start.addDays( daysTo ) ); @@ -367,7 +367,7 @@ Incidence *Calendar::dissociateOccurrence( Incidence *incidence, QDate date, return newInc; } -Incidence *Calendar::incidence( const QString &uid ) +Incidence *Calendar::incidence( const TQString &uid ) { Incidence *i = event( uid ); if ( i ) @@ -379,7 +379,7 @@ Incidence *Calendar::incidence( const QString &uid ) return i; } -Incidence::List Calendar::incidencesFromSchedulingID( const QString &UID ) +Incidence::List Calendar::incidencesFromSchedulingID( const TQString &UID ) { Incidence::List result; Incidence::List incidences = rawIncidences(); @@ -390,7 +390,7 @@ Incidence::List Calendar::incidencesFromSchedulingID( const QString &UID ) return result; } -Incidence *Calendar::incidenceFromSchedulingID( const QString &UID ) +Incidence *Calendar::incidenceFromSchedulingID( const TQString &UID ) { Incidence::List incidences = rawIncidences(); Incidence::List::iterator it = incidences.begin(); @@ -554,7 +554,7 @@ Todo::List Calendar::todos( TodoSortField sortField, return tl; } -Todo::List Calendar::todos( const QDate &date ) +Todo::List Calendar::todos( const TQDate &date ) { Todo::List el = rawTodosForDate( date ); mFilter->apply( &el ); @@ -622,7 +622,7 @@ Journal::List Calendar::journals( JournalSortField sortField, return jl; } -Journal::List Calendar::journals( const QDate &date ) +Journal::List Calendar::journals( const TQDate &date ) { Journal::List el = rawJournalsForDate( date ); mFilter->apply( &el ); @@ -635,7 +635,7 @@ void Calendar::setupRelations( Incidence *forincidence ) { if ( !forincidence ) return; // kdDebug(5850) << "Calendar::setupRelations for incidence " << forincidence << " with UID " << forincidence->uid() << ", summary: " << forincidence->summary() << endl; - QString uid = forincidence->uid(); + TQString uid = forincidence->uid(); // First, go over the list of orphans and see if this is their parent while ( Incidence* i = mOrphans[ uid ] ) { @@ -673,7 +673,7 @@ void Calendar::removeRelations( Incidence *incidence ) } // kdDebug(5850) << "Calendar::removeRelations for incidence " << forincidence << " with UID " << forincidence->uid() << ", summary: " << forincidence->summary() << endl; - QString uid = incidence->uid(); + TQString uid = incidence->uid(); Incidence::List relations = incidence->relations(); Incidence::List::ConstIterator it; @@ -702,17 +702,17 @@ void Calendar::removeRelations( Incidence *incidence ) // incidence (this might happen when the relatedTo of the item is // changed before its parent is inserted. This might happen with // groupware servers....). Remove them, too - QStringList relatedToUids; + TQStringList relatedToUids; // First get the list of all keys in the mOrphans list that point to the removed item relatedToUids << incidence->relatedToUid(); - for ( QDictIterator it( mOrphans ); it.current(); ++it ) { + for ( TQDictIterator it( mOrphans ); it.current(); ++it ) { if ( it.current()->uid() == uid ) { relatedToUids << it.currentKey(); } } // now go through all uids that have one entry that point to the incidence - for ( QStringList::Iterator uidit = relatedToUids.begin(); + for ( TQStringList::Iterator uidit = relatedToUids.begin(); uidit != relatedToUids.end(); ++uidit ) { Incidence::List tempList; // Remove all to get access to the remaining entries @@ -757,7 +757,7 @@ void Calendar::setModified( bool modified ) void Calendar::incidenceUpdated( IncidenceBase *incidence ) { incidence->setSyncStatus( Event::SYNCMOD ); - incidence->setLastModified( QDateTime::currentDateTime() ); + incidence->setLastModified( TQDateTime::currentDateTime() ); // we should probably update the revision number here, // or internally in the Event itself when certain things change. // need to verify with ical documentation. @@ -809,12 +809,12 @@ void Calendar::customPropertyUpdated() setModified( true ); } -void Calendar::setProductId( const QString &productId ) +void Calendar::setProductId( const TQString &productId ) { mProductId = productId; } -QString Calendar::productId() +TQString Calendar::productId() { return mProductId; } diff --git a/libkcal/calendar.h b/libkcal/calendar.h index bfcf4c8ad..4c6c0f988 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -31,11 +31,11 @@ #ifndef KCAL_CALENDAR_H #define KCAL_CALENDAR_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include "customproperties.h" @@ -164,7 +164,7 @@ enum JournalSortField - Depending on the LocalTime setting, all loaded Incidences are stored either in UTC or without a time zone (floating time zone). */ -class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, +class LIBKCAL_EXPORT Calendar : public TQObject, public CustomProperties, public IncidenceBase::Observer { Q_OBJECT @@ -185,7 +185,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, Do Not pass an empty timeZoneId string as this may cause unintended consequences when storing Incidences into the Calendar. */ - Calendar( const QString &timeZoneId ); + Calendar( const TQString &timeZoneId ); /** Destructor @@ -195,16 +195,16 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, /** Set the Calendar Product ID. - @param productId is a QString containing the Product ID. + @param productId is a TQString containing the Product ID. */ - void setProductId( const QString &productId ); + void setProductId( const TQString &productId ); /** Get the Calendar's Product ID. @return the string containing the Product ID */ - QString productId(); + TQString productId(); /** Set the owner of the Calendar. @@ -234,7 +234,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, Do Not pass an empty timeZoneId string as this may cause unintended consequences when storing Incidences into the Calendar. */ - void setTimeZoneId( const QString &timeZoneId ); + void setTimeZoneId( const TQString &timeZoneId ); /** * Set the timezone used for viewing the incidences in this calendar. In @@ -242,14 +242,14 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, * retain their absolute time (in UTC). * @ref setTimeZoneId */ - virtual void setTimeZoneIdViewOnly( const QString &timeZoneId ) = 0; + virtual void setTimeZoneIdViewOnly( const TQString &timeZoneId ) = 0; /** Get the Time Zone ID for the Calendar. @return the string containg the Time Zone ID. */ - QString timeZoneId() const; + TQString timeZoneId() const; /** Set to store calendar Incidences without a time zone. @@ -294,7 +294,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, * once before, in other words initialized. * @par tz The timezone to use for loading. */ - virtual bool reload( const QString &tz ) = 0; + virtual bool reload( const TQString &tz ) = 0; /** Determine if the Calendar is currently being saved. @@ -306,9 +306,9 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, /** Return a list of all categories used by Incidences in this Calendar. - @return a QStringList containing all the categories. + @return a TQStringList containing all the categories. */ - QStringList categories(); + TQStringList categories(); // Incidence Specific Methods // @@ -340,11 +340,11 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, /** Return a filtered list of all Incidences which occur on the given date. - @param date request filtered Incidence list for this QDate only. + @param date request filtered Incidence list for this TQDate only. @return the list of filtered Incidences occurring on the specified date. */ - virtual Incidence::List incidences( const QDate &date ); + virtual Incidence::List incidences( const TQDate &date ); /** Return an unfiltered list of all Incidences for this Calendar. @@ -361,7 +361,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, @return a pointer to the Incidence. A null pointer is returned if no such Incidence exists. */ - Incidence *incidence( const QString &uid ); + Incidence *incidence( const TQString &uid ); /** Returns the Incidence associated with the given scheduling identifier. @@ -371,13 +371,13 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, @return a pointer to the Incidence. A null pointer is returned if no such Incidence exists. */ - Incidence *incidenceFromSchedulingID( const QString &sid ); + Incidence *incidenceFromSchedulingID( const TQString &sid ); /** * Searches all events and todos for (an incidence with this * scheduling ID. Returns a list of matching results. **/ - Incidence::List incidencesFromSchedulingID( const QString &UID ); + Incidence::List incidencesFromSchedulingID( const TQString &UID ); /** Create a merged list of Events, Todos, and Journals. @@ -415,14 +415,14 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, will have all recurrences past the @a date. @param incidence is a pointer to a recurring Incidence. - @param date is the QDate within the recurring Incidence on which + @param date is the TQDate within the recurring Incidence on which the dissociation will be performed. @param single is a flag meaning that a new Incidence should be created from the recurring Incidences after @a date. @return a pointer to a new recurring Incidence if @a single is false. */ - Incidence *dissociateOccurrence( Incidence *incidence, QDate date, + Incidence *dissociateOccurrence( Incidence *incidence, TQDate date, bool single = true ); // Event Specific Methods // @@ -472,11 +472,11 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, /** Return a filtered list of all Events which occur on the given timestamp. - @param qdt request filtered Event list for this QDateTime only. + @param qdt request filtered Event list for this TQDateTime only. @return the list of filtered Events occurring on the specified timestamp. */ - Event::List events( const QDateTime &qdt ); + Event::List events( const TQDateTime &qdt ); /** Return a filtered list of all Events occurring within a date range. @@ -489,7 +489,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, @return the list of filtered Events occurring within the specified date range. */ - Event::List events( const QDate &start, const QDate &end, + Event::List events( const TQDate &start, const TQDate &end, bool inclusive = false); /** @@ -497,14 +497,14 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, date. The Events are sorted according to @a sortField and @a sortDirection. - @param date request filtered Event list for this QDate only. + @param date request filtered Event list for this TQDate only. @param sortField specifies the EventSortField. @param sortDirection specifies the SortDirection. @return the list of sorted, filtered Events occurring on @a date. */ Event::List events( - const QDate &date, + const TQDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ); @@ -524,12 +524,12 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, Return an unfiltered list of all Events which occur on the given timestamp. - @param qdt request unfiltered Event list for this QDateTime only. + @param qdt request unfiltered Event list for this TQDateTime only. @return the list of unfiltered Events occurring on the specified timestamp. */ - virtual Event::List rawEventsForDate( const QDateTime &qdt ) = 0; + virtual Event::List rawEventsForDate( const TQDateTime &qdt ) = 0; /** Return an unfiltered list of all Events occurring within a date range. @@ -542,7 +542,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, @return the list of unfiltered Events occurring within the specified date range. */ - virtual Event::List rawEvents( const QDate &start, const QDate &end, + virtual Event::List rawEvents( const TQDate &start, const TQDate &end, bool inclusive = false ) = 0; /** @@ -550,14 +550,14 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, date. The Events are sorted according to @a sortField and @a sortDirection. - @param date request unfiltered Event list for this QDate only. + @param date request unfiltered Event list for this TQDate only. @param sortField specifies the EventSortField. @param sortDirection specifies the SortDirection. @return the list of sorted, unfiltered Events occurring on @a date. */ virtual Event::List rawEventsForDate( - const QDate &date, + const TQDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ) = 0; @@ -569,7 +569,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, @return a pointer to the Event. A null pointer is returned if no such Event exists. */ - virtual Event *event( const QString &uid ) = 0; + virtual Event *event( const TQString &uid ) = 0; // Todo Specific Methods // @@ -619,11 +619,11 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, /** Return a filtered list of all Todos which are due on the specified date. - @param date request filtered Todos due on this QDate. + @param date request filtered Todos due on this TQDate. @return the list of filtered Todos due on the specified date. */ - virtual Todo::List todos( const QDate &date ); + virtual Todo::List todos( const TQDate &date ); /** Return a sorted, unfiltered list of all Todos for this Calendar. @@ -640,11 +640,11 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, /** Return an unfiltered list of all Todos which due on the specified date. - @param date request unfiltered Todos due on this QDate. + @param date request unfiltered Todos due on this TQDate. @return the list of unfiltered Todos due on the specified date. */ - virtual Todo::List rawTodosForDate( const QDate &date ) = 0; + virtual Todo::List rawTodosForDate( const TQDate &date ) = 0; /** Returns the Todo associated with the given unique identifier. @@ -654,7 +654,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, @return a pointer to the Todo. A null pointer is returned if no such Todo exists. */ - virtual Todo *todo( const QString &uid ) = 0; + virtual Todo *todo( const TQString &uid ) = 0; // Journal Specific Methods // @@ -703,11 +703,11 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, /** Return a filtered list of all Journals for on the specifed date. - @param date request filtered Journals for this QDate only. + @param date request filtered Journals for this TQDate only. @return the list of filtered Journals for the specified date. */ - virtual Journal::List journals( const QDate &date ); + virtual Journal::List journals( const TQDate &date ); /** Return a sorted, unfiltered list of all Journals for this Calendar. @@ -724,11 +724,11 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, /** Return an unfiltered list of all Journals for on the specifed date. - @param date request unfiltered Journals for this QDate only. + @param date request unfiltered Journals for this TQDate only. @return the list of unfiltered Journals for the specified date. */ - virtual Journal::List rawJournalsForDate( const QDate &date ) = 0; + virtual Journal::List rawJournalsForDate( const TQDate &date ) = 0; /** Returns the Journal associated with the given unique identifier. @@ -738,7 +738,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, @return a pointer to the Journal. A null pointer is returned if no such Journal exists. */ - virtual Journal *journal( const QString &uid ) = 0; + virtual Journal *journal( const TQString &uid ) = 0; // Relations Specific Methods // @@ -786,8 +786,8 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, @return the list of Alarms for the for the specified time range. */ - virtual Alarm::List alarms( const QDateTime &from, - const QDateTime &to ) = 0; + virtual Alarm::List alarms( const TQDateTime &from, + const TQDateTime &to ) = 0; // Observer Specific Methods // @@ -884,7 +884,7 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, Do Not pass an empty timeZoneId string as this may cause unintended consequences when storing Incidences into the Calendar. */ - virtual void doSetTimeZoneId( const QString &/*timeZoneId*/ ) {} + virtual void doSetTimeZoneId( const TQString &/*timeZoneId*/ ) {} /** Let Calendar subclasses notify that they inserted an Incidence. @@ -931,9 +931,9 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, */ void init(); - QString mProductId; + TQString mProductId; Person mOwner; - QString mTimeZoneId; + TQString mTimeZoneId; bool mLocalTime; bool mModified; @@ -941,13 +941,13 @@ class LIBKCAL_EXPORT Calendar : public QObject, public CustomProperties, CalFilter *mFilter; CalFilter *mDefaultFilter; - QPtrList mObservers; + TQPtrList mObservers; bool mNewObserver; bool mObserversEnabled; // This list is used to put together related Todos - QDict mOrphans; - QDict mOrphanUids; + TQDict mOrphans; + TQDict mOrphanUids; class Private; Private *d; diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index a37488f6f..39c48ae4b 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -21,9 +21,9 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include +#include +#include +#include #include #include @@ -41,7 +41,7 @@ using namespace KCal; -CalendarLocal::CalendarLocal( const QString &timeZoneId ) +CalendarLocal::CalendarLocal( const TQString &timeZoneId ) : Calendar( timeZoneId ), mEvents( 47 ) { init(); @@ -50,7 +50,7 @@ CalendarLocal::CalendarLocal( const QString &timeZoneId ) void CalendarLocal::init() { mDeletedIncidences.setAutoDelete( true ); - mFileName = QString::null; + mFileName = TQString::null; } @@ -59,16 +59,16 @@ CalendarLocal::~CalendarLocal() close(); } -bool CalendarLocal::load( const QString &fileName, CalFormat *format ) +bool CalendarLocal::load( const TQString &fileName, CalFormat *format ) { mFileName = fileName; FileStorage storage( this, fileName, format ); return storage.load(); } -bool CalendarLocal::reload( const QString &tz ) +bool CalendarLocal::reload( const TQString &tz ) { - const QString filename = mFileName; + const TQString filename = mFileName; save(); close(); mFileName = filename; @@ -77,7 +77,7 @@ bool CalendarLocal::reload( const QString &tz ) return storage.load(); } -bool CalendarLocal::save( const QString &fileName, CalFormat *format ) +bool CalendarLocal::save( const TQString &fileName, CalFormat *format ) { // Save only if the calendar is either modified, or saved to a // different file than it was loaded from @@ -92,7 +92,7 @@ bool CalendarLocal::save( const QString &fileName, CalFormat *format ) void CalendarLocal::close() { setObserversEnabled( false ); - mFileName = QString::null; + mFileName = TQString::null; deleteAllEvents(); deleteAllTodos(); @@ -136,7 +136,7 @@ bool CalendarLocal::deleteEvent( Event *event ) void CalendarLocal::deleteAllEvents() { // kdDebug(5800) << "CalendarLocal::deleteAllEvents" << endl; - QDictIterator it( mEvents ); + TQDictIterator it( mEvents ); while( it.current() ) { notifyIncidenceDeleted( it.current() ); ++it; @@ -147,7 +147,7 @@ void CalendarLocal::deleteAllEvents() mEvents.setAutoDelete( false ); } -Event *CalendarLocal::event( const QString &uid ) +Event *CalendarLocal::event( const TQString &uid ) { // kdDebug(5800) << "CalendarLocal::event(): " << uid << endl; return mEvents[ uid ]; @@ -204,7 +204,7 @@ Todo::List CalendarLocal::rawTodos( TodoSortField sortField, return sortTodos( &mTodoList, sortField, sortDirection ); } -Todo *CalendarLocal::todo( const QString &uid ) +Todo *CalendarLocal::todo( const TQString &uid ) { Todo::List::ConstIterator it; for ( it = mTodoList.begin(); it != mTodoList.end(); ++it ) { @@ -214,7 +214,7 @@ Todo *CalendarLocal::todo( const QString &uid ) return 0; } -Todo::List CalendarLocal::rawTodosForDate( const QDate &date ) +Todo::List CalendarLocal::rawTodosForDate( const TQDate &date ) { Todo::List todos; @@ -229,12 +229,12 @@ Todo::List CalendarLocal::rawTodosForDate( const QDate &date ) return todos; } -Alarm::List CalendarLocal::alarmsTo( const QDateTime &to ) +Alarm::List CalendarLocal::alarmsTo( const TQDateTime &to ) { - return alarms( QDateTime( QDate( 1900, 1, 1 ) ), to ); + return alarms( TQDateTime( TQDate( 1900, 1, 1 ) ), to ); } -Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) +Alarm::List CalendarLocal::alarms( const TQDateTime &from, const TQDateTime &to ) { // kdDebug(5800) << "CalendarLocal::alarms(" << from.toString() << " - " // << to.toString() << ")" << endl; @@ -257,14 +257,14 @@ Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) } void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, - const QDateTime &from, const QDateTime &to ) + const TQDateTime &from, const TQDateTime &to ) { - QDateTime preTime = from.addSecs(-1); + TQDateTime preTime = from.addSecs(-1); Alarm::List::ConstIterator it; for( it = incidence->alarms().begin(); it != incidence->alarms().end(); ++it ) { if ( (*it)->enabled() ) { - QDateTime dt = (*it)->nextRepetition(preTime); + TQDateTime dt = (*it)->nextRepetition(preTime); if ( dt.isValid() && dt <= to ) { kdDebug(5800) << "CalendarLocal::appendAlarms() '" << incidence->summary() << "': " @@ -277,10 +277,10 @@ void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence, - const QDateTime &from, - const QDateTime &to ) + const TQDateTime &from, + const TQDateTime &to ) { - QDateTime qdt; + TQDateTime qdt; int endOffset = 0; bool endOffsetValid = false; int period = from.secsTo(to); @@ -353,7 +353,7 @@ void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, void CalendarLocal::incidenceUpdated( IncidenceBase *incidence ) { incidence->setSyncStatusSilent( Event::SYNCMOD ); - incidence->setLastModified( QDateTime::currentDateTime() ); + incidence->setLastModified( TQDateTime::currentDateTime() ); // we should probably update the revision number here, // or internally in the Event itself when certain things change. // need to verify with ical documentation. @@ -366,7 +366,7 @@ void CalendarLocal::incidenceUpdated( IncidenceBase *incidence ) void CalendarLocal::insertEvent( Event *event ) { - QString uid = event->uid(); + TQString uid = event->uid(); if ( mEvents[ uid ] == 0 ) { mEvents.insert( uid, event ); } @@ -377,7 +377,7 @@ void CalendarLocal::insertEvent( Event *event ) #endif } -Event::List CalendarLocal::rawEventsForDate( const QDate &qd, +Event::List CalendarLocal::rawEventsForDate( const TQDate &qd, EventSortField sortField, SortDirection sortDirection ) { @@ -411,18 +411,18 @@ Event::List CalendarLocal::rawEventsForDate( const QDate &qd, return sortEvents( &eventList, sortField, sortDirection ); } -Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, +Event::List CalendarLocal::rawEvents( const TQDate &start, const TQDate &end, bool inclusive ) { Event::List eventList; - QDate yesterStart = start.addDays(-1); + TQDate yesterStart = start.addDays(-1); // Get non-recurring events EventDictIterator it( mEvents ); for( ; it.current(); ++it ) { Event *event = *it; - QDate rStart = event->dtStart().date(); + TQDate rStart = event->dtStart().date(); if (end < rStart) { // kdDebug(5800) << "Skipping event starting after TOI" << endl; continue; @@ -433,7 +433,7 @@ Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, } if ( ! event->doesRecur() ) { // non-recurring events - QDate rEnd = event->dtEnd().date(); + TQDate rEnd = event->dtEnd().date(); if (rEnd < start) { // kdDebug(5800) << "Skipping event ending before TOI" << endl; continue; @@ -452,7 +452,7 @@ Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, break; case 0: // end date given default: // count given - QDate rEnd = event->recurrence()->endDate(); + TQDate rEnd = event->recurrence()->endDate(); if ( ! rEnd.isValid() ) { // kdDebug(5800) << "Skipping recurring event without occurences" << endl; continue; @@ -465,10 +465,10 @@ Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, // kdDebug(5800) << "Skipping recurring event ending after TOI while inclusive" << endl; continue; } - /* FIXME: too much conversion between QDate and QDateTime makes this useless: - * freebusy(end=QDateTime(day, "00:00:00")) -> - * rawEvents(end=QDate(day)) -> - * durationTo(QDateTime(day, "23:59:59")) + /* FIXME: too much conversion between TQDate and TQDateTime makes this useless: + * freebusy(end=TQDateTime(day, "00:00:00")) -> + * rawEvents(end=TQDate(day)) -> + * durationTo(TQDateTime(day, "23:59:59")) * so events repeating at the end day match and are included. */ #if 0 @@ -489,7 +489,7 @@ Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, return eventList; } -Event::List CalendarLocal::rawEventsForDate( const QDateTime &qdt ) +Event::List CalendarLocal::rawEventsForDate( const TQDateTime &qdt ) { return rawEventsForDate( qdt.date() ); } @@ -546,7 +546,7 @@ void CalendarLocal::deleteAllJournals() mJournalList.setAutoDelete( false ); } -Journal *CalendarLocal::journal( const QString &uid ) +Journal *CalendarLocal::journal( const TQString &uid ) { Journal::List::ConstIterator it; for ( it = mJournalList.begin(); it != mJournalList.end(); ++it ) @@ -561,7 +561,7 @@ Journal::List CalendarLocal::rawJournals( JournalSortField sortField, SortDirect return sortJournals( &mJournalList, sortField, sortDirection ); } -Journal::List CalendarLocal::rawJournalsForDate( const QDate &date ) +Journal::List CalendarLocal::rawJournalsForDate( const TQDate &date ) { Journal::List journals; @@ -576,9 +576,9 @@ Journal::List CalendarLocal::rawJournalsForDate( const QDate &date ) return journals; } -void CalendarLocal::setTimeZoneIdViewOnly( const QString& tz ) +void CalendarLocal::setTimeZoneIdViewOnly( const TQString& tz ) { - const QString question( i18n("The timezone setting was changed. In order to display the calendar " + const TQString question( i18n("The timezone setting was changed. In order to display the calendar " "you are looking at in the new timezone, it needs to be saved. Do you want to save the pending " "changes or rather wait and apply the new timezone on the next reload?" ) ); int rc = KMessageBox::Yes; diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index 99bc76c2f..b76eb5ab4 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h @@ -23,7 +23,7 @@ #define KCAL_CALENDARLOCAL_H #include "calendar.h" -#include +#include #include namespace KCal { @@ -39,7 +39,7 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar /** Constructs a new calendar, with variables initialized to sane values. */ - CalendarLocal( const QString &timeZoneId ); + CalendarLocal( const TQString &timeZoneId ); ~CalendarLocal(); /** @@ -55,14 +55,14 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar @param fileName the name of the calendar on disk. @param format the format to use. If 0, iCalendar and vCalendar will be used */ - bool load( const QString &fileName, CalFormat *format = 0 ); + bool load( const TQString &fileName, CalFormat *format = 0 ); /** * Reloads the contents of the storage into memory. The associated file name * must be known, in other words a previous load() must have been executed. * @return success or failure */ - bool reload( const QString &tz ); + bool reload( const TQString &tz ); /** Writes out the calendar to disk in the specified \a format. @@ -71,7 +71,7 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar @param format the format to use @return true, if successful, false on error. */ - bool save( const QString &fileName, CalFormat *format = 0 ); + bool save( const TQString &fileName, CalFormat *format = 0 ); /** Clears out the current calendar, freeing all used memory etc. etc. @@ -96,7 +96,7 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar /** Retrieves an event on the basis of the unique string ID. */ - Event *event( const QString &uid ); + Event *event( const TQString &uid ); /** Return unfiltered list of all events in calendar. */ @@ -118,7 +118,7 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar Searches todolist for an event with this unique string identifier, returns a pointer or null. */ - Todo *todo( const QString &uid ); + Todo *todo( const TQString &uid ); /** Return list of all todos. */ @@ -126,7 +126,7 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar /** Returns list of todos due on the specified date. */ - Todo::List rawTodosForDate( const QDate &date ); + Todo::List rawTodosForDate( const TQDate &date ); /** Add a Journal entry to calendar. @@ -143,7 +143,7 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar /** Return Journal with given UID. */ - Journal *journal( const QString &uid ); + Journal *journal( const TQString &uid ); /** Return list of all journals. */ @@ -151,27 +151,27 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar /** Get unfiltered journals for a given date. */ - Journal::List rawJournalsForDate( const QDate &date ); + Journal::List rawJournalsForDate( const TQDate &date ); /** Return all alarms, which ocur in the given time interval. */ - Alarm::List alarms( const QDateTime &from, const QDateTime &to ); + Alarm::List alarms( const TQDateTime &from, const TQDateTime &to ); /** Return all alarms, which ocur before given date. */ - Alarm::List alarmsTo( const QDateTime &to ); + Alarm::List alarmsTo( const TQDateTime &to ); /** Builds and then returns a list of all events that match for the date specified. useful for dayView, etc. etc. */ - Event::List rawEventsForDate( const QDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ); + Event::List rawEventsForDate( const TQDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ); /** Get unfiltered events for date \a qdt. */ - Event::List rawEventsForDate( const QDateTime &qdt ); + Event::List rawEventsForDate( const TQDateTime &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. @@ -181,7 +181,7 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar from its start to its end date. For a recurring event, its time span is from its first to its last recurrence. */ - Event::List rawEvents( const QDate &start, const QDate &end, + Event::List rawEvents( const TQDate &start, const TQDate &end, bool inclusive = false ); /** @@ -189,7 +189,7 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar * in the calendar. This requires that the calendar is saved first, so the * user is asked whether he wants to do that, or keep the timezone as is. */ - void setTimeZoneIdViewOnly( const QString& tz ); + void setTimeZoneIdViewOnly( const TQString& tz ); protected: @@ -201,23 +201,23 @@ class LIBKCAL_EXPORT CalendarLocal : public Calendar /** Append alarms of incidence in interval to list of alarms. */ void appendAlarms( Alarm::List &alarms, Incidence *incidence, - const QDateTime &from, const QDateTime &to ); + const TQDateTime &from, const TQDateTime &to ); /** Append alarms of recurring events in interval to list of alarms. */ void appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence, - const QDateTime &from, const QDateTime &to ); + const TQDateTime &from, const TQDateTime &to ); private: void init(); - typedef QDict EventDict; - typedef QDictIterator EventDictIterator; + typedef TQDict EventDict; + typedef TQDictIterator EventDictIterator; EventDict mEvents; Todo::List mTodoList; Journal::List mJournalList; Incidence::List mDeletedIncidences; - QString mFileName; + TQString mFileName; class Private; Private *d; diff --git a/libkcal/calendarnull.cpp b/libkcal/calendarnull.cpp index cef2588c0..f4b07789c 100644 --- a/libkcal/calendarnull.cpp +++ b/libkcal/calendarnull.cpp @@ -28,7 +28,7 @@ using namespace KCal; -CalendarNull::CalendarNull( const QString &timeZoneId ) +CalendarNull::CalendarNull( const TQString &timeZoneId ) : Calendar( timeZoneId ) {} @@ -36,7 +36,7 @@ CalendarNull *CalendarNull::mSelf = 0; CalendarNull *CalendarNull::self() { - if ( !mSelf ) mSelf = new CalendarNull( QString::fromLatin1( "UTC" ) ); + if ( !mSelf ) mSelf = new CalendarNull( TQString::fromLatin1( "UTC" ) ); return mSelf; } diff --git a/libkcal/calendarnull.h b/libkcal/calendarnull.h index 6f27ed52a..d6c758442 100644 --- a/libkcal/calendarnull.h +++ b/libkcal/calendarnull.h @@ -53,7 +53,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar /** Constructor. */ - CalendarNull( const QString &timeZoneId ); + CalendarNull( const TQString &timeZoneId ); /** Destructor. @@ -76,7 +76,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar */ void save() {} - bool reload( const QString & ) { return true;} + bool reload( const TQString & ) { return true;} // Event Specific Methods // @@ -122,7 +122,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar Returns an empty Event List. */ - Event::List rawEvents( const QDate & /*start*/, const QDate & /*end*/, + Event::List rawEvents( const TQDate & /*start*/, const TQDate & /*end*/, bool /*inclusive*/ ) { return Event::List(); } @@ -130,11 +130,11 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar Return an unfiltered list of all Events which occur on the given timestamp. - First parameter is a QDateTime to return unfiltered events for. + First parameter is a TQDateTime to return unfiltered events for. Returns an empty Event List. */ - Event::List rawEventsForDate( const QDateTime & /*qdt*/ ) + Event::List rawEventsForDate( const TQDateTime & /*qdt*/ ) { return Event::List(); } /** @@ -142,14 +142,14 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar date. The Events are sorted according to @a sortField and @a sortDirection. - First parameter is a QDate to return unfiltered Events for.\n + First parameter is a TQDate to return unfiltered Events for.\n Second parameter specifies the EventSortField.\n Third parameter specifies the SortDirection. Returns an empty Event List. */ Event::List rawEventsForDate( - const QDate & /*date*/, + const TQDate & /*date*/, EventSortField /*sortField=EventSortUnsorted*/, SortDirection /*sortDirection=SortDirectionAscending*/ ) { return Event::List(); } @@ -161,7 +161,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar Return a null Event pointer. */ - Event *event( const QString & /*uid*/ ) + Event *event( const TQString & /*uid*/ ) { return 0; } // Todo Specific Methods // @@ -206,7 +206,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar Returns an empty Todo List. */ - Todo::List rawTodosForDate( const QDate & /*date*/ ) + Todo::List rawTodosForDate( const TQDate & /*date*/ ) { return Todo::List(); } /** @@ -216,7 +216,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar Returns a null Todo pointer. */ - Todo *todo( const QString & /*uid*/ ) + Todo *todo( const TQString & /*uid*/ ) { return 0; } // Journal Specific Methods // @@ -260,7 +260,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar Returns an empty Journal List. */ - Journal::List rawJournalsForDate( const QDate & /*date*/ ) + Journal::List rawJournalsForDate( const TQDate & /*date*/ ) { return Journal::List(); } /** @@ -270,7 +270,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar Returns an null Journal pointer. */ - Journal *journal( const QString & /*uid*/ ) + Journal *journal( const TQString & /*uid*/ ) { return 0; } // Alarm Specific Methods // @@ -284,7 +284,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar Returns an empty Alarm List. */ - Alarm::List alarms( const QDateTime & /*from*/, const QDateTime & /*to*/ ) + Alarm::List alarms( const TQDateTime & /*from*/, const TQDateTime & /*to*/ ) { return Alarm::List(); } // Observer Specific Methods // @@ -295,7 +295,7 @@ class LIBKCAL_EXPORT CalendarNull : public Calendar */ void incidenceUpdated( IncidenceBase * /*incidenceBase*/ ) {} - void setTimeZoneIdViewOnly( const QString& ) {}; + void setTimeZoneIdViewOnly( const TQString& ) {}; private: static CalendarNull *mSelf; diff --git a/libkcal/calendarresources.cpp b/libkcal/calendarresources.cpp index d6ef5c796..94ce0ca31 100644 --- a/libkcal/calendarresources.cpp +++ b/libkcal/calendarresources.cpp @@ -28,9 +28,9 @@ */ #include -#include -#include -#include +#include +#include +#include #include #include @@ -64,7 +64,7 @@ ResourceCalendar ResourceCalendar *CalendarResources::AskDestinationPolicy::destination( Incidence * ) { - QPtrList list; + TQPtrList list; CalendarResourceManager::ActiveIterator it; for ( it = resourceManager()->activeBegin(); @@ -83,14 +83,14 @@ ResourceCalendar return static_cast( r ); } -CalendarResources::CalendarResources( const QString &timeZoneId, - const QString &family ) +CalendarResources::CalendarResources( const TQString &timeZoneId, + const TQString &family ) : Calendar( timeZoneId ) { init( family ); } -void CalendarResources::init( const QString &family ) +void CalendarResources::init( const TQString &family ) { kdDebug(5800) << "CalendarResources::init( " << family << " )" << endl; @@ -135,7 +135,7 @@ void CalendarResources::load() (*i1)->setTimeZoneId( timeZoneId() ); } - QValueList failed; + TQValueList failed; // Open all active resources CalendarResourceManager::ActiveIterator it; @@ -151,7 +151,7 @@ void CalendarResources::load() } } - QValueList::ConstIterator it2; + TQValueList::ConstIterator it2; for ( it2 = failed.begin(); it2 != failed.end(); ++it2 ) { (*it2)->setActive( false ); emit signalResourceModified( *it2 ); @@ -160,7 +160,7 @@ void CalendarResources::load() mOpen = true; } -bool CalendarResources::reload( const QString &tz ) +bool CalendarResources::reload( const TQString &tz ) { save(); close(); @@ -179,12 +179,12 @@ void CalendarResources::setAskDestinationPolicy() mDestinationPolicy = mAskPolicy; } -QWidget *CalendarResources::dialogParentWidget() +TQWidget *CalendarResources::dialogParentWidget() { return mDestinationPolicy->parent(); } -void CalendarResources::setDialogParentWidget( QWidget *parent ) +void CalendarResources::setDialogParentWidget( TQWidget *parent ) { mDestinationPolicy->setParent( parent ); } @@ -322,7 +322,7 @@ bool CalendarResources::deleteEvent( Event *event ) return status; } -Event *CalendarResources::event( const QString &uid ) +Event *CalendarResources::event( const TQString &uid ) { CalendarResourceManager::ActiveIterator it; for ( it = mManager->activeBegin(); it != mManager->activeEnd(); ++it ) { @@ -386,7 +386,7 @@ Todo::List CalendarResources::rawTodos( TodoSortField sortField, return sortTodos( &result, sortField, sortDirection ); } -Todo *CalendarResources::todo( const QString &uid ) +Todo *CalendarResources::todo( const TQString &uid ) { kdDebug(5800) << "CalendarResources::todo(uid)" << endl; @@ -403,7 +403,7 @@ Todo *CalendarResources::todo( const QString &uid ) return 0; } -Todo::List CalendarResources::rawTodosForDate( const QDate &date ) +Todo::List CalendarResources::rawTodosForDate( const TQDate &date ) { Todo::List result; @@ -420,7 +420,7 @@ Todo::List CalendarResources::rawTodosForDate( const QDate &date ) return result; } -Alarm::List CalendarResources::alarmsTo( const QDateTime &to ) +Alarm::List CalendarResources::alarmsTo( const TQDateTime &to ) { kdDebug(5800) << "CalendarResources::alarmsTo" << endl; @@ -435,8 +435,8 @@ Alarm::List CalendarResources::alarmsTo( const QDateTime &to ) return result; } -Alarm::List CalendarResources::alarms( const QDateTime &from, - const QDateTime &to ) +Alarm::List CalendarResources::alarms( const TQDateTime &from, + const TQDateTime &to ) { Alarm::List result; CalendarResourceManager::ActiveIterator resit; @@ -451,7 +451,7 @@ Alarm::List CalendarResources::alarms( const QDateTime &from, /****************************** PROTECTED METHODS ****************************/ -Event::List CalendarResources::rawEventsForDate( const QDate &date, +Event::List CalendarResources::rawEventsForDate( const TQDate &date, EventSortField sortField, SortDirection sortDirection ) { @@ -468,7 +468,7 @@ Event::List CalendarResources::rawEventsForDate( const QDate &date, return sortEvents( &result, sortField, sortDirection ); } -Event::List CalendarResources::rawEvents( const QDate &start, const QDate &end, +Event::List CalendarResources::rawEvents( const TQDate &start, const TQDate &end, bool inclusive ) { kdDebug(5800) << "CalendarResources::rawEvents(start,end,inclusive)" << endl; @@ -486,7 +486,7 @@ Event::List CalendarResources::rawEvents( const QDate &start, const QDate &end, return result; } -Event::List CalendarResources::rawEventsForDate( const QDateTime &qdt ) +Event::List CalendarResources::rawEventsForDate( const TQDateTime &qdt ) { kdDebug(5800) << "CalendarResources::rawEventsForDate(qdt)" << endl; @@ -557,7 +557,7 @@ bool CalendarResources::addJournal( Journal *journal, return addIncidence( journal, resource ); } -Journal *CalendarResources::journal( const QString &uid ) +Journal *CalendarResources::journal( const TQString &uid ) { kdDebug(5800) << "CalendarResources::journal(uid)" << endl; @@ -592,7 +592,7 @@ Journal::List CalendarResources::rawJournals( JournalSortField sortField, return sortJournals( &result, sortField, sortDirection ); } -Journal::List CalendarResources::rawJournalsForDate( const QDate &date ) +Journal::List CalendarResources::rawJournalsForDate( const TQDate &date ) { Journal::List result; @@ -611,17 +611,17 @@ Journal::List CalendarResources::rawJournalsForDate( const QDate &date ) void CalendarResources::connectResource( ResourceCalendar *resource ) { - connect( resource, SIGNAL( resourceChanged( ResourceCalendar * ) ), - SIGNAL( calendarChanged() ) ); - connect( resource, SIGNAL( resourceSaved( ResourceCalendar * ) ), - SIGNAL( calendarSaved() ) ); + connect( resource, TQT_SIGNAL( resourceChanged( ResourceCalendar * ) ), + TQT_SIGNAL( calendarChanged() ) ); + connect( resource, TQT_SIGNAL( resourceSaved( ResourceCalendar * ) ), + TQT_SIGNAL( calendarSaved() ) ); - connect( resource, SIGNAL( resourceLoadError( ResourceCalendar *, - const QString & ) ), - SLOT( slotLoadError( ResourceCalendar *, const QString & ) ) ); - connect( resource, SIGNAL( resourceSaveError( ResourceCalendar *, - const QString & ) ), - SLOT( slotSaveError( ResourceCalendar *, const QString & ) ) ); + connect( resource, TQT_SIGNAL( resourceLoadError( ResourceCalendar *, + const TQString & ) ), + TQT_SLOT( slotLoadError( ResourceCalendar *, const TQString & ) ) ); + connect( resource, TQT_SIGNAL( resourceSaveError( ResourceCalendar *, + const TQString & ) ), + TQT_SLOT( slotSaveError( ResourceCalendar *, const TQString & ) ) ); } ResourceCalendar *CalendarResources::resource( Incidence *incidence ) @@ -662,7 +662,7 @@ void CalendarResources::resourceDeleted( ResourceCalendar *resource ) emit signalResourceDeleted( resource ); } -void CalendarResources::doSetTimeZoneId( const QString &timeZoneId ) +void CalendarResources::doSetTimeZoneId( const TQString &timeZoneId ) { // set the timezone for all resources. Otherwise we'll have those terrible // tz troubles ;-(( @@ -672,7 +672,7 @@ void CalendarResources::doSetTimeZoneId( const QString &timeZoneId ) } } -void CalendarResources::setTimeZoneIdViewOnly( const QString &timeZoneId ) +void CalendarResources::setTimeZoneIdViewOnly( const TQString &timeZoneId ) { reload( timeZoneId ); } @@ -798,12 +798,12 @@ int CalendarResources::decrementChangeCount( ResourceCalendar *r ) return count; } -void CalendarResources::slotLoadError( ResourceCalendar *, const QString &err ) +void CalendarResources::slotLoadError( ResourceCalendar *, const TQString &err ) { emit signalErrorMessage( err ); } -void CalendarResources::slotSaveError( ResourceCalendar *, const QString &err ) +void CalendarResources::slotSaveError( ResourceCalendar *, const TQString &err ) { emit signalErrorMessage( err ); } diff --git a/libkcal/calendarresources.h b/libkcal/calendarresources.h index a9e0fa808..ad6ace739 100644 --- a/libkcal/calendarresources.h +++ b/libkcal/calendarresources.h @@ -29,8 +29,8 @@ #ifndef KCAL_CALENDARRESOURCES_H #define KCAL_CALENDARRESOURCES_H -#include -#include +#include +#include #include "calendar.h" #include "resourcecalendar.h" @@ -74,12 +74,12 @@ class LIBKCAL_EXPORT CalendarResources : { public: DestinationPolicy( CalendarResourceManager *manager, - QWidget *parent = 0 ) : + TQWidget *parent = 0 ) : mManager( manager ), mParent( parent ) {} virtual ResourceCalendar *destination( Incidence *incidence ) = 0; - virtual QWidget *parent() { return mParent; } - virtual void setParent( QWidget *newparent ) { mParent = newparent; } + virtual TQWidget *parent() { return mParent; } + virtual void setParent( TQWidget *newparent ) { mParent = newparent; } protected: CalendarResourceManager *resourceManager() @@ -87,7 +87,7 @@ class LIBKCAL_EXPORT CalendarResources : private: CalendarResourceManager *mManager; - QWidget *mParent; + TQWidget *mParent; }; /** @@ -97,7 +97,7 @@ class LIBKCAL_EXPORT CalendarResources : { public: StandardDestinationPolicy( CalendarResourceManager *manager, - QWidget *parent = 0 ) : + TQWidget *parent = 0 ) : DestinationPolicy( manager, parent ) {} ResourceCalendar *destination( Incidence *incidence ); @@ -114,7 +114,7 @@ class LIBKCAL_EXPORT CalendarResources : { public: AskDestinationPolicy( CalendarResourceManager *manager, - QWidget *parent = 0 ) : + TQWidget *parent = 0 ) : DestinationPolicy( manager, parent ) {} ResourceCalendar *destination( Incidence *incidence ); @@ -157,11 +157,11 @@ class LIBKCAL_EXPORT CalendarResources : Do Not pass an empty timeZoneId string as this may cause unintended consequences when storing Incidences into the Calendar. - @param family is any QString representing a unique name. + @param family is any TQString representing a unique name. */ CalendarResources( - const QString &timeZoneId, - const QString &family = QString::fromLatin1( "calendar" ) ); + const TQString &timeZoneId, + const TQString &family = TQString::fromLatin1( "calendar" ) ); /** Destructor @@ -180,7 +180,7 @@ class LIBKCAL_EXPORT CalendarResources : * @par tz The timezone to set. * @return success or failure */ - bool reload( const QString &tz ); + bool reload( const TQString &tz ); /** Clear out the current Calendar, freeing all used memory etc. @@ -262,14 +262,14 @@ class LIBKCAL_EXPORT CalendarResources : Afterwards we need to reset it (to avoid pointers to widgets that are already deleted) so we also need the accessor */ - QWidget *dialogParentWidget(); + TQWidget *dialogParentWidget(); /** Set the widget parent for new dialogs. This is a bad hack, but we need to properly set the parent for the resource selection dialog. Otherwise the dialog will not be modal to the editor dialog in korganizer and the user can still work in the editor dialog (and thus crash korganizer). */ - void setDialogParentWidget( QWidget *parent ); + void setDialogParentWidget( TQWidget *parent ); /** Request ticket for saving the Calendar. If a ticket is returned the @@ -390,12 +390,12 @@ class LIBKCAL_EXPORT CalendarResources : Return an unfiltered list of all Events which occur on the given timestamp. - @param qdt request unfiltered Event list for this QDateTime only. + @param qdt request unfiltered Event list for this TQDateTime only. @return the list of unfiltered Events occurring on the specified timestamp. */ - Event::List rawEventsForDate( const QDateTime &qdt ); + Event::List rawEventsForDate( const TQDateTime &qdt ); /** Return an unfiltered list of all Events occurring within a date range. @@ -408,7 +408,7 @@ class LIBKCAL_EXPORT CalendarResources : @return the list of unfiltered Events occurring within the specified date range. */ - Event::List rawEvents( const QDate &start, const QDate &end, + Event::List rawEvents( const TQDate &start, const TQDate &end, bool inclusive = false ); /** @@ -416,14 +416,14 @@ class LIBKCAL_EXPORT CalendarResources : date. The Events are sorted according to @a sortField and @a sortDirection. - @param date request unfiltered Event list for this QDate only. + @param date request unfiltered Event list for this TQDate only. @param sortField specifies the EventSortField. @param sortDirection specifies the SortDirection. @return the list of sorted, unfiltered Events occurring on @a date. */ Event::List rawEventsForDate( - const QDate &date, + const TQDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ); @@ -435,7 +435,7 @@ class LIBKCAL_EXPORT CalendarResources : @return a pointer to the Event. A null pointer is returned if no such Event exists. */ - Event *event( const QString &uid ); + Event *event( const TQString &uid ); // Todo Specific Methods // @@ -491,11 +491,11 @@ class LIBKCAL_EXPORT CalendarResources : Return an unfiltered list of all Todos which are due on the specified date. - @param date request unfiltered Todos due on this QDate. + @param date request unfiltered Todos due on this TQDate. @return the list of unfiltered Todos due on the specified date. */ - Todo::List rawTodosForDate( const QDate &date ); + Todo::List rawTodosForDate( const TQDate &date ); /** Returns the Todo associated with the given unique identifier. @@ -505,7 +505,7 @@ class LIBKCAL_EXPORT CalendarResources : @return a pointer to the Todo. A null pointer is returned if no such Todo exists. */ - Todo *todo( const QString &uid ); + Todo *todo( const TQString &uid ); // Journal Specific Methods // @@ -561,11 +561,11 @@ class LIBKCAL_EXPORT CalendarResources : /** Return an unfiltered list of all Journals for on the specifed date. - @param date request unfiltered Journals for this QDate only. + @param date request unfiltered Journals for this TQDate only. @return the list of unfiltered Journals for the specified date. */ - Journal::List rawJournalsForDate( const QDate &date ); + Journal::List rawJournalsForDate( const TQDate &date ); /** Returns the Journal associated with the given unique identifier. @@ -575,7 +575,7 @@ class LIBKCAL_EXPORT CalendarResources : @return a pointer to the Journal. A null pointer is returned if no such Journal exists. */ - Journal *journal( const QString &uid ); + Journal *journal( const TQString &uid ); // Alarm Specific Methods // @@ -587,16 +587,16 @@ class LIBKCAL_EXPORT CalendarResources : @return the list of Alarms for the for the specified time range. */ - Alarm::List alarms( const QDateTime &from, const QDateTime &to ); + Alarm::List alarms( const TQDateTime &from, const TQDateTime &to ); /** Return a list of Alarms that occur before the specified timestamp. @param to is the ending timestamp. - @return the list of Alarms occurring before the specified QDateTime. + @return the list of Alarms occurring before the specified TQDateTime. */ - Alarm::List alarmsTo( const QDateTime &to ); + Alarm::List alarmsTo( const TQDateTime &to ); /** * Set the viewing time zone, which requires that all resources are saved, @@ -605,7 +605,7 @@ class LIBKCAL_EXPORT CalendarResources : * If you want to change the times of the contents of the resources, use * setTimeZoneId */ - void setTimeZoneIdViewOnly( const QString& tz ); + void setTimeZoneIdViewOnly( const TQString& tz ); signals: /** @@ -626,7 +626,7 @@ class LIBKCAL_EXPORT CalendarResources : /** Signal an error message. */ - void signalErrorMessage( const QString &err ); + void signalErrorMessage( const TQString &err ); protected: void connectResource( ResourceCalendar *resource ); @@ -645,7 +645,7 @@ class LIBKCAL_EXPORT CalendarResources : Do Not pass an empty timeZoneId string as this may cause unintended consequences when storing Incidences into the Calendar. */ - virtual void doSetTimeZoneId( const QString &timeZoneId ); + virtual void doSetTimeZoneId( const TQString &timeZoneId ); /** Increment the number of times this Resource has been changed by 1. @@ -666,26 +666,26 @@ class LIBKCAL_EXPORT CalendarResources : int decrementChangeCount( ResourceCalendar *resource ); protected slots: - void slotLoadError( ResourceCalendar *resource, const QString &err ); - void slotSaveError( ResourceCalendar *resource, const QString &err ); + void slotLoadError( ResourceCalendar *resource, const TQString &err ); + void slotSaveError( ResourceCalendar *resource, const TQString &err ); private: /** Initialize the Resource object with starting values. */ - void init( const QString &family ); + void init( const TQString &family ); bool mOpen; KRES::Manager* mManager; - QMap mResourceMap; + TQMap mResourceMap; DestinationPolicy *mDestinationPolicy; StandardDestinationPolicy *mStandardPolicy; AskDestinationPolicy *mAskPolicy; - QMap mTickets; - QMap mChangeCounts; + TQMap mTickets; + TQMap mChangeCounts; class Private; Private *d; diff --git a/libkcal/calfilter.cpp b/libkcal/calfilter.cpp index c1b66f094..898ec79cf 100644 --- a/libkcal/calfilter.cpp +++ b/libkcal/calfilter.cpp @@ -34,7 +34,7 @@ CalFilter::CalFilter() mCompletedTimeSpan = 0; } -CalFilter::CalFilter(const QString &name) +CalFilter::CalFilter(const TQString &name) { mName = name; mEnabled = true; @@ -108,14 +108,14 @@ bool CalFilter::filterIncidence(Incidence *incidence) const if ( (mCriteria & HideCompleted) && todo->isCompleted() ) { // Check if completion date is suffently long ago: if ( todo->completed().addDays( mCompletedTimeSpan ) < - QDateTime::currentDateTime() ) { + TQDateTime::currentDateTime() ) { return false; } } if( ( mCriteria & HideInactiveTodos ) && ( todo->hasStartDate() && - QDateTime::currentDateTime() < todo->dtStart() || + TQDateTime::currentDateTime() < todo->dtStart() || todo->isCompleted() ) ) return false; @@ -145,10 +145,10 @@ bool CalFilter::filterIncidence(Incidence *incidence) const } if (mCriteria & ShowCategories) { - for (QStringList::ConstIterator it = mCategoryList.constBegin(); + for (TQStringList::ConstIterator it = mCategoryList.constBegin(); it != mCategoryList.constEnd(); ++it ) { - QStringList incidenceCategories = incidence->categories(); - for (QStringList::ConstIterator it2 = incidenceCategories.constBegin(); + TQStringList incidenceCategories = incidence->categories(); + for (TQStringList::ConstIterator it2 = incidenceCategories.constBegin(); it2 != incidenceCategories.constEnd(); ++it2 ) { if ((*it) == (*it2)) { return true; @@ -157,10 +157,10 @@ bool CalFilter::filterIncidence(Incidence *incidence) const } return false; } else { - for (QStringList::ConstIterator it = mCategoryList.constBegin(); + for (TQStringList::ConstIterator it = mCategoryList.constBegin(); it != mCategoryList.constEnd(); ++it ) { - QStringList incidenceCategories = incidence->categories(); - for (QStringList::ConstIterator it2 = incidenceCategories.constBegin(); + TQStringList incidenceCategories = incidence->categories(); + for (TQStringList::ConstIterator it2 = incidenceCategories.constBegin(); it2 != incidenceCategories.constEnd(); ++it2 ) { if ((*it) == (*it2)) { return false; @@ -195,22 +195,22 @@ int CalFilter::criteria() const return mCriteria; } -void CalFilter::setCategoryList(const QStringList &categoryList) +void CalFilter::setCategoryList(const TQStringList &categoryList) { mCategoryList = categoryList; } -QStringList CalFilter::categoryList() const +TQStringList CalFilter::categoryList() const { return mCategoryList; } -void CalFilter::setEmailList(const QStringList &emailList) +void CalFilter::setEmailList(const TQStringList &emailList) { mEmailList = emailList; } -QStringList CalFilter::emailList() const +TQStringList CalFilter::emailList() const { return mEmailList; } diff --git a/libkcal/calfilter.h b/libkcal/calfilter.h index fb34454e6..80c0b2aff 100644 --- a/libkcal/calfilter.h +++ b/libkcal/calfilter.h @@ -22,8 +22,8 @@ #ifndef KCAL_CALFILTER_H #define KCAL_CALFILTER_H -#include -#include +#include +#include #include "event.h" #include "todo.h" @@ -41,18 +41,18 @@ class LIBKCAL_EXPORT CalFilter /** Construct filter. */ CalFilter(); /** Construct filter with name */ - CalFilter( const QString &name ); + CalFilter( const TQString &name ); /** Destruct filter. */ ~CalFilter(); /** Set name of filter. */ - void setName( const QString &name ) { mName = name; } + void setName( const TQString &name ) { mName = name; } /** Return name of filter. */ - QString name() const { return mName; } + TQString name() const { return mName; } /** Apply filter to eventlist, all events not matching filter criterias are @@ -93,26 +93,26 @@ class LIBKCAL_EXPORT CalFilter events. See related functions. */ - void setCategoryList( const QStringList & ); + void setCategoryList( const TQStringList & ); /** Return category list, used for showing/hiding categories of events. See related functions. */ - QStringList categoryList() const; + TQStringList categoryList() const; /** Set list of email addresses which are to be considered when finding incidences which the current user is not a participant of. This is normally the list used by KOPrefs::thatIsMe() as well. */ - void setEmailList( const QStringList & ); + void setEmailList( const TQStringList & ); /** Return list of email addresses which are to be considered when finding incidences which the current user is not a participant of. This is normally the list used by KOPrefs::thatIsMe() as well. See related functions. */ - QStringList emailList() const; + TQStringList emailList() const; enum { HideRecurring = 1, HideCompleted = 2, ShowCategories = 4, HideInactiveTodos = 8, HideTodosWithoutAttendeeInEmailList = 16 }; @@ -139,14 +139,14 @@ class LIBKCAL_EXPORT CalFilter int completedTimeSpan() const; private: - QString mName; + TQString mName; int mCriteria; bool mEnabled; - QStringList mCategoryList; - QStringList mEmailList; + TQStringList mCategoryList; + TQStringList mEmailList; int mCompletedTimeSpan; class Private; diff --git a/libkcal/calformat.cpp b/libkcal/calformat.cpp index 642eefeba..6ec0260cd 100644 --- a/libkcal/calformat.cpp +++ b/libkcal/calformat.cpp @@ -27,8 +27,8 @@ using namespace KCal; -QString CalFormat::mApplication = QString::fromLatin1("libkcal"); -QString CalFormat::mProductId = QString::fromLatin1("-//K Desktop Environment//NONSGML libkcal 3.5//EN"); +TQString CalFormat::mApplication = TQString::fromLatin1("libkcal"); +TQString CalFormat::mProductId = TQString::fromLatin1("-//K Desktop Environment//NONSGML libkcal 3.5//EN"); CalFormat::CalFormat() @@ -58,18 +58,18 @@ ErrorFormat *CalFormat::exception() return mException; } -void CalFormat::setApplication(const QString& application, const QString& productID) +void CalFormat::setApplication(const TQString& application, const TQString& productID) { mApplication = application; mProductId = productID; } -QString CalFormat::createUniqueId() +TQString CalFormat::createUniqueId() { - int hashTime = QTime::currentTime().hour() + - QTime::currentTime().minute() + QTime::currentTime().second() + - QTime::currentTime().msec(); - QString uidStr = QString("%1-%2.%3") + int hashTime = TQTime::currentTime().hour() + + TQTime::currentTime().minute() + TQTime::currentTime().second() + + TQTime::currentTime().msec(); + TQString uidStr = TQString("%1-%2.%3") .arg(mApplication) .arg(KApplication::random()) .arg(hashTime); diff --git a/libkcal/calformat.h b/libkcal/calformat.h index 80c36a1fa..59c585538 100644 --- a/libkcal/calformat.h +++ b/libkcal/calformat.h @@ -21,9 +21,9 @@ #ifndef KCAL_CALFORMAT_H #define KCAL_CALFORMAT_H -#include -#include -#include +#include +#include +#include #include "exceptions.h" #include "event.h" @@ -53,21 +53,21 @@ class LIBKCAL_EXPORT CalFormat Returns TRUE if successful,else returns FALSE. @param fileName the name of the calendar on disk. */ - virtual bool load(Calendar *, const QString &fileName) = 0; + virtual bool load(Calendar *, const TQString &fileName) = 0; /** writes out the calendar to disk. Returns true if * successful and false on error. * @param fileName the name of the file */ - virtual bool save(Calendar *, const QString &fileName) = 0; + virtual bool save(Calendar *, const TQString &fileName) = 0; /** Parse string and populate calendar with that information. */ - virtual bool fromString(Calendar *, const QString & ) = 0; + virtual bool fromString(Calendar *, const TQString & ) = 0; /** Return calendar information as string. */ - virtual QString toString(Calendar *) = 0; + virtual TQString toString(Calendar *) = 0; /** Clear exception status of this format object */ void clearException(); @@ -80,16 +80,16 @@ class LIBKCAL_EXPORT CalFormat /** Set the application name for use in unique IDs and error messages, * and product ID for incidence PRODID property */ - static void setApplication(const QString& app, const QString& productID); + static void setApplication(const TQString& app, const TQString& productID); /** Return the application name used in unique IDs and error messages */ - static const QString& application() { return mApplication; } + static const TQString& application() { return mApplication; } /** Return the PRODID string to write into calendar files */ - static const QString& productId() { return mProductId; } + static const TQString& productId() { return mProductId; } /** Return the PRODID string loaded from calendar file */ - const QString &loadedProductId() { return mLoadedProductId; } + const TQString &loadedProductId() { return mLoadedProductId; } /** Create a unique id string. */ - static QString createUniqueId(); + static TQString createUniqueId(); /** Set exception for this object. This is used by the functions of this @@ -98,13 +98,13 @@ class LIBKCAL_EXPORT CalFormat void setException(ErrorFormat *error); protected: - QString mLoadedProductId; // PRODID string loaded from calendar file + TQString mLoadedProductId; // PRODID string loaded from calendar file private: ErrorFormat *mException; - static QString mApplication; // name of application for unique ID strings - static QString mProductId; // PRODID string to write to calendar files + static TQString mApplication; // name of application for unique ID strings + static TQString mProductId; // PRODID string to write to calendar files class Private; Private *d; diff --git a/libkcal/compat.cpp b/libkcal/compat.cpp index a0de0d35a..8268f9785 100644 --- a/libkcal/compat.cpp +++ b/libkcal/compat.cpp @@ -24,13 +24,13 @@ #include -#include +#include #include "incidence.h" using namespace KCal; -Compat *CompatFactory::createCompat( const QString &productId ) +Compat *CompatFactory::createCompat( const TQString &productId ) { // kdDebug(5800) << "CompatFactory::createCompat(): '" << productId << "'" // << endl; @@ -45,9 +45,9 @@ Compat *CompatFactory::createCompat( const QString &productId ) if ( korg >= 0 ) { int versionStart = productId.find( " ", korg ); if ( versionStart >= 0 ) { - int versionStop = productId.find( QRegExp( "[ /]" ), versionStart + 1 ); + int versionStop = productId.find( TQRegExp( "[ /]" ), versionStart + 1 ); if ( versionStop >= 0 ) { - QString version = productId.mid( versionStart + 1, + TQString version = productId.mid( versionStart + 1, versionStop - versionStart - 1 ); // kdDebug(5800) << "Found KOrganizer version: " << version << endl; @@ -55,7 +55,7 @@ Compat *CompatFactory::createCompat( const QString &productId ) version.section( ".", 1, 1 ).toInt() * 100 + version.section( ".", 2, 2 ).toInt(); int releaseStop = productId.find( "/", versionStop ); - QString release; + TQString release; if ( releaseStop > versionStop ) { release = productId.mid( versionStop+1, releaseStop-versionStop-1 ); } @@ -95,9 +95,9 @@ void Compat::fixEmptySummary( Incidence *incidence ) // line, move it) if (incidence->summary().isEmpty() && !(incidence->description().isEmpty())) { - QString oldDescription = incidence->description().stripWhiteSpace(); - QString newSummary( oldDescription ); - newSummary.remove( QRegExp("\n.*") ); + TQString oldDescription = incidence->description().stripWhiteSpace(); + TQString newSummary( oldDescription ); + newSummary.remove( TQRegExp("\n.*") ); incidence->setSummary( newSummary ); if ( oldDescription == newSummary ) incidence->setDescription(""); @@ -119,7 +119,7 @@ void CompatPre35::fixRecurrence( Incidence *incidence ) { Recurrence* recurrence = incidence->recurrence(); if (recurrence ) { - QDateTime start( incidence->dtStart() ); + TQDateTime start( incidence->dtStart() ); // kde < 3.5 only had one rrule, so no need to loop over all RRULEs. RecurrenceRule *r = recurrence->defaultRRule(); if ( r && !r->dateMatchesRules( start ) ) { @@ -164,7 +164,7 @@ void CompatPre32::fixRecurrence( Incidence *incidence ) However, as all other applications also got this wrong, we'll just leave it as it is and use the wrong interpretation (was also discussed on ietf-calsify)*/ -void CompatPre31::fixFloatingEnd( QDate &endDate ) +void CompatPre31::fixFloatingEnd( TQDate &endDate ) { endDate = endDate.addDays( 1 ); } @@ -184,7 +184,7 @@ void CompatPre31::fixRecurrence( Incidence *incidence ) // with week start always on a Monday. // Convert this to the number of occurrences. r->setDuration( -1 ); - QDate end( r->startDt().date() ); + TQDate end( r->startDt().date() ); bool doNothing = false; // # of periods: int tmp = ( duration - 1 ) * r->frequency(); @@ -204,7 +204,7 @@ void CompatPre31::fixRecurrence( Incidence *incidence ) break; } if ( !doNothing ) { - duration = r->durationTo( QDateTime( end, QTime( 0, 0, 0 ) ) ); + duration = r->durationTo( TQDateTime( end, TQTime( 0, 0, 0 ) ) ); r->setDuration( duration ); } } @@ -212,11 +212,11 @@ void CompatPre31::fixRecurrence( Incidence *incidence ) /* addYearlyNum */ // Dates were stored as day numbers, with a fiddle to take account of leap years. // Convert the day number to a month. - QValueList days = r->byYearDays(); + TQValueList days = r->byYearDays(); if ( !days.isEmpty() ) { - QValueList months = r->byMonths(); - for ( QValueListConstIterator it = days.begin(); it != days.end(); ++it ) { - int newmonth = QDate( r->startDt().date().year(), 1, 1).addDays( (*it) - 1 ).month(); + TQValueList months = r->byMonths(); + for ( TQValueListConstIterator it = days.begin(); it != days.end(); ++it ) { + int newmonth = TQDate( r->startDt().date().year(), 1, 1).addDays( (*it) - 1 ).month(); if ( !months.contains( newmonth ) ) months.append( newmonth ); } diff --git a/libkcal/compat.h b/libkcal/compat.h index dd2d9907f..70931ff53 100644 --- a/libkcal/compat.h +++ b/libkcal/compat.h @@ -22,8 +22,8 @@ #ifndef KCAL_COMPAT_H #define KCAL_COMPAT_H -#include -#include +#include +#include namespace KCal { @@ -36,7 +36,7 @@ class Compat; class CompatFactory { public: - static Compat *createCompat( const QString &productId ); + static Compat *createCompat( const TQString &productId ); }; /** @@ -51,7 +51,7 @@ class Compat virtual void fixRecurrence( Incidence * ); virtual void fixEmptySummary( Incidence * ); virtual void fixAlarms( Incidence * ) {} - virtual void fixFloatingEnd( QDate & ) {} + virtual void fixFloatingEnd( TQDate & ) {} virtual bool useTimeZoneShift() { return true; } virtual int fixPriority( int prio ) { return prio; } @@ -91,7 +91,7 @@ class CompatPre32 : public CompatPre34 class CompatPre31 : public CompatPre32 { public: - virtual void fixFloatingEnd( QDate & ); + virtual void fixFloatingEnd( TQDate & ); virtual void fixRecurrence( Incidence *incidence ); private: diff --git a/libkcal/confirmsavedialog.cpp b/libkcal/confirmsavedialog.cpp index ce2bb0f40..9b7f4d31d 100644 --- a/libkcal/confirmsavedialog.cpp +++ b/libkcal/confirmsavedialog.cpp @@ -23,22 +23,22 @@ #include #include -#include -#include -#include +#include +#include +#include using namespace KCal; -ConfirmSaveDialog::ConfirmSaveDialog( const QString &destination, - QWidget *parent, const char *name ) +ConfirmSaveDialog::ConfirmSaveDialog( const TQString &destination, + TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n("Confirm Save"), Ok | Cancel ) { - QFrame *topFrame = makeMainWidget(); + TQFrame *topFrame = makeMainWidget(); - QBoxLayout *topLayout = new QVBoxLayout( topFrame ); + TQBoxLayout *topLayout = new TQVBoxLayout( topFrame ); topLayout->setSpacing( spacingHint() ); - QLabel *label = new QLabel( + TQLabel *label = new TQLabel( i18n("You have requested to save the following objects to '%1':") .arg( destination ), topFrame ); topLayout->addWidget( label ); @@ -52,7 +52,7 @@ ConfirmSaveDialog::ConfirmSaveDialog( const QString &destination, } void ConfirmSaveDialog::addIncidences( const Incidence::List &incidences, - const QString &operation ) + const TQString &operation ) { Incidence::List::ConstIterator it; for( it = incidences.begin(); it != incidences.end(); ++it ) { diff --git a/libkcal/confirmsavedialog.h b/libkcal/confirmsavedialog.h index 7d36ec671..c20a4951b 100644 --- a/libkcal/confirmsavedialog.h +++ b/libkcal/confirmsavedialog.h @@ -32,11 +32,11 @@ namespace KCal { class KDE_EXPORT ConfirmSaveDialog : public KDialogBase { public: - ConfirmSaveDialog( const QString &destination, QWidget *parent, + ConfirmSaveDialog( const TQString &destination, TQWidget *parent, const char *name = 0 ); void addIncidences( const Incidence::List &incidences, - const QString &operation ); + const TQString &operation ); private: KListView *mListView; diff --git a/libkcal/convertqtopia.cpp b/libkcal/convertqtopia.cpp index dd6824b39..be02fd66f 100644 --- a/libkcal/convertqtopia.cpp +++ b/libkcal/convertqtopia.cpp @@ -84,9 +84,9 @@ int main(int argc,char **argv) KCmdLineArgs::usage( i18n("Error: No input file.") ); } - QString inputFile = args->arg( 0 ); + TQString inputFile = args->arg( 0 ); - QString outputFile; + TQString outputFile; if ( args->isSet("output") ) outputFile = args->getOption( "output" ); kdDebug(5800) << "Input File: '" << inputFile << "'" << endl; @@ -100,7 +100,7 @@ int main(int argc,char **argv) ICalFormat icalendarFormat; if ( outputFile.isEmpty() ) { - QString out = icalendarFormat.toString( &cal ); + TQString out = icalendarFormat.toString( &cal ); std::cout << out.local8Bit() << std::endl; } else { bool success = icalendarFormat.save( &cal, outputFile ); diff --git a/libkcal/customproperties.cpp b/libkcal/customproperties.cpp index b64d9fee4..2d59fe912 100644 --- a/libkcal/customproperties.cpp +++ b/libkcal/customproperties.cpp @@ -41,9 +41,9 @@ CustomProperties::~CustomProperties() bool CustomProperties::operator==( const CustomProperties &other ) const { if ( mProperties.count() != other.mProperties.count() ) return false; - QMap::ConstIterator it; + TQMap::ConstIterator it; for( it = mProperties.begin(); it != mProperties.end(); ++it ) { - QMap::ConstIterator itOther = + TQMap::ConstIterator itOther = other.mProperties.find( it.key() ); if ( itOther == other.mProperties.end() ) { @@ -55,29 +55,29 @@ bool CustomProperties::operator==( const CustomProperties &other ) const return true; } -void CustomProperties::setCustomProperty(const QCString &app, const QCString &key, - const QString &value) +void CustomProperties::setCustomProperty(const TQCString &app, const TQCString &key, + const TQString &value) { if (value.isNull() || key.isEmpty() || app.isEmpty()) return; - QCString property = "X-KDE-" + app + "-" + key; + TQCString property = "X-KDE-" + app + "-" + key; if (!checkName(property)) return; mProperties[property] = value; customPropertyUpdated(); } -void CustomProperties::removeCustomProperty(const QCString &app, const QCString &key) +void CustomProperties::removeCustomProperty(const TQCString &app, const TQCString &key) { - removeNonKDECustomProperty(QCString("X-KDE-" + app + "-" + key)); + removeNonKDECustomProperty(TQCString("X-KDE-" + app + "-" + key)); } -QString CustomProperties::customProperty(const QCString &app, const QCString &key) const +TQString CustomProperties::customProperty(const TQCString &app, const TQCString &key) const { - return nonKDECustomProperty(QCString("X-KDE-" + app + "-" + key)); + return nonKDECustomProperty(TQCString("X-KDE-" + app + "-" + key)); } -void CustomProperties::setNonKDECustomProperty(const QCString &name, const QString &value) +void CustomProperties::setNonKDECustomProperty(const TQCString &name, const TQString &value) { if (value.isNull() || !checkName(name)) return; @@ -85,30 +85,30 @@ void CustomProperties::setNonKDECustomProperty(const QCString &name, const QStri customPropertyUpdated(); } -void CustomProperties::removeNonKDECustomProperty(const QCString &name) +void CustomProperties::removeNonKDECustomProperty(const TQCString &name) { - QMap::Iterator it = mProperties.find(name); + TQMap::Iterator it = mProperties.find(name); if (it != mProperties.end()) { mProperties.remove(it); customPropertyUpdated(); } } -QString CustomProperties::nonKDECustomProperty(const QCString &name) const +TQString CustomProperties::nonKDECustomProperty(const TQCString &name) const { - QMap::ConstIterator it = mProperties.find(name); + TQMap::ConstIterator it = mProperties.find(name); if (it == mProperties.end()) - return QString::null; + return TQString::null; return it.data(); } -void CustomProperties::setCustomProperties(const QMap &properties) +void CustomProperties::setCustomProperties(const TQMap &properties) { bool changed = false; - for (QMap::ConstIterator it = properties.begin(); it != properties.end(); ++it) { + for (TQMap::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(); + mProperties[it.key()] = it.data().isNull() ? TQString("") : it.data(); changed = true; } } @@ -116,12 +116,12 @@ void CustomProperties::setCustomProperties(const QMap &proper customPropertyUpdated(); } -QMap CustomProperties::customProperties() const +TQMap CustomProperties::customProperties() const { return mProperties; } -bool CustomProperties::checkName(const QCString &name) +bool CustomProperties::checkName(const TQCString &name) { // Check that the property name starts with 'X-' and contains // only the permitted characters diff --git a/libkcal/customproperties.h b/libkcal/customproperties.h index 5cafff2eb..46814ca05 100644 --- a/libkcal/customproperties.h +++ b/libkcal/customproperties.h @@ -22,8 +22,8 @@ #ifndef KCAL_CUSTOMPROPERTIES_H #define KCAL_CUSTOMPROPERTIES_H -#include -#include +#include +#include #include #include "libkcal_export.h" @@ -56,60 +56,60 @@ class LIBKCAL_EXPORT CustomProperties @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 + @param value The property's value. A call with a value of TQString::null will be ignored. */ - void setCustomProperty( const QCString &app, const QCString &key, - const QString &value ); + void setCustomProperty( const TQCString &app, const TQCString &key, + const TQString &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 TQCString &app, const TQCString &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 + @return Property value, or TQString::null if (and only if) the property does not exist. */ - QString customProperty( const QCString &app, const QCString &key ) const; + TQString customProperty( const TQCString &app, const TQCString &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 + @param value The property's value. A call with a value of TQString::null will be ignored. */ - void setNonKDECustomProperty( const QCString &name, const QString &value ); + void setNonKDECustomProperty( const TQCString &name, const TQString &value ); /** Delete a non-KDE or non-standard custom calendar property. @param name Full property name */ - void removeNonKDECustomProperty( const QCString &name ); + void removeNonKDECustomProperty( const TQCString &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 + @return Property value, or TQString::null if (and only if) the property does not exist. */ - QString nonKDECustomProperty( const QCString& name ) const; + TQString nonKDECustomProperty( const TQCString& name ) const; /** Initialise the alarm's custom calendar properties to the specified key/value pairs. */ - void setCustomProperties( const QMap &properties ); + void setCustomProperties( const TQMap &properties ); /** Return all custom calendar property key/value pairs. */ - QMap customProperties() const; + TQMap customProperties() const; protected: /** @@ -120,9 +120,9 @@ class LIBKCAL_EXPORT CustomProperties virtual void customPropertyUpdated() {} private: - static bool checkName(const QCString& name); + static bool checkName(const TQCString& name); - QMap mProperties; // custom calendar properties + TQMap mProperties; // custom calendar properties class Private; Private *d; diff --git a/libkcal/dndfactory.cpp b/libkcal/dndfactory.cpp index 273c305b6..9f5292d1d 100644 --- a/libkcal/dndfactory.cpp +++ b/libkcal/dndfactory.cpp @@ -21,8 +21,8 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -45,7 +45,7 @@ DndFactory::DndFactory( Calendar *cal ) : { } -ICalDrag *DndFactory::createDrag( Incidence *incidence, QWidget *owner ) +ICalDrag *DndFactory::createDrag( Incidence *incidence, TQWidget *owner ) { CalendarLocal cal( mCalendar->timeZoneId() ); Incidence *i = incidence->clone(); @@ -60,7 +60,7 @@ ICalDrag *DndFactory::createDrag( Incidence *incidence, QWidget *owner ) return icd; } -Event *DndFactory::createDrop(QDropEvent *de) +Event *DndFactory::createDrop(TQDropEvent *de) { kdDebug(5800) << "DndFactory::createDrop()" << endl; @@ -79,7 +79,7 @@ Event *DndFactory::createDrop(QDropEvent *de) return 0; } -Todo *DndFactory::createDropTodo(QDropEvent *de) +Todo *DndFactory::createDropTodo(TQDropEvent *de) { kdDebug(5800) << "VCalFormat::createDropTodo()" << endl; @@ -110,7 +110,7 @@ bool DndFactory::copyIncidence( Incidence *selectedInc ) { if ( !selectedInc ) return false; - QClipboard *cb = QApplication::clipboard(); + QClipboard *cb = TQApplication::clipboard(); CalendarLocal cal( mCalendar->timeZoneId() ); Incidence *inc = selectedInc->clone(); @@ -120,13 +120,13 @@ bool DndFactory::copyIncidence( Incidence *selectedInc ) return true; } -Incidence *DndFactory::pasteIncidence(const QDate &newDate, const QTime *newTime) +Incidence *DndFactory::pasteIncidence(const TQDate &newDate, const TQTime *newTime) { // kdDebug(5800) << "DnDFactory::pasteEvent()" << endl; CalendarLocal cal( mCalendar->timeZoneId() ); - QClipboard *cb = QApplication::clipboard(); + QClipboard *cb = TQApplication::clipboard(); if ( !ICalDrag::decode( cb->data(), &cal ) && !VCalDrag::decode( cb->data(), &cal ) ) { @@ -149,31 +149,31 @@ Incidence *DndFactory::pasteIncidence(const QDate &newDate, const QTime *newTime int daysOffset = anEvent->dtStart().date().daysTo( anEvent->dtEnd().date() ); // new end date if event starts at the same time on the new day - QDateTime endDate( newDate.addDays(daysOffset), anEvent->dtEnd().time() ); + TQDateTime endDate( newDate.addDays(daysOffset), anEvent->dtEnd().time() ); if ( newTime ) { // additional offset for new time of day int addSecsOffset( anEvent->dtStart().time().secsTo( *newTime )); endDate=endDate.addSecs( addSecsOffset ); - anEvent->setDtStart( QDateTime( newDate, *newTime ) ); + anEvent->setDtStart( TQDateTime( newDate, *newTime ) ); } else { - anEvent->setDtStart( QDateTime( newDate, anEvent->dtStart().time() ) ); + anEvent->setDtStart( TQDateTime( newDate, anEvent->dtStart().time() ) ); } anEvent->setDtEnd( endDate ); } else if ( inc->type() == "Todo" ) { Todo *anTodo = static_cast( inc ); if ( newTime ) { - anTodo->setDtDue( QDateTime( newDate, *newTime ) ); + anTodo->setDtDue( TQDateTime( newDate, *newTime ) ); } else { - anTodo->setDtDue( QDateTime( newDate, anTodo->dtDue().time() ) ); + anTodo->setDtDue( TQDateTime( newDate, anTodo->dtDue().time() ) ); } } else if ( inc->type() == "Journal" ) { Journal *anJournal = static_cast( inc ); if ( newTime ) { - anJournal->setDtStart( QDateTime( newDate, *newTime ) ); + anJournal->setDtStart( TQDateTime( newDate, *newTime ) ); } else { - anJournal->setDtStart( QDateTime( newDate ) ); + anJournal->setDtStart( TQDateTime( newDate ) ); } } else { kdDebug(5850) << "Trying to paste unknown incidence of type " << inc->type() << endl; diff --git a/libkcal/dndfactory.h b/libkcal/dndfactory.h index c9e744ef2..441a0a405 100644 --- a/libkcal/dndfactory.h +++ b/libkcal/dndfactory.h @@ -47,19 +47,19 @@ class LIBKCAL_EXPORT DndFactory /** Create a drag object. */ - ICalDrag *createDrag( Incidence *incidence, QWidget *owner ); + ICalDrag *createDrag( Incidence *incidence, TQWidget *owner ); /** Create Todo object from drop event */ - Todo *createDropTodo(QDropEvent *de); + Todo *createDropTodo(TQDropEvent *de); /** Create Event object from drop event */ - Event *createDrop(QDropEvent *de); + Event *createDrop(TQDropEvent *de); /** cut incidence to clipboard */ void cutIncidence( Incidence * ); /** copy the incidence to clipboard */ bool copyIncidence( Incidence * ); /** pastes the event or todo and returns a pointer to the new incidence pasted. */ - Incidence *pasteIncidence( const QDate &, const QTime *newTime = 0 ); + Incidence *pasteIncidence( const TQDate &, const TQTime *newTime = 0 ); private: Calendar *mCalendar; diff --git a/libkcal/dummyscheduler.cpp b/libkcal/dummyscheduler.cpp index eeeb73d79..7a824f08a 100644 --- a/libkcal/dummyscheduler.cpp +++ b/libkcal/dummyscheduler.cpp @@ -23,8 +23,8 @@ // DummyScheduler - iMIP implementation of iTIP methods // -#include -#include +#include +#include #include #include @@ -45,33 +45,33 @@ DummyScheduler::~DummyScheduler() { } -bool DummyScheduler::publish (IncidenceBase *incidence,const QString &/*recipients*/) +bool DummyScheduler::publish (IncidenceBase *incidence,const TQString &/*recipients*/) { - QString messageText = mFormat->createScheduleMessage(incidence, + TQString messageText = mFormat->createScheduleMessage(incidence, Scheduler::Publish); return saveMessage(messageText); } -bool DummyScheduler::performTransaction(IncidenceBase *incidence,Method method,const QString &/*recipients*/) +bool DummyScheduler::performTransaction(IncidenceBase *incidence,Method method,const TQString &/*recipients*/) { - QString messageText = mFormat->createScheduleMessage(incidence,method); + TQString messageText = mFormat->createScheduleMessage(incidence,method); return saveMessage(messageText); } bool DummyScheduler::performTransaction(IncidenceBase *incidence,Method method) { - QString messageText = mFormat->createScheduleMessage(incidence,method); + TQString messageText = mFormat->createScheduleMessage(incidence,method); return saveMessage(messageText); } -bool DummyScheduler::saveMessage(const QString &message) +bool DummyScheduler::saveMessage(const TQString &message) { - QFile f("dummyscheduler.store"); + TQFile f("dummyscheduler.store"); if (f.open(IO_WriteOnly | IO_Append)) { - QTextStream t(&f); + TQTextStream t(&f); t << message << endl; f.close(); return true; @@ -80,18 +80,18 @@ bool DummyScheduler::saveMessage(const QString &message) } } -QPtrList DummyScheduler::retrieveTransactions() +TQPtrList DummyScheduler::retrieveTransactions() { - QPtrList messageList; + TQPtrList messageList; - QFile f("dummyscheduler.store"); + TQFile f("dummyscheduler.store"); if (!f.open(IO_ReadOnly)) { kdDebug(5800) << "DummyScheduler::retrieveTransactions(): Can't open file" << endl; } else { - QTextStream t(&f); - QString messageString; - QString messageLine = t.readLine(); + TQTextStream t(&f); + TQString messageString; + TQString messageLine = t.readLine(); while (!messageLine.isNull()) { // kdDebug(5800) << "++++++++" << messageLine << endl; messageString += messageLine + "\n"; @@ -103,7 +103,7 @@ QPtrList DummyScheduler::retrieveTransactions() if (message) { messageList.append(message); } else { - QString errorMessage; + TQString errorMessage; if (mFormat->exception()) { errorMessage = mFormat->exception()->message(); } @@ -120,8 +120,8 @@ QPtrList DummyScheduler::retrieveTransactions() return messageList; } -QString DummyScheduler::freeBusyDir() +TQString DummyScheduler::freeBusyDir() { // the dummy scheduler should never handle freebusy stuff - so it's hardcoded - return QString(""); + return TQString(""); } diff --git a/libkcal/dummyscheduler.h b/libkcal/dummyscheduler.h index 93ca7e65c..8563eb7b3 100644 --- a/libkcal/dummyscheduler.h +++ b/libkcal/dummyscheduler.h @@ -37,15 +37,15 @@ class DummyScheduler : public Scheduler DummyScheduler(Calendar *); virtual ~DummyScheduler(); - bool publish (IncidenceBase *incidence,const QString &recipients); + bool publish (IncidenceBase *incidence,const TQString &recipients); bool performTransaction(IncidenceBase *incidence,Method method); - bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients); - QPtrList retrieveTransactions(); + bool performTransaction(IncidenceBase *incidence,Method method,const TQString &recipients); + TQPtrList retrieveTransactions(); - virtual QString freeBusyDir(); + virtual TQString freeBusyDir(); protected: - bool saveMessage(const QString &); + bool saveMessage(const TQString &); private: class Private; diff --git a/libkcal/duration.cpp b/libkcal/duration.cpp index 01ee7562a..0dfd8781c 100644 --- a/libkcal/duration.cpp +++ b/libkcal/duration.cpp @@ -31,7 +31,7 @@ Duration::Duration() mSeconds = 0; } -Duration::Duration( const QDateTime &start, const QDateTime &end ) +Duration::Duration( const TQDateTime &start, const TQDateTime &end ) { mSeconds = start.secsTo( end ); } @@ -49,7 +49,7 @@ bool KCal::operator==( const Duration& d1, const Duration& d2 ) -QDateTime Duration::end( const QDateTime &start ) const +TQDateTime Duration::end( const TQDateTime &start ) const { return start.addSecs( mSeconds ); } diff --git a/libkcal/duration.h b/libkcal/duration.h index 69c939789..b4655d6c0 100644 --- a/libkcal/duration.h +++ b/libkcal/duration.h @@ -21,7 +21,7 @@ #ifndef KCAL_DURATION_H #define KCAL_DURATION_H -#include +#include #include "libkcal_export.h" @@ -34,10 +34,10 @@ class LIBKCAL_EXPORT Duration { public: Duration(); - Duration( const QDateTime &start, const QDateTime &end ); + Duration( const TQDateTime &start, const TQDateTime &end ); Duration( int seconds ); - QDateTime end( const QDateTime &start ) const; + TQDateTime end( const TQDateTime &start ) const; int asSeconds() const; diff --git a/libkcal/event.cpp b/libkcal/event.cpp index 077a43318..0f286e7f6 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp @@ -70,7 +70,7 @@ bool Event::operator==( const Event& e2 ) const -void Event::setDtEnd(const QDateTime &dtEnd) +void Event::setDtEnd(const TQDateTime &dtEnd) { if (mReadOnly) return; @@ -82,7 +82,7 @@ void Event::setDtEnd(const QDateTime &dtEnd) updated(); } -QDateTime Event::dtEnd() const +TQDateTime Event::dtEnd() const { if (hasEndDate()) return mDtEnd; if (hasDuration()) return dtStart().addSecs(duration()); @@ -92,23 +92,23 @@ QDateTime Event::dtEnd() const return dtStart(); } -QDate Event::dateEnd() const +TQDate Event::dateEnd() const { if ( doesFloat() ) return dtEnd().date(); else return dtEnd().addSecs(-1).date(); } -QString Event::dtEndTimeStr() const +TQString Event::dtEndTimeStr() const { return KGlobal::locale()->formatTime(dtEnd().time()); } -QString Event::dtEndDateStr(bool shortfmt) const +TQString Event::dtEndDateStr(bool shortfmt) const { return KGlobal::locale()->formatDate(dtEnd().date(),shortfmt); } -QString Event::dtEndStr() const +TQString Event::dtEndStr() const { return KGlobal::locale()->formatDateTime(dtEnd()); } @@ -126,8 +126,8 @@ bool Event::hasEndDate() const bool Event::isMultiDay() const { // End date is non inclusive, so subtract 1 second... - QDateTime start( dtStart() ); - QDateTime end( dtEnd() ); + TQDateTime start( dtStart() ); + TQDateTime end( dtEnd() ); if ( ! doesFloat() ) { end = end.addSecs(-1); } diff --git a/libkcal/event.h b/libkcal/event.h index 334c10392..39980556c 100644 --- a/libkcal/event.h +++ b/libkcal/event.h @@ -48,7 +48,7 @@ class LIBKCAL_EXPORT Event : public Incidence Event& operator=( const Event &e ); bool operator==( const Event & ) const; - QCString type() const { return "Event"; } + TQCString type() const { return "Event"; } /** Return copy of this Event. The caller owns the returned objet. @@ -58,22 +58,22 @@ class LIBKCAL_EXPORT Event : public Incidence /** Set end date and time. */ - void setDtEnd(const QDateTime &dtEnd); + void setDtEnd(const TQDateTime &dtEnd); /** Return end date and time. */ - virtual QDateTime dtEnd() const; + virtual TQDateTime dtEnd() const; /** Returns the day when the event ends. This might be different from dtEnd().date, since the end date/time is non-inclusive. So timed events ending at 0:00 have their end date on the day before. */ - QDate dateEnd() const; + TQDate dateEnd() const; /** Return end time as string formatted according to the users locale settings. */ - QString dtEndTimeStr() const; + TQString dtEndTimeStr() const; /** Return end date as string formatted according to the users locale settings. @@ -81,12 +81,12 @@ class LIBKCAL_EXPORT Event : public Incidence @param shortfmt if true return string in short format, if false return long format */ - QString dtEndDateStr( bool shortfmt = true ) const; + TQString dtEndDateStr( bool shortfmt = true ) const; /** Return end date and time as string formatted according to the users locale settings. */ - QString dtEndStr() const; + TQString dtEndStr() const; /** Set whether the event has an end date/time. @@ -118,11 +118,11 @@ class LIBKCAL_EXPORT Event : public Incidence protected: /** Return the end date/time of the base incidence. */ - virtual QDateTime endDateRecurrenceBase() const { return dtEnd(); } + virtual TQDateTime endDateRecurrenceBase() const { return dtEnd(); } private: bool accept( Visitor &v ) { return v.visit( this ); } - QDateTime mDtEnd; + TQDateTime mDtEnd; bool mHasEndDate; Transparency mTransparency; diff --git a/libkcal/exceptions.cpp b/libkcal/exceptions.cpp index 677ec418a..98d7153eb 100644 --- a/libkcal/exceptions.cpp +++ b/libkcal/exceptions.cpp @@ -26,7 +26,7 @@ using namespace KCal; -Exception::Exception(const QString &message) +Exception::Exception(const TQString &message) { mMessage = message; } @@ -35,22 +35,22 @@ Exception::~Exception() { } -QString Exception::message() +TQString Exception::message() { if (mMessage.isEmpty()) return i18n("%1 Error").arg(CalFormat::application()); else return mMessage; } -ErrorFormat::ErrorFormat(ErrorCodeFormat code,const QString &message) : +ErrorFormat::ErrorFormat(ErrorCodeFormat code,const TQString &message) : Exception(message) { mCode = code; } -QString ErrorFormat::message() +TQString ErrorFormat::message() { - QString message = ""; + TQString message = ""; switch (mCode) { case LoadError: diff --git a/libkcal/exceptions.h b/libkcal/exceptions.h index b86f513a6..1ae90d516 100644 --- a/libkcal/exceptions.h +++ b/libkcal/exceptions.h @@ -28,7 +28,7 @@ // returned by an error function, but we can build upon them, if we start // to use C++ exceptions. -#include +#include namespace KCal { @@ -42,16 +42,16 @@ class Exception /** Construct exception with descriptive message \a message. */ - Exception( const QString &message = QString::null ); + Exception( const TQString &message = TQString::null ); virtual ~Exception(); /** Return descriptive message of exception. */ - virtual QString message(); + virtual TQString message(); protected: - QString mMessage; + TQString mMessage; private: class Private; @@ -74,12 +74,12 @@ class ErrorFormat : public Exception /** Create format error exception. */ - ErrorFormat( ErrorCodeFormat code, const QString &message = QString::null ); + ErrorFormat( ErrorCodeFormat code, const TQString &message = TQString::null ); /** Return format error message. */ - QString message(); + TQString message(); /** Return format error code. */ diff --git a/libkcal/filestorage.cpp b/libkcal/filestorage.cpp index 5419a2541..51f4d80c9 100644 --- a/libkcal/filestorage.cpp +++ b/libkcal/filestorage.cpp @@ -21,9 +21,9 @@ #include -#include -#include -#include +#include +#include +#include #include @@ -36,7 +36,7 @@ using namespace KCal; -FileStorage::FileStorage( Calendar *cal, const QString &fileName, +FileStorage::FileStorage( Calendar *cal, const TQString &fileName, CalFormat *format ) : CalStorage( cal ), mFileName( fileName ), @@ -49,12 +49,12 @@ FileStorage::~FileStorage() delete mSaveFormat; } -void FileStorage::setFileName( const QString &fileName ) +void FileStorage::setFileName( const TQString &fileName ) { mFileName = fileName; } -QString FileStorage::fileName()const +TQString FileStorage::fileName()const { return mFileName; } diff --git a/libkcal/filestorage.h b/libkcal/filestorage.h index c4fc73917..1d12cc4e0 100644 --- a/libkcal/filestorage.h +++ b/libkcal/filestorage.h @@ -32,12 +32,12 @@ class CalFormat; class LIBKCAL_EXPORT FileStorage : public CalStorage { public: - FileStorage( Calendar *, const QString &fileName = QString::null, + FileStorage( Calendar *, const TQString &fileName = TQString::null, CalFormat *format = 0 ); virtual ~FileStorage(); - void setFileName( const QString &mFileName ); - QString fileName() const; + void setFileName( const TQString &mFileName ); + TQString fileName() const; /** FileStorage takes ownership of format object. @@ -51,7 +51,7 @@ class LIBKCAL_EXPORT FileStorage : public CalStorage bool close(); private: - QString mFileName; + TQString mFileName; CalFormat *mSaveFormat; class Private; diff --git a/libkcal/freebusy.cpp b/libkcal/freebusy.cpp index 71f05b35b..75d0e7db4 100644 --- a/libkcal/freebusy.cpp +++ b/libkcal/freebusy.cpp @@ -30,13 +30,13 @@ FreeBusy::FreeBusy() { } -FreeBusy::FreeBusy(const QDateTime &start, const QDateTime &end) +FreeBusy::FreeBusy(const TQDateTime &start, const TQDateTime &end) { setDtStart(start); setDtEnd(end); } -FreeBusy::FreeBusy( Calendar *calendar, const QDateTime &start, const QDateTime &end ) +FreeBusy::FreeBusy( Calendar *calendar, const TQDateTime &start, const TQDateTime &end ) { kdDebug(5800) << "FreeBusy::FreeBusy" << endl; mCalendar = calendar; @@ -49,9 +49,9 @@ FreeBusy::FreeBusy( Calendar *calendar, const QDateTime &start, const QDateTime int extraDays, i, x, duration; duration = start.daysTo(end); - QDate day; - QDateTime tmpStart; - QDateTime tmpEnd; + TQDate day; + TQDateTime tmpStart; + TQDateTime tmpEnd; // Loops through every event in the calendar Event::List::ConstIterator it; for( it = eventList.begin(); it != eventList.end(); ++it ) { @@ -68,8 +68,8 @@ FreeBusy::FreeBusy( Calendar *calendar, const QDateTime &start, const QDateTime floatingEvent = new Event( *event ); // Set the start and end times to be on midnight - QDateTime start( floatingEvent->dtStart().date(), QTime( 0, 0 ) ); - QDateTime end( floatingEvent->dtEnd().date(), QTime( 23, 59, 59, 999 ) ); + TQDateTime start( floatingEvent->dtStart().date(), TQTime( 0, 0 ) ); + TQDateTime end( floatingEvent->dtEnd().date(), TQTime( 23, 59, 59, 999 ) ); floatingEvent->setFloats( false ); floatingEvent->setDtStart( start ); floatingEvent->setDtEnd( end ); @@ -134,13 +134,13 @@ FreeBusy::~FreeBusy() { } -bool FreeBusy::setDtEnd( const QDateTime &end ) +bool FreeBusy::setDtEnd( const TQDateTime &end ) { mDtEnd = end; return true; } -QDateTime FreeBusy::dtEnd() const +TQDateTime FreeBusy::dtEnd() const { return mDtEnd; } @@ -150,9 +150,9 @@ PeriodList FreeBusy::busyPeriods() const return mBusyPeriods; } -bool FreeBusy::addLocalPeriod(const QDateTime &eventStart, const QDateTime &eventEnd ) { - QDateTime tmpStart; - QDateTime tmpEnd; +bool FreeBusy::addLocalPeriod(const TQDateTime &eventStart, const TQDateTime &eventEnd ) { + TQDateTime tmpStart; + TQDateTime tmpEnd; //Check to see if the start *or* end of the event is //between the start and end of the freebusy dates. @@ -197,13 +197,13 @@ void FreeBusy::addPeriods(const PeriodList &list ) sortList(); } -void FreeBusy::addPeriod(const QDateTime &start, const QDateTime &end) +void FreeBusy::addPeriod(const TQDateTime &start, const TQDateTime &end) { mBusyPeriods.append( Period(start, end) ); sortList(); } -void FreeBusy::addPeriod( const QDateTime &start, const Duration &dur ) +void FreeBusy::addPeriod( const TQDateTime &start, const Duration &dur ) { mBusyPeriods.append( Period(start, dur) ); sortList(); @@ -217,8 +217,8 @@ void FreeBusy::merge( FreeBusy *freeBusy ) if ( freeBusy->dtEnd() > dtEnd() ) setDtEnd( freeBusy->dtEnd() ); - QValueList periods = freeBusy->busyPeriods(); - QValueList::ConstIterator it; + TQValueList periods = freeBusy->busyPeriods(); + TQValueList::ConstIterator it; for ( it = periods.begin(); it != periods.end(); ++it ) addPeriod( (*it).start(), (*it).end() ); } diff --git a/libkcal/freebusy.h b/libkcal/freebusy.h index 0ba1e2cd5..d87234f30 100644 --- a/libkcal/freebusy.h +++ b/libkcal/freebusy.h @@ -22,9 +22,9 @@ #ifndef KCAL_FREEBUSY_H #define KCAL_FREEBUSY_H -#include -#include -#include +#include +#include +#include #include "period.h" #include "calendar.h" @@ -33,7 +33,7 @@ namespace KCal { - typedef QValueList PeriodList; + typedef TQValueList PeriodList; /** This class provides information about free/busy time of a calendar user. */ @@ -41,23 +41,23 @@ class LIBKCAL_EXPORT FreeBusy : public IncidenceBase { public: FreeBusy(); - FreeBusy( const QDateTime &start, const QDateTime &end ); - FreeBusy( Calendar *calendar, const QDateTime &start, - const QDateTime &end ); + FreeBusy( const TQDateTime &start, const TQDateTime &end ); + FreeBusy( Calendar *calendar, const TQDateTime &start, + const TQDateTime &end ); FreeBusy( PeriodList busyPeriods ); ~FreeBusy(); - QCString type() const { return "FreeBusy"; } + TQCString type() const { return "FreeBusy"; } - virtual QDateTime dtEnd() const; - bool setDtEnd( const QDateTime &end ); + virtual TQDateTime dtEnd() const; + bool setDtEnd( const TQDateTime &end ); PeriodList busyPeriods() const; /** Adds a period to the freebusy list and sorts the list. */ - void addPeriod( const QDateTime &start, const QDateTime &end ); - void addPeriod( const QDateTime &start, const Duration &dur ); + void addPeriod( const TQDateTime &start, const TQDateTime &end ); + void addPeriod( const TQDateTime &start, const Duration &dur ); /** Adds a list of periods to the freebusy object and then sorts * that list. Use this if you are adding many items, instead of the * addPeriod method, to avoid sorting repeatedly. */ @@ -69,9 +69,9 @@ class LIBKCAL_EXPORT FreeBusy : public IncidenceBase private: bool accept( Visitor &v ) { return v.visit( this ); } //This is used for creating a freebusy object for the current user - bool addLocalPeriod( const QDateTime &start, const QDateTime &end ); + bool addLocalPeriod( const TQDateTime &start, const TQDateTime &end ); - QDateTime mDtEnd; + TQDateTime mDtEnd; PeriodList mBusyPeriods; Calendar *mCalendar; diff --git a/libkcal/freebusycache.h b/libkcal/freebusycache.h index 180c4e4a1..8e925ac18 100644 --- a/libkcal/freebusycache.h +++ b/libkcal/freebusycache.h @@ -21,7 +21,7 @@ #ifndef KCAL_FREEBUSYCACHE_H #define KCAL_FREEBUSYCACHE_H -#include +#include namespace KCal { @@ -34,12 +34,12 @@ class FreeBusyCache Save freebusy information belonging to an email. */ virtual bool saveFreeBusy( FreeBusy *freebusy, const Person &person ) = 0; -// virtual bool saveFreeBusy( FreeBusy *, const QString &email ) = 0; +// virtual bool saveFreeBusy( FreeBusy *, const TQString &email ) = 0; /** Load freebusy information belonging to an email. */ - virtual FreeBusy *loadFreeBusy( const QString &email ) = 0; + virtual FreeBusy *loadFreeBusy( const TQString &email ) = 0; }; } diff --git a/libkcal/freebusyurlstore.cpp b/libkcal/freebusyurlstore.cpp index d8f71ea43..2e913d56f 100644 --- a/libkcal/freebusyurlstore.cpp +++ b/libkcal/freebusyurlstore.cpp @@ -41,7 +41,7 @@ FreeBusyUrlStore *FreeBusyUrlStore::self() FreeBusyUrlStore::FreeBusyUrlStore() { - QString configFile = locateLocal( "data", "korganizer/freebusyurls" ); + TQString configFile = locateLocal( "data", "korganizer/freebusyurls" ); mConfig = new KConfig( configFile ); } @@ -50,14 +50,14 @@ FreeBusyUrlStore::~FreeBusyUrlStore() delete mConfig; } -void FreeBusyUrlStore::writeUrl( const QString &email, const QString &url ) +void FreeBusyUrlStore::writeUrl( const TQString &email, const TQString &url ) { mConfig->setGroup( email ); mConfig->writeEntry( "url", url ); } -QString FreeBusyUrlStore::readUrl( const QString &email ) +TQString FreeBusyUrlStore::readUrl( const TQString &email ) { mConfig->setGroup( email ); diff --git a/libkcal/freebusyurlstore.h b/libkcal/freebusyurlstore.h index 28355782b..6beb4d03a 100644 --- a/libkcal/freebusyurlstore.h +++ b/libkcal/freebusyurlstore.h @@ -21,7 +21,7 @@ #ifndef KCAL_FREEBUSYURLSTORE_H #define KCAL_FREEBUSYURLSTORE_H -#include +#include #include "libkcal_export.h" @@ -35,9 +35,9 @@ class LIBKCAL_EXPORT FreeBusyUrlStore static FreeBusyUrlStore *self(); ~FreeBusyUrlStore(); - void writeUrl( const QString &email, const QString &url ); + void writeUrl( const TQString &email, const TQString &url ); - QString readUrl( const QString &email ); + TQString readUrl( const TQString &email ); void sync(); diff --git a/libkcal/htmlexport.cpp b/libkcal/htmlexport.cpp index 8d1570159..fd994fca2 100644 --- a/libkcal/htmlexport.cpp +++ b/libkcal/htmlexport.cpp @@ -20,11 +20,11 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -49,29 +49,29 @@ HtmlExport::HtmlExport( Calendar *calendar, HTMLExportSettings *settings ) : { } -bool HtmlExport::save( const QString &fileName ) +bool HtmlExport::save( const TQString &fileName ) { - QString fn( fileName ); + TQString fn( fileName ); if ( fn.isEmpty() && mSettings ) { fn = mSettings->outputFile(); } if ( !mSettings || fn.isEmpty() ) { return false; } - QFile f( fileName ); + TQFile f( fileName ); if ( !f.open(IO_WriteOnly)) { return false; } - QTextStream ts(&f); + TQTextStream ts(&f); bool success = save(&ts); f.close(); return success; } -bool HtmlExport::save(QTextStream *ts) +bool HtmlExport::save(TQTextStream *ts) { if ( !mSettings ) return false; - ts->setEncoding( QTextStream::UnicodeUTF8 ); + ts->setEncoding( TQTextStream::UnicodeUTF8 ); // Write HTML header *ts << "" << QString::number(start.day()); + *ts << ">" << TQString::number(start.day()); if (mHolidayMap.contains(start)) { *ts << " " << mHolidayMap[start] << ""; @@ -216,7 +216,7 @@ void HtmlExport::createMonthView(QTextStream *ts) } } -void HtmlExport::createEventList (QTextStream *ts) +void HtmlExport::createEventList (TQTextStream *ts) { int columns = 3; *ts << "\n"; @@ -239,7 +239,7 @@ void HtmlExport::createEventList (QTextStream *ts) *ts << " \n"; - for ( QDate dt = fromDate(); dt <= toDate(); dt = dt.addDays(1) ) { + for ( TQDate dt = fromDate(); dt <= toDate(); dt = dt.addDays(1) ) { kdDebug(5850) << "Getting events for " << dt.toString() << endl; Event::List events = mCalendar->events(dt, EventSortStartDate, @@ -250,7 +250,7 @@ void HtmlExport::createEventList (QTextStream *ts) for( it = events.begin(); it != events.end(); ++it ) { if ( checkSecrecy( *it ) ) { if ( first ) { - *ts << " \n"; @@ -265,8 +265,8 @@ void HtmlExport::createEventList (QTextStream *ts) *ts << "
" << KGlobal::locale()->formatDate(dt) << "
\n"; } -void HtmlExport::createEvent (QTextStream *ts, Event *event, - QDate date,bool withDescription) +void HtmlExport::createEvent (TQTextStream *ts, Event *event, + TQDate date,bool withDescription) { kdDebug(5850) << "HtmlExport::createEvent(): " << event->summary() << endl; *ts << " \n"; @@ -314,7 +314,7 @@ void HtmlExport::createEvent (QTextStream *ts, Event *event, *ts << " \n"; } -void HtmlExport::createTodoList ( QTextStream *ts ) +void HtmlExport::createTodoList ( TQTextStream *ts ) { Todo::List rawTodoList = mCalendar->todos(); @@ -386,7 +386,7 @@ void HtmlExport::createTodoList ( QTextStream *ts ) // Generate sub-task list of event ev *ts << " \n"; *ts << " uid() << "\">" << i18n("Sub-Tasks of: ") << "uid() << "\">" << cleanChars( (*it)->summary()) @@ -419,7 +419,7 @@ void HtmlExport::createTodoList ( QTextStream *ts ) *ts << "\n"; } -void HtmlExport::createTodo (QTextStream *ts,Todo *todo) +void HtmlExport::createTodo (TQTextStream *ts,Todo *todo) { kdDebug(5850) << "HtmlExport::createTodo()" << endl; @@ -493,18 +493,18 @@ void HtmlExport::createTodo (QTextStream *ts,Todo *todo) *ts << "\n"; } -void HtmlExport::createWeekView( QTextStream */*ts*/ ) +void HtmlExport::createWeekView( TQTextStream */*ts*/ ) { // FIXME: Implement this! } -void HtmlExport::createJournalView( QTextStream */*ts*/ ) +void HtmlExport::createJournalView( TQTextStream */*ts*/ ) { // Journal::List rawJournalList = mCalendar->journals(); // FIXME: Implement this! } -void HtmlExport::createFreeBusyView( QTextStream */*ts*/ ) +void HtmlExport::createFreeBusyView( TQTextStream */*ts*/ ) { // FIXME: Implement this! } @@ -525,7 +525,7 @@ bool HtmlExport::checkSecrecy( Incidence *incidence ) return false; } -void HtmlExport::formatLocation (QTextStream *ts,Incidence *event) +void HtmlExport::formatLocation (TQTextStream *ts,Incidence *event) { if (!event->location().isEmpty()) { *ts << " " << cleanChars(event->location()) << "\n"; @@ -534,7 +534,7 @@ void HtmlExport::formatLocation (QTextStream *ts,Incidence *event) } } -void HtmlExport::formatCategories (QTextStream *ts,Incidence *event) +void HtmlExport::formatCategories (TQTextStream *ts,Incidence *event) { if (!event->categoriesStr().isEmpty()) { *ts << " " << cleanChars(event->categoriesStr()) << "\n"; @@ -543,7 +543,7 @@ void HtmlExport::formatCategories (QTextStream *ts,Incidence *event) } } -void HtmlExport::formatAttendees( QTextStream *ts, Incidence *event ) +void HtmlExport::formatAttendees( TQTextStream *ts, Incidence *event ) { Attendee::List attendees = event->attendees(); if (attendees.count()) { @@ -579,16 +579,16 @@ void HtmlExport::formatAttendees( QTextStream *ts, Incidence *event ) } } -QString HtmlExport::breakString(const QString &text) +TQString HtmlExport::breakString(const TQString &text) { int number = text.contains("\n"); if(number < 0) { return text; } else { - QString out; - QString tmpText = text; + TQString out; + TQString tmpText = text; int pos = 0; - QString tmp; + TQString tmp; for(int i=0;i<=number;i++) { pos = tmpText.find("\n"); tmp = tmpText.left(pos); @@ -599,15 +599,15 @@ QString HtmlExport::breakString(const QString &text) } } -void HtmlExport::createFooter( QTextStream *ts ) +void HtmlExport::createFooter( TQTextStream *ts ) { // FIXME: Implement this in a translatable way! - QString trailer = i18n("This page was created "); + TQString trailer = i18n("This page was created "); /* bool hasPerson = false; bool hasCredit = false; bool hasCreditURL = false; - QString mail, name, credit, creditURL;*/ + TQString mail, name, credit, creditURL;*/ if (!mSettings->eMail().isEmpty()) { if (!mSettings->name().isEmpty()) trailer += i18n("by %2 ").arg( mSettings->eMail() ).arg( mSettings->name() ); @@ -629,43 +629,43 @@ void HtmlExport::createFooter( QTextStream *ts ) } -QString HtmlExport::cleanChars(const QString &text) +TQString HtmlExport::cleanChars(const TQString &text) { - QString txt = text; + TQString txt = text; txt = txt.replace( "&", "&" ); txt = txt.replace( "<", "<" ); txt = txt.replace( ">", ">" ); txt = txt.replace( "\"", """ ); - txt = txt.replace( QString::fromUtf8("ä"), "ä" ); - txt = txt.replace( QString::fromUtf8("á"), "á" ); - txt = txt.replace( QString::fromUtf8("à"), "à" ); - txt = txt.replace( QString::fromUtf8("â"), "â" ); - txt = txt.replace( QString::fromUtf8("Ä"), "Ä" ); - txt = txt.replace( QString::fromUtf8("ó"), "ó" ); - txt = txt.replace( QString::fromUtf8("ô"), "ô" ); - txt = txt.replace( QString::fromUtf8("ö"), "ö" ); - txt = txt.replace( QString::fromUtf8("Ö"), "Ö" ); - txt = txt.replace( QString::fromUtf8("ü"), "ü" ); - txt = txt.replace( QString::fromUtf8("Ãœ"), "Ü" ); - txt = txt.replace( QString::fromUtf8("ß"), "ß" ); - txt = txt.replace( QString::fromUtf8("€"), "€" ); - txt = txt.replace( QString::fromUtf8("é"), "é" ); - txt = txt.replace( QString::fromUtf8("ë"), "ë" ); - txt = txt.replace( QString::fromUtf8("è"), "è" ); - txt = txt.replace( QString::fromUtf8("ñ"), "ñ" ); - txt = txt.replace( QString::fromUtf8("ç"), "ç" ); + txt = txt.replace( TQString::fromUtf8("ä"), "ä" ); + txt = txt.replace( TQString::fromUtf8("á"), "á" ); + txt = txt.replace( TQString::fromUtf8("à"), "à" ); + txt = txt.replace( TQString::fromUtf8("â"), "â" ); + txt = txt.replace( TQString::fromUtf8("Ä"), "Ä" ); + txt = txt.replace( TQString::fromUtf8("ó"), "ó" ); + txt = txt.replace( TQString::fromUtf8("ô"), "ô" ); + txt = txt.replace( TQString::fromUtf8("ö"), "ö" ); + txt = txt.replace( TQString::fromUtf8("Ö"), "Ö" ); + txt = txt.replace( TQString::fromUtf8("ü"), "ü" ); + txt = txt.replace( TQString::fromUtf8("Ãœ"), "Ü" ); + txt = txt.replace( TQString::fromUtf8("ß"), "ß" ); + txt = txt.replace( TQString::fromUtf8("€"), "€" ); + txt = txt.replace( TQString::fromUtf8("é"), "é" ); + txt = txt.replace( TQString::fromUtf8("ë"), "ë" ); + txt = txt.replace( TQString::fromUtf8("è"), "è" ); + txt = txt.replace( TQString::fromUtf8("ñ"), "ñ" ); + txt = txt.replace( TQString::fromUtf8("ç"), "ç" ); return txt; } -QString HtmlExport::styleSheet() const +TQString HtmlExport::styleSheet() const { if ( !mSettings->styleSheet().isEmpty() ) return mSettings->styleSheet(); - QString css; + TQString css; - if ( QApplication::reverseLayout() ) { + if ( TQApplication::reverseLayout() ) { css += " body { background-color:white; color:black; direction: rtl }\n"; css += " td { text-align:center; background-color:#eee }\n"; css += " th { text-align:center; background-color:#228; color:white }\n"; @@ -693,7 +693,7 @@ QString HtmlExport::styleSheet() const } -void HtmlExport::addHoliday( const QDate &date, const QString &name) +void HtmlExport::addHoliday( const TQDate &date, const TQString &name) { if ( mHolidayMap[date].isEmpty() ) { mHolidayMap[date] = name; @@ -702,12 +702,12 @@ void HtmlExport::addHoliday( const QDate &date, const QString &name) } } -QDate HtmlExport::fromDate() const +TQDate HtmlExport::fromDate() const { return mSettings->dateStart().date(); } -QDate HtmlExport::toDate() const +TQDate HtmlExport::toDate() const { return mSettings->dateEnd().date(); } diff --git a/libkcal/htmlexport.h b/libkcal/htmlexport.h index c1642590d..b411778df 100644 --- a/libkcal/htmlexport.h +++ b/libkcal/htmlexport.h @@ -22,9 +22,9 @@ #ifndef KCAL_HTMLEXPORT_H #define KCAL_HTMLEXPORT_H -#include -#include -#include +#include +#include +#include #include #include @@ -51,46 +51,46 @@ class KDE_EXPORT HtmlExport /** Writes out the calendar in HTML format. */ - bool save( const QString &fileName = QString::null ); + bool save( const TQString &fileName = TQString::null ); /** Writes out calendar to text stream. */ - bool save( QTextStream * ); + bool save( TQTextStream * ); - void addHoliday( const QDate &date, const QString &name ); + void addHoliday( const TQDate &date, const TQString &name ); protected: - void createWeekView( QTextStream *ts ); - void createMonthView( QTextStream *ts ); - void createEventList( QTextStream *ts ); - void createTodoList( QTextStream *ts ); - void createJournalView( QTextStream *ts ); - void createFreeBusyView( QTextStream *ts ); - - void createTodo( QTextStream *ts, Todo *todo); - void createEvent( QTextStream *ts, Event *event, QDate date, + void createWeekView( TQTextStream *ts ); + void createMonthView( TQTextStream *ts ); + void createEventList( TQTextStream *ts ); + void createTodoList( TQTextStream *ts ); + void createJournalView( TQTextStream *ts ); + void createFreeBusyView( TQTextStream *ts ); + + void createTodo( TQTextStream *ts, Todo *todo); + void createEvent( TQTextStream *ts, Event *event, TQDate date, bool withDescription = true); - void createFooter( QTextStream *ts ); + void createFooter( TQTextStream *ts ); bool checkSecrecy( Incidence * ); - void formatLocation( QTextStream *ts, Incidence *event ); - void formatCategories( QTextStream *ts, Incidence *event ); - void formatAttendees( QTextStream *ts, Incidence *event ); + void formatLocation( TQTextStream *ts, Incidence *event ); + void formatCategories( TQTextStream *ts, Incidence *event ); + void formatAttendees( TQTextStream *ts, Incidence *event ); - QString breakString( const QString &text ); + TQString breakString( const TQString &text ); - QDate fromDate() const; - QDate toDate() const; - QString styleSheet() const; + TQDate fromDate() const; + TQDate toDate() const; + TQString styleSheet() const; private: - QString cleanChars( const QString &txt ); + TQString cleanChars( const TQString &txt ); Calendar *mCalendar; HTMLExportSettings *mSettings; - QMap mHolidayMap; + TQMap mHolidayMap; class Private; Private *d; diff --git a/libkcal/icaldrag.cpp b/libkcal/icaldrag.cpp index ad7e9549c..39315f5a6 100644 --- a/libkcal/icaldrag.cpp +++ b/libkcal/icaldrag.cpp @@ -28,27 +28,27 @@ using namespace KCal; -ICalDrag::ICalDrag( Calendar *cal, QWidget *parent, const char *name ) - : QStoredDrag( "text/calendar", parent, name ) +ICalDrag::ICalDrag( Calendar *cal, TQWidget *parent, const char *name ) + : TQStoredDrag( "text/calendar", parent, name ) { ICalFormat icf; - QString scal = icf.toString( cal ); + TQString scal = icf.toString( cal ); setEncodedData( scal.utf8() ); } -bool ICalDrag::canDecode( QMimeSource *me ) +bool ICalDrag::canDecode( TQMimeSource *me ) { return me->provides( "text/calendar" ); } -bool ICalDrag::decode( QMimeSource *de, Calendar *cal ) +bool ICalDrag::decode( TQMimeSource *de, Calendar *cal ) { bool success = false; - QByteArray payload = de->encodedData( "text/calendar" ); + TQByteArray payload = de->encodedData( "text/calendar" ); if ( payload.size() ) { - QString txt = QString::fromUtf8( payload.data() ); + TQString txt = TQString::fromUtf8( payload.data() ); ICalFormat icf; success = icf.fromString( cal, txt ); diff --git a/libkcal/icaldrag.h b/libkcal/icaldrag.h index cddc9894c..eecb03b9b 100644 --- a/libkcal/icaldrag.h +++ b/libkcal/icaldrag.h @@ -23,7 +23,7 @@ #ifndef KCAL_ICALDRAG_H #define KCAL_ICALDRAG_H -#include +#include #include "calendar.h" #include "libkcal_export.h" @@ -38,17 +38,17 @@ class LIBKCAL_EXPORT ICalDrag : public QStoredDrag /** Create a drag&drop object for iCalendar component \a ical. */ - ICalDrag( Calendar *cal, QWidget *parent = 0, const char *name = 0 ); + ICalDrag( Calendar *cal, TQWidget *parent = 0, const char *name = 0 ); ~ICalDrag() {}; /** Return, if drag&drop object can be decode to iCalendar. */ - static bool canDecode( QMimeSource * ); + static bool canDecode( TQMimeSource * ); /** Decode drag&drop object to iCalendar component \a cal. */ - static bool decode( QMimeSource *e, Calendar *cal ); + static bool decode( TQMimeSource *e, Calendar *cal ); private: class Private; diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp index f1b75c5a5..4fae0eaf2 100644 --- a/libkcal/icalformat.cpp +++ b/libkcal/icalformat.cpp @@ -19,13 +19,13 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -75,21 +75,21 @@ void ICalFormat::setImplementation( ICalFormatImpl *impl ) #undef open #endif -bool ICalFormat::load( Calendar *calendar, const QString &fileName) +bool ICalFormat::load( Calendar *calendar, const TQString &fileName) { kdDebug(5800) << "ICalFormat::load() " << fileName << endl; clearException(); - QFile file( fileName ); + TQFile file( fileName ); if (!file.open( IO_ReadOnly ) ) { kdDebug(5800) << "ICalFormat::load() load error" << endl; setException(new ErrorFormat(ErrorFormat::LoadError)); return false; } - QTextStream ts( &file ); - ts.setEncoding( QTextStream::Latin1 ); - QString text = ts.read(); + TQTextStream ts( &file ); + ts.setEncoding( TQTextStream::Latin1 ); + TQString text = ts.read(); file.close(); if ( text.stripWhiteSpace().isEmpty() ) // empty files are valid @@ -99,13 +99,13 @@ bool ICalFormat::load( Calendar *calendar, const QString &fileName) } -bool ICalFormat::save( Calendar *calendar, const QString &fileName ) +bool ICalFormat::save( Calendar *calendar, const TQString &fileName ) { kdDebug(5800) << "ICalFormat::save(): " << fileName << endl; clearException(); - QString text = toString( calendar ); + TQString text = toString( calendar ); if ( text.isNull() ) return false; @@ -122,7 +122,7 @@ bool ICalFormat::save( Calendar *calendar, const QString &fileName ) } // Convert to UTF8 and save - QCString textUtf8 = text.utf8(); + TQCString textUtf8 = text.utf8(); file.file()->writeBlock( textUtf8.data(), textUtf8.size() - 1 ); if ( !file.close() ) { @@ -135,12 +135,12 @@ bool ICalFormat::save( Calendar *calendar, const QString &fileName ) return true; } -bool ICalFormat::fromString( Calendar *cal, const QString &text ) +bool ICalFormat::fromString( Calendar *cal, const TQString &text ) { return fromRawString( cal, text.utf8() ); } -bool ICalFormat::fromRawString( Calendar *cal, const QCString &text ) +bool ICalFormat::fromRawString( Calendar *cal, const TQCString &text ) { setTimeZone( cal->timeZoneId(), !cal->isLocalTime() ); @@ -197,7 +197,7 @@ bool ICalFormat::fromRawString( Calendar *cal, const QCString &text ) return success; } -Incidence *ICalFormat::fromString( const QString &text ) +Incidence *ICalFormat::fromString( const TQString &text ) { CalendarLocal cal( mTimeZoneId ); fromString(&cal, text); @@ -221,7 +221,7 @@ Incidence *ICalFormat::fromString( const QString &text ) return ical ? ical->clone() : 0; } -QString ICalFormat::toString( Calendar *cal ) +TQString ICalFormat::toString( Calendar *cal ) { setTimeZone( cal->timeZoneId(), !cal->isLocalTime() ); @@ -259,7 +259,7 @@ QString ICalFormat::toString( Calendar *cal ) icalcomponent_add_component( calendar, component ); } - QString text = QString::fromUtf8( icalcomponent_as_ical_string( calendar ) ); + TQString text = TQString::fromUtf8( icalcomponent_as_ical_string( calendar ) ); icalcomponent_free( calendar ); icalmemory_free_ring(); @@ -267,42 +267,42 @@ QString ICalFormat::toString( Calendar *cal ) if (!text) { setException(new ErrorFormat(ErrorFormat::SaveError, i18n("libical error"))); - return QString::null; + return TQString::null; } return text; } -QString ICalFormat::toICalString( Incidence *incidence ) +TQString ICalFormat::toICalString( Incidence *incidence ) { CalendarLocal cal( mTimeZoneId ); cal.addIncidence( incidence->clone() ); return toString( &cal ); } -QString ICalFormat::toString( Incidence *incidence ) +TQString ICalFormat::toString( Incidence *incidence ) { icalcomponent *component; component = mImpl->writeIncidence( incidence ); - QString text = QString::fromUtf8( icalcomponent_as_ical_string( component ) ); + TQString text = TQString::fromUtf8( icalcomponent_as_ical_string( component ) ); icalcomponent_free( component ); return text; } -QString ICalFormat::toString( RecurrenceRule *recurrence ) +TQString ICalFormat::toString( RecurrenceRule *recurrence ) { icalproperty *property; property = icalproperty_new_rrule( mImpl->writeRecurrenceRule( recurrence ) ); - QString text = QString::fromUtf8( icalproperty_as_ical_string( property ) ); + TQString text = TQString::fromUtf8( icalproperty_as_ical_string( property ) ); icalproperty_free( property ); return text; } -bool ICalFormat::fromString( RecurrenceRule * recurrence, const QString& rrule ) +bool ICalFormat::fromString( RecurrenceRule * recurrence, const TQString& rrule ) { if ( !recurrence ) return false; bool success = true; @@ -321,7 +321,7 @@ bool ICalFormat::fromString( RecurrenceRule * recurrence, const QString& rrule ) } -QString ICalFormat::createScheduleMessage(IncidenceBase *incidence, +TQString ICalFormat::createScheduleMessage(IncidenceBase *incidence, Scheduler::Method method) { icalcomponent *message = 0; @@ -333,7 +333,7 @@ QString ICalFormat::createScheduleMessage(IncidenceBase *incidence, // We have a separation of scheduling ID and UID i = i->clone(); i->setUid( i->schedulingID() ); - i->setSchedulingID( QString::null ); + i->setSchedulingID( TQString::null ); // Build the message with the cloned incidence message = mImpl->createScheduleComponent( i, method ); @@ -347,7 +347,7 @@ QString ICalFormat::createScheduleMessage(IncidenceBase *incidence, message = mImpl->createScheduleComponent(incidence,method); // FIXME TODO: Don't we have to free message? What about the ical_string? MEMLEAK - QString messageText = QString::fromUtf8( icalcomponent_as_ical_string(message) ); + TQString messageText = TQString::fromUtf8( icalcomponent_as_ical_string(message) ); #if 0 kdDebug(5800) << "ICalFormat::createScheduleMessage: message START\n" @@ -358,7 +358,7 @@ QString ICalFormat::createScheduleMessage(IncidenceBase *incidence, return messageText; } -FreeBusy *ICalFormat::parseFreeBusy( const QString &str ) +FreeBusy *ICalFormat::parseFreeBusy( const TQString &str ) { clearException(); @@ -389,14 +389,14 @@ FreeBusy *ICalFormat::parseFreeBusy( const QString &str ) } ScheduleMessage *ICalFormat::parseScheduleMessage( Calendar *cal, - const QString &messageText ) + const TQString &messageText ) { setTimeZone( cal->timeZoneId(), !cal->isLocalTime() ); clearException(); if (messageText.isEmpty()) { - setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, QString::fromLatin1( "messageText was empty, unable to parse into a ScheduleMessage" ) ) ); + setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, TQString::fromLatin1( "messageText was empty, unable to parse into a ScheduleMessage" ) ) ); return 0; } // TODO FIXME: Don't we have to ical-free message??? MEMLEAK @@ -405,7 +405,7 @@ ScheduleMessage *ICalFormat::parseScheduleMessage( Calendar *cal, if (!message) { - setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, QString::fromLatin1( "icalparser was unable to parse messageText into a ScheduleMessage" ) ) ); + setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, TQString::fromLatin1( "icalparser was unable to parse messageText into a ScheduleMessage" ) ) ); return 0; } @@ -413,7 +413,7 @@ ScheduleMessage *ICalFormat::parseScheduleMessage( Calendar *cal, ICAL_METHOD_PROPERTY); if (!m) { - setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, QString::fromLatin1( "message didn't contain an ICAL_METHOD_PROPERTY" ) ) ); + setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, TQString::fromLatin1( "message didn't contain an ICAL_METHOD_PROPERTY" ) ) ); return 0; } @@ -451,7 +451,7 @@ ScheduleMessage *ICalFormat::parseScheduleMessage( Calendar *cal, if (!incidence) { kdDebug(5800) << "ICalFormat:parseScheduleMessage: object is not a freebusy, event, todo or journal" << endl; - setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, QString::fromLatin1( "object is not a freebusy, event, todo or journal" ) ) ); + setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, TQString::fromLatin1( "object is not a freebusy, event, todo or journal" ) ) ); return 0; } @@ -563,13 +563,13 @@ ScheduleMessage *ICalFormat::parseScheduleMessage( Calendar *cal, return new ScheduleMessage(incidence,method,status); } -void ICalFormat::setTimeZone( const QString &id, bool utc ) +void ICalFormat::setTimeZone( const TQString &id, bool utc ) { mTimeZoneId = id; mUtc = utc; } -QString ICalFormat::timeZoneId() const +TQString ICalFormat::timeZoneId() const { return mTimeZoneId; } diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h index b74600064..c35da5eb1 100644 --- a/libkcal/icalformat.h +++ b/libkcal/icalformat.h @@ -21,7 +21,7 @@ #ifndef KCAL_ICALFORMAT_H #define KCAL_ICALFORMAT_H -#include +#include #include "scheduler.h" @@ -54,7 +54,7 @@ class LIBKCAL_EXPORT ICalFormat : public CalFormat @param calendar Calendar object to be filled. @param fileName The name of the calendar file on disk. */ - bool load( Calendar * calendar, const QString &fileName ); + bool load( Calendar * calendar, const TQString &fileName ); /** Writes out the calendar to disk in iCalendar format. Returns true if successful and false on error. @@ -62,62 +62,62 @@ class LIBKCAL_EXPORT ICalFormat : public CalFormat @param calendar The Calendar object to be written. @param fileName The name of the calendar file on disk. */ - bool save( Calendar * calendar, const QString &fileName ); + bool save( Calendar * calendar, const TQString &fileName ); /** Parse string and populate calendar with that information. */ - bool fromString( Calendar * calendar, const QString & ); + bool fromString( Calendar * calendar, const TQString & ); /** Parse string and return first ical component. */ - Incidence *fromString( const QString & ); + Incidence *fromString( const TQString & ); /** Return calendar information as string. */ - QString toString( Calendar * ); + TQString toString( Calendar * ); /** Return incidence as full iCalendar formatted text. */ - QString toICalString( Incidence * ); + TQString toICalString( Incidence * ); /** Return incidence as iCalendar formatted text. */ - QString toString( Incidence * ); + TQString toString( Incidence * ); /** Return recurrence rule as iCalendar formatted text. */ - QString toString( RecurrenceRule * ); + TQString toString( RecurrenceRule * ); /** Parse string and fill recurrence object with that information */ - bool fromString ( RecurrenceRule *, const QString& ); + bool fromString ( RecurrenceRule *, const TQString& ); /** Create a scheduling message for event @p e using method @p m. */ - QString createScheduleMessage(IncidenceBase *e,Scheduler::Method m); + TQString createScheduleMessage(IncidenceBase *e,Scheduler::Method m); /** Parse scheduling message provided as string @p s. */ - ScheduleMessage *parseScheduleMessage( Calendar *, const QString &s); + ScheduleMessage *parseScheduleMessage( Calendar *, const TQString &s); /** Parse FREEBUSY object. */ - FreeBusy *parseFreeBusy( const QString & ); + FreeBusy *parseFreeBusy( const TQString & ); /** Set id of used time zone and whether this time zone is UTC or not. */ - void setTimeZone( const QString &id, bool utc ); + void setTimeZone( const TQString &id, bool utc ); /** Return id string of timezone used. */ - QString timeZoneId() const; + TQString timeZoneId() const; /** Return true if timezone used is UTC, otherwise return false. */ @@ -129,13 +129,13 @@ class LIBKCAL_EXPORT ICalFormat : public CalFormat a utf8 encoded string. This is an overload used for efficiency reading to avoid utf8 conversions, which are expensive, when reading from disk. */ - bool fromRawString( Calendar * calendar, const QCString & ); + bool fromRawString( Calendar * calendar, const TQCString & ); void setImplementation( ICalFormatImpl *impl ); private: ICalFormatImpl *mImpl; - QString mTimeZoneId; + TQString mTimeZoneId; bool mUtc; class Private; diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index d01d554e6..a52ec304c 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -20,10 +20,10 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -47,12 +47,12 @@ extern "C" { using namespace KCal; /* Static helpers */ -static QDateTime ICalDate2QDate(const icaltimetype& t) +static TQDateTime ICalDate2TQDate(const icaltimetype& t) { - // Outlook sends dates starting from 1601-01-01, but QDate() + // Outlook sends dates starting from 1601-01-01, but TQDate() // can only handle dates starting 1752-09-14. const int year = (t.year>=1754) ? t.year : 1754; - return QDateTime(QDate(year,t.month,t.day), QTime(t.hour,t.minute,t.second)); + return TQDateTime(TQDate(year,t.month,t.day), TQTime(t.hour,t.minute,t.second)); } static void _dumpIcaltime( const icaltimetype& t) @@ -108,8 +108,8 @@ icalcomponent *ICalFormatImpl::writeIncidence( IncidenceBase *incidence, Schedul icalcomponent *ICalFormatImpl::writeTodo(Todo *todo) { - QString tmpStr; - QStringList tmpStrList; + TQString tmpStr; + TQStringList tmpStrList; icalcomponent *vtodo = icalcomponent_new(ICAL_VTODO_COMPONENT); @@ -144,7 +144,7 @@ icalcomponent *ICalFormatImpl::writeTodo(Todo *todo) if (!todo->hasCompletedDate()) { // If todo was created by KOrganizer <2.2 it has no correct completion // date. Set it to now. - todo->setCompleted(QDateTime::currentDateTime()); + todo->setCompleted(TQDateTime::currentDateTime()); } icaltimetype completed = writeICalDateTime(todo->completed()); icalcomponent_add_property(vtodo,icalproperty_new_completed(completed)); @@ -168,8 +168,8 @@ icalcomponent *ICalFormatImpl::writeEvent(Event *event) << ")" << endl; #endif - QString tmpStr; - QStringList tmpStrList; + TQString tmpStr; + TQStringList tmpStrList; icalcomponent *vevent = icalcomponent_new(ICAL_VEVENT_COMPONENT); @@ -256,8 +256,8 @@ icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy, } //Loops through all the periods in the freebusy object - QValueList list = freebusy->busyPeriods(); - QValueList::Iterator it; + TQValueList list = freebusy->busyPeriods(); + TQValueList::Iterator it; icalperiodtype period = icalperiodtype_null_period(); for (it = list.begin(); it!= list.end(); ++it) { period.start = writeICalDateTime((*it).start()); @@ -301,15 +301,15 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence) if (incidence->pilotId()) { // NOTE: we can't do setNonKDECustomProperty here because this changes // data and triggers an updated() event... - // incidence->setNonKDECustomProperty("X-PILOTSTAT", QString::number(incidence->syncStatus())); - // incidence->setNonKDECustomProperty("X-PILOTID", QString::number(incidence->pilotId())); + // incidence->setNonKDECustomProperty("X-PILOTSTAT", TQString::number(incidence->syncStatus())); + // incidence->setNonKDECustomProperty("X-PILOTID", TQString::number(incidence->pilotId())); icalproperty *p = 0; - p = icalproperty_new_x(QString::number(incidence->syncStatus()).utf8()); + p = icalproperty_new_x(TQString::number(incidence->syncStatus()).utf8()); icalproperty_set_x_name(p,"X-PILOTSTAT"); icalcomponent_add_property(parent,p); - p = icalproperty_new_x(QString::number(incidence->pilotId()).utf8()); + p = icalproperty_new_x(TQString::number(incidence->pilotId()).utf8()); icalproperty_set_x_name(p,"X-PILOTID"); icalcomponent_add_property(parent,p); } @@ -414,8 +414,8 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence) } // categories - QStringList categories = incidence->categories(); - QStringList::Iterator it; + TQStringList categories = incidence->categories(); + TQStringList::Iterator it; for(it = categories.begin(); it != categories.end(); ++it ) { icalcomponent_add_property(parent,icalproperty_new_categories((*it).utf8())); } @@ -499,7 +499,7 @@ void ICalFormatImpl::writeIncidenceBase( icalcomponent *parent, IncidenceBase * incidenceBase ) { icalcomponent_add_property( parent, icalproperty_new_dtstamp( - writeICalDateTime( QDateTime::currentDateTime() ) ) ); + writeICalDateTime( TQDateTime::currentDateTime() ) ) ); // organizer stuff if ( !incidenceBase->organizer().isEmpty() ) { @@ -516,8 +516,8 @@ void ICalFormatImpl::writeIncidenceBase( icalcomponent *parent, } // comments - QStringList comments = incidenceBase->comments(); - for (QStringList::Iterator it=comments.begin(); it!=comments.end(); ++it) { + TQStringList comments = incidenceBase->comments(); + for (TQStringList::Iterator it=comments.begin(); it!=comments.end(); ++it) { icalcomponent_add_property(parent, icalproperty_new_comment((*it).utf8())); } @@ -527,8 +527,8 @@ void ICalFormatImpl::writeIncidenceBase( icalcomponent *parent, void ICalFormatImpl::writeCustomProperties(icalcomponent *parent,CustomProperties *properties) { - QMap custom = properties->customProperties(); - for (QMap::Iterator c = custom.begin(); c != custom.end(); ++c) { + TQMap custom = properties->customProperties(); + for (TQMap::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); @@ -696,8 +696,8 @@ icalrecurrencetype ICalFormatImpl::writeRecurrenceRule( RecurrenceRule *recur ) } int index = 0; - QValueList bys; - QValueList::ConstIterator it; + TQValueList bys; + TQValueList::ConstIterator it; // Now write out the BY* parts: bys = recur->bySeconds(); @@ -749,10 +749,10 @@ icalrecurrencetype ICalFormatImpl::writeRecurrenceRule( RecurrenceRule *recur ) } - QValueList byd = recur->byDays(); + TQValueList byd = recur->byDays(); int day; index = 0; - for ( QValueList::ConstIterator dit = byd.begin(); + for ( TQValueList::ConstIterator dit = byd.begin(); dit != byd.end(); ++dit ) { day = (*dit).day() % 7 + 1; // convert from Monday=1 to Sunday=1 if ( (*dit).pos() < 0 ) { @@ -808,7 +808,7 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) switch (alarm->type()) { case Alarm::Procedure: action = ICAL_ACTION_PROCEDURE; - attach = icalattach_new_from_url(QFile::encodeName(alarm->programFile()).data()); + attach = icalattach_new_from_url(TQFile::encodeName(alarm->programFile()).data()); icalcomponent_add_property(a,icalproperty_new_attach(attach)); if (!alarm->programArguments().isEmpty()) { icalcomponent_add_property(a,icalproperty_new_description(alarm->programArguments().utf8())); @@ -818,14 +818,14 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) action = ICAL_ACTION_AUDIO; // kdDebug(5800) << " It's an audio action, file: " << alarm->audioFile() << endl; if (!alarm->audioFile().isEmpty()) { - attach = icalattach_new_from_url(QFile::encodeName( alarm->audioFile() ).data()); + attach = icalattach_new_from_url(TQFile::encodeName( alarm->audioFile() ).data()); icalcomponent_add_property(a,icalproperty_new_attach(attach)); } break; case Alarm::Email: { action = ICAL_ACTION_EMAIL; - QValueList addresses = alarm->mailAddresses(); - for (QValueList::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) { + TQValueList addresses = alarm->mailAddresses(); + for (TQValueList::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())); @@ -834,10 +834,10 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) } icalcomponent_add_property(a,icalproperty_new_summary(alarm->mailSubject().utf8())); icalcomponent_add_property(a,icalproperty_new_description(alarm->mailText().utf8())); - QStringList attachments = alarm->mailAttachments(); + TQStringList attachments = alarm->mailAttachments(); if (attachments.count() > 0) { - for (QStringList::Iterator at = attachments.begin(); at != attachments.end(); ++at) { - attach = icalattach_new_from_url(QFile::encodeName( *at ).data()); + for (TQStringList::Iterator at = attachments.begin(); at != attachments.end(); ++at) { + attach = icalattach_new_from_url(TQFile::encodeName( *at ).data()); icalcomponent_add_property(a,icalproperty_new_attach(attach)); } } @@ -882,8 +882,8 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) } // Custom properties - QMap custom = alarm->customProperties(); - for (QMap::Iterator c = custom.begin(); c != custom.end(); ++c) { + TQMap custom = alarm->customProperties(); + for (TQMap::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); @@ -903,7 +903,7 @@ Todo *ICalFormatImpl::readTodo(icalcomponent *vtodo) // int intvalue; icaltimetype icaltime; - QStringList categories; + TQStringList categories; while (p) { icalproperty_kind kind = icalproperty_isa(p); @@ -912,7 +912,7 @@ Todo *ICalFormatImpl::readTodo(icalcomponent *vtodo) case ICAL_DUE_PROPERTY: // due date icaltime = icalproperty_get_due(p); if (icaltime.is_date) { - todo->setDtDue(QDateTime(readICalDate(icaltime),QTime(0,0,0)),true); + todo->setDtDue(TQDateTime(readICalDate(icaltime),TQTime(0,0,0)),true); } else { todo->setDtDue(readICalDateTime(p, icaltime),true); todo->setFloats(false); @@ -930,7 +930,7 @@ Todo *ICalFormatImpl::readTodo(icalcomponent *vtodo) break; case ICAL_RELATEDTO_PROPERTY: // related todo (parent) - todo->setRelatedToUid(QString::fromUtf8(icalproperty_get_relatedto(p))); + todo->setRelatedToUid(TQString::fromUtf8(icalproperty_get_relatedto(p))); mTodosRelate.append(todo); break; @@ -980,7 +980,7 @@ Event *ICalFormatImpl::readEvent( icalcomponent *vevent, icalcomponent *vtimezon // int intvalue; icaltimetype icaltime; - QStringList categories; + TQStringList categories; icalproperty_transp transparency; bool dtEndProcessed = false; @@ -993,12 +993,12 @@ Event *ICalFormatImpl::readEvent( icalcomponent *vevent, icalcomponent *vtimezon icaltime = icalproperty_get_dtend(p); if (icaltime.is_date) { // End date is non-inclusive - QDate endDate = readICalDate( icaltime ).addDays( -1 ); + TQDate endDate = readICalDate( icaltime ).addDays( -1 ); if ( mCompat ) mCompat->fixFloatingEnd( endDate ); if ( endDate < event->dtStart().date() ) { endDate = event->dtStart().date(); } - event->setDtEnd( QDateTime( endDate, QTime( 0, 0, 0 ) ) ); + event->setDtEnd( TQDateTime( endDate, TQTime( 0, 0, 0 ) ) ); } else { event->setDtEnd(readICalDateTime(p, icaltime, tz)); event->setFloats( false ); @@ -1007,7 +1007,7 @@ Event *ICalFormatImpl::readEvent( icalcomponent *vevent, icalcomponent *vtimezon break; case ICAL_RELATEDTO_PROPERTY: // related event (parent) - event->setRelatedToUid(QString::fromUtf8(icalproperty_get_relatedto(p))); + event->setRelatedToUid(TQString::fromUtf8(icalproperty_get_relatedto(p))); mEventsRelate.append(event); break; @@ -1035,9 +1035,9 @@ Event *ICalFormatImpl::readEvent( icalcomponent *vevent, icalcomponent *vtimezon event->setDtEnd( event->dtStart() ); } - QString msade = event->nonKDECustomProperty("X-MICROSOFT-CDO-ALLDAYEVENT"); + TQString msade = event->nonKDECustomProperty("X-MICROSOFT-CDO-ALLDAYEVENT"); if (!msade.isEmpty()) { - bool floats = (msade == QString::fromLatin1("TRUE")); + bool floats = (msade == TQString::fromLatin1("TRUE")); event->setFloats(floats); } @@ -1073,19 +1073,19 @@ FreeBusy *ICalFormatImpl::readFreeBusy(icalcomponent *vfreebusy) case ICAL_FREEBUSY_PROPERTY: { //Any FreeBusy Times icalperiodtype icalperiod = icalproperty_get_freebusy(p); - QDateTime period_start = readICalDateTime(p, icalperiod.start); + TQDateTime period_start = readICalDateTime(p, icalperiod.start); Period period; if ( !icaltime_is_null_time(icalperiod.end) ) { - QDateTime period_end = readICalDateTime(p, icalperiod.end); + TQDateTime period_end = readICalDateTime(p, icalperiod.end); period = Period(period_start, period_end); } else { Duration duration = readICalDuration( icalperiod.duration ); period = Period(period_start, duration); } - QCString param = icalproperty_get_parameter_as_string( p, "X-SUMMARY" ); - period.setSummary( QString::fromUtf8( KCodecs::base64Decode( param ) ) ); + TQCString param = icalproperty_get_parameter_as_string( p, "X-SUMMARY" ); + period.setSummary( TQString::fromUtf8( KCodecs::base64Decode( param ) ) ); param = icalproperty_get_parameter_as_string( p, "X-LOCATION" ); - period.setLocation( QString::fromUtf8( KCodecs::base64Decode( param ) ) ); + period.setLocation( TQString::fromUtf8( KCodecs::base64Decode( param ) ) ); periods.append( period ); break;} @@ -1114,16 +1114,16 @@ Attendee *ICalFormatImpl::readAttendee(icalproperty *attendee) { icalparameter *p = 0; - QString email = QString::fromUtf8(icalproperty_get_attendee(attendee)); + TQString email = TQString::fromUtf8(icalproperty_get_attendee(attendee)); if ( email.startsWith( "mailto:", false ) ) { email = email.mid( 7 ); } - QString name; - QString uid = QString::null; + TQString name; + TQString uid = TQString::null; p = icalproperty_get_first_parameter(attendee,ICAL_CN_PARAMETER); if (p) { - name = QString::fromUtf8(icalparameter_get_cn(p)); + name = TQString::fromUtf8(icalparameter_get_cn(p)); } else { } @@ -1210,17 +1210,17 @@ Attendee *ICalFormatImpl::readAttendee(icalproperty *attendee) Person ICalFormatImpl::readOrganizer( icalproperty *organizer ) { - QString email = QString::fromUtf8(icalproperty_get_organizer(organizer)); + TQString email = TQString::fromUtf8(icalproperty_get_organizer(organizer)); if ( email.startsWith( "mailto:", false ) ) { email = email.mid( 7 ); } - QString cn; + TQString cn; icalparameter *p = icalproperty_get_first_parameter( organizer, ICAL_CN_PARAMETER ); if ( p ) { - cn = QString::fromUtf8( icalparameter_get_cn( p ) ); + cn = TQString::fromUtf8( icalparameter_get_cn( p ) ); } Person org( cn, email ); // TODO: Treat sent-by, dir and language here, too @@ -1240,16 +1240,16 @@ Attachment *ICalFormatImpl::readAttachment(icalproperty *attach) if (isurl == 0) attachment = new Attachment((const char*)icalattach_get_data(a)); else { - attachment = new Attachment(QString::fromUtf8(icalattach_get_url(a))); + attachment = new Attachment(TQString::fromUtf8(icalattach_get_url(a))); } } else if ( value_kind == ICAL_URI_VALUE ) { - attachment = new Attachment(QString::fromUtf8(icalvalue_get_uri(icalproperty_get_value(attach)))); + attachment = new Attachment(TQString::fromUtf8(icalvalue_get_uri(icalproperty_get_value(attach)))); } icalparameter *p = icalproperty_get_first_parameter(attach, ICAL_FMTTYPE_PARAMETER); if (p && attachment) - attachment->setMimeType(QString(icalparameter_get_fmttype(p))); + attachment->setMimeType(TQString(icalparameter_get_fmttype(p))); p = icalproperty_get_first_parameter(attach,ICAL_X_PARAMETER); while (p) { @@ -1272,7 +1272,7 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent, icaltimezone *tz, Inci icaltimetype icaltime; icaldurationtype icalduration; - QStringList categories; + TQStringList categories; while (p) { icalproperty_kind kind = icalproperty_isa(p); @@ -1296,7 +1296,7 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent, icaltimezone *tz, Inci case ICAL_DTSTART_PROPERTY: // start date and time icaltime = icalproperty_get_dtstart(p); if (icaltime.is_date) { - incidence->setDtStart(QDateTime(readICalDate(icaltime),QTime(0,0,0))); + incidence->setDtStart(TQDateTime(readICalDate(icaltime),TQTime(0,0,0))); incidence->setFloats( true ); } else { incidence->setDtStart(readICalDateTime(p, icaltime, tz)); @@ -1311,17 +1311,17 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent, icaltimezone *tz, Inci case ICAL_DESCRIPTION_PROPERTY: // description text = icalproperty_get_description(p); - incidence->setDescription(QString::fromUtf8(text)); + incidence->setDescription(TQString::fromUtf8(text)); break; case ICAL_SUMMARY_PROPERTY: // summary text = icalproperty_get_summary(p); - incidence->setSummary(QString::fromUtf8(text)); + incidence->setSummary(TQString::fromUtf8(text)); break; case ICAL_LOCATION_PROPERTY: // location text = icalproperty_get_location(p); - incidence->setLocation(QString::fromUtf8(text)); + incidence->setLocation(TQString::fromUtf8(text)); break; case ICAL_STATUS_PROPERTY: { // status @@ -1336,7 +1336,7 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent, icaltimezone *tz, Inci case ICAL_STATUS_DRAFT: stat = Incidence::StatusDraft; break; case ICAL_STATUS_FINAL: stat = Incidence::StatusFinal; break; case ICAL_STATUS_X: - incidence->setCustomStatus(QString::fromUtf8(icalvalue_get_x(icalproperty_get_value(p)))); + incidence->setCustomStatus(TQString::fromUtf8(icalvalue_get_x(icalproperty_get_value(p)))); stat = Incidence::StatusX; break; case ICAL_STATUS_NONE: @@ -1356,7 +1356,7 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent, icaltimezone *tz, Inci case ICAL_CATEGORIES_PROPERTY: // categories text = icalproperty_get_categories(p); - categories.append(QString::fromUtf8(text)); + categories.append(TQString::fromUtf8(text)); break; case ICAL_RRULE_PROPERTY: @@ -1414,7 +1414,7 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent, icaltimezone *tz, Inci } // Set the scheduling ID - const QString uid = incidence->customProperty( "LIBKCAL", "ID" ); + const TQString uid = incidence->customProperty( "LIBKCAL", "ID" ); if ( !uid.isNull() ) { // The UID stored in incidencebase is actually the scheduling ID // It has to be stored in the iCal UID component for compatibility @@ -1451,7 +1451,7 @@ void ICalFormatImpl::readIncidenceBase(icalcomponent *parent,IncidenceBase *inci switch (kind) { case ICAL_UID_PROPERTY: // unique id - incidenceBase->setUid(QString::fromUtf8(icalproperty_get_uid(p))); + incidenceBase->setUid(TQString::fromUtf8(icalproperty_get_uid(p))); break; case ICAL_ORGANIZER_PROPERTY: // organizer @@ -1464,7 +1464,7 @@ void ICalFormatImpl::readIncidenceBase(icalcomponent *parent,IncidenceBase *inci case ICAL_COMMENT_PROPERTY: incidenceBase->addComment( - QString::fromUtf8(icalproperty_get_comment(p))); + TQString::fromUtf8(icalproperty_get_comment(p))); break; default: @@ -1489,8 +1489,8 @@ void ICalFormatImpl::readIncidenceBase(icalcomponent *parent,IncidenceBase *inci next = icalcomponent_get_next_property(parent,ICAL_X_PROPERTY); - QString value = QString::fromUtf8(icalproperty_get_x(p)); - QString name = icalproperty_get_x_name(p); + TQString value = TQString::fromUtf8(icalproperty_get_x(p)); + TQString name = icalproperty_get_x_name(p); if (name == "X-PILOTID" && !value.isEmpty()) { incidenceBase->setPilotId(value.toInt()); @@ -1507,14 +1507,14 @@ void ICalFormatImpl::readIncidenceBase(icalcomponent *parent,IncidenceBase *inci void ICalFormatImpl::readCustomProperties(icalcomponent *parent,CustomProperties *properties) { - QMap customProperties; - QString lastProperty; + TQMap customProperties; + TQString lastProperty; icalproperty *p = icalcomponent_get_first_property(parent,ICAL_X_PROPERTY); while (p) { - QString value = QString::fromUtf8(icalproperty_get_x(p)); + TQString value = TQString::fromUtf8(icalproperty_get_x(p)); const char *name = icalproperty_get_x_name(p); if ( lastProperty != name ) { customProperties[name] = value; @@ -1564,7 +1564,7 @@ void ICalFormatImpl::readExceptionRule( icalproperty *rrule, Incidence *incidenc void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, RecurrenceRule* recur ) { // Generate the RRULE string - recur->mRRule = QString( icalrecurrencetype_as_string( const_cast(&r) ) ); + recur->mRRule = TQString( icalrecurrencetype_as_string( const_cast(&r) ) ); // Period switch ( r.freq ) { case ICAL_SECONDLY_RECURRENCE: recur->setRecurrenceType( RecurrenceRule::rSecondly ); break; @@ -1586,7 +1586,7 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre icaltimetype t; t = r.until; // Convert to the correct time zone! it's in UTC by specification. - QDateTime endDate( readICalDateTime(0, t) ); + TQDateTime endDate( readICalDateTime(0, t) ); recur->setEndDt( endDate ); } else { if (r.count == 0) @@ -1600,7 +1600,7 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre recur->setWeekStart( wkst ); // And now all BY* - QValueList lst; + TQValueList lst; int i; int index = 0; @@ -1625,7 +1625,7 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre #undef readSetByList // BYDAY is a special case, since it's not an int list - QValueList wdlst; + TQValueList wdlst; short day; index=0; while((day = r.by_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { @@ -1709,7 +1709,7 @@ void ICalFormatImpl::readAlarm(icalcomponent *alarm,Incidence *incidence) // Only in DISPLAY and EMAIL and PROCEDURE alarms case ICAL_DESCRIPTION_PROPERTY: { - QString description = QString::fromUtf8(icalproperty_get_description(p)); + TQString description = TQString::fromUtf8(icalproperty_get_description(p)); switch ( action ) { case ICAL_ACTION_DISPLAY: ialarm->setText( description ); @@ -1727,19 +1727,19 @@ void ICalFormatImpl::readAlarm(icalcomponent *alarm,Incidence *incidence) } // Only in EMAIL alarm case ICAL_SUMMARY_PROPERTY: - ialarm->setMailSubject(QString::fromUtf8(icalproperty_get_summary(p))); + ialarm->setMailSubject(TQString::fromUtf8(icalproperty_get_summary(p))); break; // Only in EMAIL alarm case ICAL_ATTENDEE_PROPERTY: { - QString email = QString::fromUtf8(icalproperty_get_attendee(p)); + TQString email = TQString::fromUtf8(icalproperty_get_attendee(p)); if ( email.startsWith("mailto:", false ) ) { email = email.mid( 7 ); } - QString name; + TQString name; icalparameter *param = icalproperty_get_first_parameter(p,ICAL_CN_PARAMETER); if (param) { - name = QString::fromUtf8(icalparameter_get_cn(param)); + name = TQString::fromUtf8(icalparameter_get_cn(param)); } ialarm->addMailAddress(Person(name, email)); break; @@ -1781,7 +1781,7 @@ void ICalFormatImpl::readAlarm(icalcomponent *alarm,Incidence *incidence) // TODO: check for consistency of alarm properties } -icaldatetimeperiodtype ICalFormatImpl::writeICalDatePeriod( const QDate &date ) +icaldatetimeperiodtype ICalFormatImpl::writeICalDatePeriod( const TQDate &date ) { icaldatetimeperiodtype t; t.time = writeICalDate( date ); @@ -1789,7 +1789,7 @@ icaldatetimeperiodtype ICalFormatImpl::writeICalDatePeriod( const QDate &date ) return t; } -icaldatetimeperiodtype ICalFormatImpl::writeICalDateTimePeriod( const QDateTime &date ) +icaldatetimeperiodtype ICalFormatImpl::writeICalDateTimePeriod( const TQDateTime &date ) { icaldatetimeperiodtype t; t.time = writeICalDateTime( date ); @@ -1797,7 +1797,7 @@ icaldatetimeperiodtype ICalFormatImpl::writeICalDateTimePeriod( const QDateTime return t; } -icaltimetype ICalFormatImpl::writeICalDate(const QDate &date) +icaltimetype ICalFormatImpl::writeICalDate(const TQDate &date) { icaltimetype t = icaltime_null_time(); @@ -1818,7 +1818,7 @@ icaltimetype ICalFormatImpl::writeICalDate(const QDate &date) return t; } -icaltimetype ICalFormatImpl::writeICalDateTime(const QDateTime &datetime) +icaltimetype ICalFormatImpl::writeICalDateTime(const TQDateTime &datetime) { icaltimetype t = icaltime_null_time(); @@ -1835,7 +1835,7 @@ icaltimetype ICalFormatImpl::writeICalDateTime(const QDateTime &datetime) t.is_utc = 0; // _dumpIcaltime( t ); - /* The QDateTime we get passed in is to be considered in the timezone of + /* The TQDateTime we get passed in is to be considered in the timezone of * the current calendar (mParent's), or, if there is none, to be floating. * In the later case store a floating time, in the former normalize to utc. */ if (mParent->timeZoneId().isEmpty()) @@ -1856,7 +1856,7 @@ icaltimetype ICalFormatImpl::writeICalDateTime(const QDateTime &datetime) return t; } -QDateTime ICalFormatImpl::readICalDateTime( icalproperty *p, icaltimetype& t, icaltimezone* tz ) +TQDateTime ICalFormatImpl::readICalDateTime( icalproperty *p, icaltimetype& t, icaltimezone* tz ) { // kdDebug(5800) << "ICalFormatImpl::readICalDateTime()" << endl; if ( tz && t.is_utc == 0 ) { // Only use the TZ if time is not UTC. @@ -1885,18 +1885,18 @@ QDateTime ICalFormatImpl::readICalDateTime( icalproperty *p, icaltimetype& t, ic // Convert to view time if ( !mParent->timeZoneId().isEmpty() && t.zone ) { -// kdDebug(5800) << "--- Converting time from: " << icaltimezone_get_tzid( const_cast( t.zone ) ) << " (" << ICalDate2QDate(t) << ")." << endl; +// kdDebug(5800) << "--- Converting time from: " << icaltimezone_get_tzid( const_cast( t.zone ) ) << " (" << ICalDate2TQDate(t) << ")." << endl; icaltimezone* viewTimeZone = icaltimezone_get_builtin_timezone ( mParent->timeZoneId().latin1() ); icaltimezone_convert_time( &t, const_cast(t.zone), viewTimeZone ); -// kdDebug(5800) << "--- Converted to zone " << mParent->timeZoneId() << " (" << ICalDate2QDate(t) << ")." << endl; +// kdDebug(5800) << "--- Converted to zone " << mParent->timeZoneId() << " (" << ICalDate2TQDate(t) << ")." << endl; } - return ICalDate2QDate(t); + return ICalDate2TQDate(t); } -QDate ICalFormatImpl::readICalDate(icaltimetype t) +TQDate ICalFormatImpl::readICalDate(icaltimetype t) { - return ICalDate2QDate(t).date(); + return ICalDate2TQDate(t).date(); } icaldurationtype ICalFormatImpl::writeICalDuration(int seconds) @@ -1981,7 +1981,7 @@ bool ICalFormatImpl::populate( Calendar *cal, icalcomponent *calendar) kdDebug(5800) << "No PRODID property found" << endl; mLoadedProductId = ""; } else { - mLoadedProductId = QString::fromUtf8(icalproperty_get_prodid(p)); + mLoadedProductId = TQString::fromUtf8(icalproperty_get_prodid(p)); // kdDebug(5800) << "VCALENDAR prodid: '" << mLoadedProductId << "'" << endl; delete mCompat; @@ -2085,12 +2085,12 @@ bool ICalFormatImpl::populate( Calendar *cal, icalcomponent *calendar) return true; } -QString ICalFormatImpl::extractErrorProperty(icalcomponent *c) +TQString ICalFormatImpl::extractErrorProperty(icalcomponent *c) { // kdDebug(5800) << "ICalFormatImpl:extractErrorProperty: " // << icalcomponent_as_ical_string(c) << endl; - QString errorMessage; + TQString errorMessage; icalproperty *error; error = icalcomponent_get_first_property(c,ICAL_XLICERROR_PROPERTY); @@ -2114,42 +2114,42 @@ void ICalFormatImpl::dumpIcalRecurrence(icalrecurrencetype r) kdDebug(5800) << " Count: " << r.count << endl; if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { int index = 0; - QString out = " By Day: "; + TQString out = " By Day: "; while((i = r.by_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { - out.append(QString::number(i) + " "); + out.append(TQString::number(i) + " "); } kdDebug(5800) << out << endl; } if (r.by_month_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { int index = 0; - QString out = " By Month Day: "; + TQString out = " By Month Day: "; while((i = r.by_month_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { - out.append(QString::number(i) + " "); + out.append(TQString::number(i) + " "); } kdDebug(5800) << out << endl; } if (r.by_year_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { int index = 0; - QString out = " By Year Day: "; + TQString out = " By Year Day: "; while((i = r.by_year_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { - out.append(QString::number(i) + " "); + out.append(TQString::number(i) + " "); } kdDebug(5800) << out << endl; } if (r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX) { int index = 0; - QString out = " By Month: "; + TQString out = " By Month: "; while((i = r.by_month[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { - out.append(QString::number(i) + " "); + out.append(TQString::number(i) + " "); } kdDebug(5800) << out << endl; } if (r.by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX) { int index = 0; - QString out = " By Set Pos: "; + TQString out = " By Set Pos: "; while((i = r.by_set_pos[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { kdDebug(5800) << "========= " << i << endl; - out.append(QString::number(i) + " "); + out.append(TQString::number(i) + " "); } kdDebug(5800) << out << endl; } diff --git a/libkcal/icalformatimpl.h b/libkcal/icalformatimpl.h index 75a3a5a19..9a2e9f623 100644 --- a/libkcal/icalformatimpl.h +++ b/libkcal/icalformatimpl.h @@ -22,8 +22,8 @@ #ifndef KCAL_ICALFORMATIMPL_H #define KCAL_ICALFORMATIMPL_H -#include -#include +#include +#include #include "scheduler.h" #include "freebusy.h" @@ -65,7 +65,7 @@ class ICalFormatImpl icalrecurrencetype writeRecurrenceRule( RecurrenceRule *recur ); icalcomponent *writeAlarm(Alarm *alarm); - QString extractErrorProperty(icalcomponent *); + TQString extractErrorProperty(icalcomponent *); Todo *readTodo(icalcomponent *vtodo); Event *readEvent(icalcomponent *vevent, icalcomponent *vtimezone); FreeBusy *readFreeBusy(icalcomponent *vfreebusy); @@ -79,16 +79,16 @@ class ICalFormatImpl void readRecurrence( const struct icalrecurrencetype &r, RecurrenceRule* recur ); void readAlarm(icalcomponent *alarm,Incidence *incidence); /** Return the PRODID string loaded from calendar file */ - const QString &loadedProductId() { return mLoadedProductId; } + const TQString &loadedProductId() { return mLoadedProductId; } - static icaltimetype writeICalDate(const QDate &); - static QDate readICalDate(icaltimetype); - icaltimetype writeICalDateTime(const QDateTime &); - QDateTime readICalDateTime( icalproperty*, icaltimetype&, icaltimezone* tz = 0 ); + static icaltimetype writeICalDate(const TQDate &); + static TQDate readICalDate(icaltimetype); + icaltimetype writeICalDateTime(const TQDateTime &); + TQDateTime readICalDateTime( icalproperty*, icaltimetype&, icaltimezone* tz = 0 ); static icaldurationtype writeICalDuration(int seconds); static int readICalDuration(icaldurationtype); - static icaldatetimeperiodtype writeICalDatePeriod( const QDate &date ); - icaldatetimeperiodtype writeICalDateTimePeriod( const QDateTime &date ); + static icaldatetimeperiodtype writeICalDatePeriod( const TQDate &date ); + icaldatetimeperiodtype writeICalDateTimePeriod( const TQDateTime &date ); icalcomponent *createCalendarComponent(Calendar * = 0); icalcomponent *createScheduleComponent(IncidenceBase *,Scheduler::Method); @@ -105,7 +105,7 @@ class ICalFormatImpl ICalFormat *mParent; Calendar *mCalendar; - QString mLoadedProductId; // PRODID string loaded from calendar file + TQString mLoadedProductId; // PRODID string loaded from calendar file Event::List mEventsRelate; // events with relations Todo::List mTodosRelate; // todos with relations diff --git a/libkcal/imipscheduler.cpp b/libkcal/imipscheduler.cpp index 2a83840ec..7a4f8feb3 100644 --- a/libkcal/imipscheduler.cpp +++ b/libkcal/imipscheduler.cpp @@ -39,7 +39,7 @@ IMIPScheduler::~IMIPScheduler() { } -bool IMIPScheduler::publish (IncidenceBase * /*incidence*/,const QString &/*recipients*/) +bool IMIPScheduler::publish (IncidenceBase * /*incidence*/,const TQString &/*recipients*/) { return false; } @@ -51,9 +51,9 @@ bool IMIPScheduler::performTransaction(IncidenceBase *incidence,Method method) return false; } -QPtrList IMIPScheduler::retrieveTransactions() +TQPtrList IMIPScheduler::retrieveTransactions() { - QPtrList messageList; + TQPtrList messageList; return messageList; } diff --git a/libkcal/imipscheduler.h b/libkcal/imipscheduler.h index 95535798e..59379403f 100644 --- a/libkcal/imipscheduler.h +++ b/libkcal/imipscheduler.h @@ -21,7 +21,7 @@ #ifndef KCAL_IMIPSCHEDULER_H #define KCAL_IMIPSCHEDULER_H -#include +#include #include "libkcal_export.h" #include "scheduler.h" @@ -40,9 +40,9 @@ class KDE_EXPORT IMIPScheduler : public Scheduler IMIPScheduler( Calendar * ); virtual ~IMIPScheduler(); - bool publish (IncidenceBase *incidence,const QString &recipients); + bool publish (IncidenceBase *incidence,const TQString &recipients); bool performTransaction(IncidenceBase *incidence,Method method); - QPtrList retrieveTransactions(); + TQPtrList retrieveTransactions(); private: class Private; diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index c4ee51083..94995b12c 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -60,7 +60,7 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ),Recurrence::Obse mPriority = i.mPriority; mLocation = i.mLocation; - // Alarms and Attachments are stored in ListBase<...>, which is a QValueList<...*>. + // Alarms and Attachments are stored in ListBase<...>, which is a TQValueList<...*>. // We need to really duplicate the objects stored therein, otherwise deleting // i will also delete all attachments from this object (setAutoDelete...) Alarm::List::ConstIterator it; @@ -100,7 +100,7 @@ Incidence::~Incidence() } // A string comparison that considers that null and empty are the same -static bool stringCompare( const QString& s1, const QString& s2 ) +static bool stringCompare( const TQString& s1, const TQString& s2 ) { return ( s1.isEmpty() && s2.isEmpty() ) || (s1 == s2); } @@ -199,14 +199,14 @@ bool Incidence::operator==( const Incidence& i2 ) const void Incidence::recreate() { - setCreated(QDateTime::currentDateTime()); + setCreated(TQDateTime::currentDateTime()); setUid(CalFormat::createUniqueId()); - setSchedulingID( QString::null ); + setSchedulingID( TQString::null ); setRevision(0); - setLastModified(QDateTime::currentDateTime()); + setLastModified(TQDateTime::currentDateTime()); setPilotId( 0 ); setSyncStatus( SYNCNONE ); } @@ -226,7 +226,7 @@ void Incidence::setFloats(bool f) IncidenceBase::setFloats( f ); } -void Incidence::setCreated( const QDateTime &created ) +void Incidence::setCreated( const TQDateTime &created ) { if (mReadOnly) return; mCreated = created; @@ -235,7 +235,7 @@ void Incidence::setCreated( const QDateTime &created ) // updated(); } -QDateTime Incidence::created() const +TQDateTime Incidence::created() const { return mCreated; } @@ -253,7 +253,7 @@ int Incidence::revision() const return mRevision; } -void Incidence::setDtStart(const QDateTime &dtStart) +void Incidence::setDtStart(const TQDateTime &dtStart) { if ( mRecurrence ) { mRecurrence->setStartDateTime( dtStart ); @@ -262,49 +262,49 @@ void Incidence::setDtStart(const QDateTime &dtStart) IncidenceBase::setDtStart( dtStart ); } -void Incidence::setDescription(const QString &description) +void Incidence::setDescription(const TQString &description) { if (mReadOnly) return; mDescription = description; updated(); } -QString Incidence::description() const +TQString Incidence::description() const { return mDescription; } -void Incidence::setSummary(const QString &summary) +void Incidence::setSummary(const TQString &summary) { if (mReadOnly) return; mSummary = summary; updated(); } -QString Incidence::summary() const +TQString Incidence::summary() const { return mSummary; } -void Incidence::setCategories(const QStringList &categories) +void Incidence::setCategories(const TQStringList &categories) { if (mReadOnly) return; mCategories = categories; updated(); } -// TODO: remove setCategories(QString) function -void Incidence::setCategories(const QString &catStr) +// TODO: remove setCategories(TQString) function +void Incidence::setCategories(const TQString &catStr) { if (mReadOnly) return; mCategories.clear(); if (catStr.isEmpty()) return; - mCategories = QStringList::split(",",catStr); + mCategories = TQStringList::split(",",catStr); - QStringList::Iterator it; + TQStringList::Iterator it; for(it = mCategories.begin();it != mCategories.end(); ++it) { *it = (*it).stripWhiteSpace(); } @@ -312,24 +312,24 @@ void Incidence::setCategories(const QString &catStr) updated(); } -QStringList Incidence::categories() const +TQStringList Incidence::categories() const { return mCategories; } -QString Incidence::categoriesStr() const +TQString Incidence::categoriesStr() const { return mCategories.join(","); } -void Incidence::setRelatedToUid(const QString &relatedToUid) +void Incidence::setRelatedToUid(const TQString &relatedToUid) { if ( mReadOnly || mRelatedToUid == relatedToUid ) return; mRelatedToUid = relatedToUid; updated(); } -QString Incidence::relatedToUid() const +TQString Incidence::relatedToUid() const { return mRelatedToUid; } @@ -345,7 +345,7 @@ void Incidence::setRelatedTo(Incidence *relatedTo) if ( mRelatedTo->uid() != mRelatedToUid ) setRelatedToUid( mRelatedTo->uid() ); } else { - setRelatedToUid( QString::null ); + setRelatedToUid( TQString::null ); } } @@ -372,7 +372,7 @@ void Incidence::removeRelation(Incidence *event) { mRelations.removeRef(event); // if (event->getRelatedTo() == this) event->setRelatedTo(0); - mRelatedToUid=QString(); + mRelatedToUid=TQString(); } @@ -411,12 +411,12 @@ bool Incidence::doesRecur() const else return false; } -bool Incidence::recursOn(const QDate &qd) const +bool Incidence::recursOn(const TQDate &qd) const { return ( mRecurrence && mRecurrence->recursOn(qd) ); } -bool Incidence::recursAt(const QDateTime &qdt) const +bool Incidence::recursAt(const TQDateTime &qdt) const { return ( mRecurrence && mRecurrence->recursAt(qdt) ); } @@ -429,13 +429,13 @@ bool Incidence::recursAt(const QDateTime &qdt) const @return the start date/time of all occurences that overlap with the given date. Empty list if the incidence does not overlap with the date at all */ -QValueList Incidence::startDateTimesForDate( const QDate &date ) const +TQValueList Incidence::startDateTimesForDate( const TQDate &date ) const { //kdDebug(5800) << "Incidence::startDateTimesForDate " << date << ", incidence=" << summary() << endl; - QDateTime start = dtStart(); - QDateTime end = endDateRecurrenceBase(); + TQDateTime start = dtStart(); + TQDateTime end = endDateRecurrenceBase(); - QValueList result; + TQValueList result; // TODO_Recurrence: Also work if only due date is given... if ( !start.isValid() && ! end.isValid() ) { @@ -452,13 +452,13 @@ QValueList Incidence::startDateTimesForDate( const QDate &date ) cons int days = start.daysTo( end ); // Account for possible recurrences going over midnight, while the original event doesn't - QDate tmpday( date.addDays( -days - 1 ) ); - QDateTime tmp; + TQDate tmpday( date.addDays( -days - 1 ) ); + TQDateTime tmp; while ( tmpday <= date ) { if ( recurrence()->recursOn( tmpday ) ) { - QValueList times = recurrence()->recurTimesOn( tmpday ); - for ( QValueList::ConstIterator it = times.begin(); it != times.end(); ++it ) { - tmp = QDateTime( tmpday, *it ); + TQValueList times = recurrence()->recurTimesOn( tmpday ); + for ( TQValueList::ConstIterator it = times.begin(); it != times.end(); ++it ) { + tmp = TQDateTime( tmpday, *it ); if ( endDateForStart( tmp ).date() >= date ) result << tmp; } @@ -476,13 +476,13 @@ QValueList Incidence::startDateTimesForDate( const QDate &date ) cons date/time. Empty list if the incidence does not happen at the given time at all. */ -QValueList Incidence::startDateTimesForDateTime( const QDateTime &datetime ) const +TQValueList Incidence::startDateTimesForDateTime( const TQDateTime &datetime ) const { // kdDebug(5800) << "Incidence::startDateTimesForDateTime " << datetime << ", incidence=" << summary() << endl; - QDateTime start = dtStart(); - QDateTime end = endDateRecurrenceBase(); + TQDateTime start = dtStart(); + TQDateTime end = endDateRecurrenceBase(); - QValueList result; + TQValueList result; // TODO_Recurrence: Also work if only due date is given... if ( !start.isValid() && ! end.isValid() ) { @@ -499,13 +499,13 @@ QValueList Incidence::startDateTimesForDateTime( const QDateTime &dat int days = start.daysTo( end ); // Account for possible recurrences going over midnight, while the original event doesn't - QDate tmpday( datetime.date().addDays( -days - 1 ) ); - QDateTime tmp; + TQDate tmpday( datetime.date().addDays( -days - 1 ) ); + TQDateTime tmp; while ( tmpday <= datetime.date() ) { if ( recurrence()->recursOn( tmpday ) ) { - QValueList times = recurrence()->recurTimesOn( tmpday ); - for ( QValueList::ConstIterator it = times.begin(); it != times.end(); ++it ) { - tmp = QDateTime( tmpday, *it ); + TQValueList times = recurrence()->recurTimesOn( tmpday ); + for ( TQValueList::ConstIterator it = times.begin(); it != times.end(); ++it ) { + tmp = TQDateTime( tmpday, *it ); if ( !(tmp > datetime || endDateForStart( tmp ) < datetime ) ) result << tmp; } @@ -516,10 +516,10 @@ QValueList Incidence::startDateTimesForDateTime( const QDateTime &dat } /** Return the end time of the occurrence if it starts at the given date/time */ -QDateTime Incidence::endDateForStart( const QDateTime &startDt ) const +TQDateTime Incidence::endDateForStart( const TQDateTime &startDt ) const { - QDateTime start = dtStart(); - QDateTime end = endDateRecurrenceBase(); + TQDateTime start = dtStart(); + TQDateTime end = endDateRecurrenceBase(); if ( !end.isValid() ) return start; if ( !start.isValid() ) return end; @@ -536,7 +536,7 @@ QDateTime Incidence::endDateForStart( const QDateTime &startDt ) const updated(); } -void Incidence::addExDate( const QDate &date ) +void Incidence::addExDate( const TQDate &date ) { if ( mReadOnly ) return; recurrence()->addExDate( date ); @@ -558,7 +558,7 @@ void Incidence::setExDateTimes( const DateTimeList &exDates ) updated(); } -void Incidence::addExDateTime( const QDateTime &date ) +void Incidence::addExDateTime( const TQDateTime &date ) { if ( mReadOnly ) return; recurrence()->addExDateTime( date ); @@ -580,7 +580,7 @@ void Incidence::setRDates(const DateList &exDates) updated(); } -void Incidence::addRDate( const QDate &date ) +void Incidence::addRDate( const TQDate &date ) { if ( mReadOnly ) return; recurrence()->addRDate( date ); @@ -602,7 +602,7 @@ void Incidence::setRDateTimes( const DateTimeList &exDates ) updated(); } -void Incidence::addRDateTime( const QDateTime &date ) +void Incidence::addRDateTime( const TQDateTime &date ) { if ( mReadOnly ) return; recurrence()->addRDateTime( date ); @@ -629,7 +629,7 @@ void Incidence::deleteAttachment(Attachment *attachment) mAttachments.removeRef(attachment); } -void Incidence::deleteAttachments( const QString &mime ) +void Incidence::deleteAttachments( const TQString &mime ) { Attachment::List::Iterator it = mAttachments.begin(); while( it != mAttachments.end() ) { @@ -643,7 +643,7 @@ Attachment::List Incidence::attachments() const return mAttachments; } -Attachment::List Incidence::attachments(const QString& mime) const +Attachment::List Incidence::attachments(const TQString& mime) const { Attachment::List attachments; Attachment::List::ConstIterator it; @@ -659,14 +659,14 @@ void Incidence::clearAttachments() mAttachments.clearAll(); } -void Incidence::setResources(const QStringList &resources) +void Incidence::setResources(const TQStringList &resources) { if (mReadOnly) return; mResources = resources; updated(); } -QStringList Incidence::resources() const +TQStringList Incidence::resources() const { return mResources; } @@ -688,11 +688,11 @@ void Incidence::setStatus(Incidence::Status status) { if (mReadOnly || status == StatusX) return; mStatus = status; - mStatusString = QString::null; + mStatusString = TQString::null; updated(); } -void Incidence::setCustomStatus(const QString &status) +void Incidence::setCustomStatus(const TQString &status) { if (mReadOnly) return; mStatus = status.isEmpty() ? StatusNone : StatusX; @@ -705,14 +705,14 @@ Incidence::Status Incidence::status() const return mStatus; } -QString Incidence::statusStr() const +TQString Incidence::statusStr() const { if (mStatus == StatusX) return mStatusString; return statusName(mStatus); } -QString Incidence::statusName(Incidence::Status status) +TQString Incidence::statusName(Incidence::Status status) { switch (status) { case StatusTentative: return i18n("incidence status", "Tentative"); @@ -725,7 +725,7 @@ QString Incidence::statusName(Incidence::Status status) case StatusFinal: return i18n("Final"); case StatusX: case StatusNone: - default: return QString::null; + default: return TQString::null; } } @@ -741,12 +741,12 @@ int Incidence::secrecy() const return mSecrecy; } -QString Incidence::secrecyStr() const +TQString Incidence::secrecyStr() const { return secrecyName(mSecrecy); } -QString Incidence::secrecyName(int secrecy) +TQString Incidence::secrecyName(int secrecy) { switch (secrecy) { case SecrecyPublic: @@ -760,9 +760,9 @@ QString Incidence::secrecyName(int secrecy) } } -QStringList Incidence::secrecyList() +TQStringList Incidence::secrecyList() { - QStringList list; + TQStringList list; list << secrecyName(SecrecyPublic); list << secrecyName(SecrecyPrivate); list << secrecyName(SecrecyConfidential); @@ -811,24 +811,24 @@ bool Incidence::isAlarmEnabled() const return false; } -void Incidence::setLocation(const QString &location) +void Incidence::setLocation(const TQString &location) { if (mReadOnly) return; mLocation = location; updated(); } -QString Incidence::location() const +TQString Incidence::location() const { return mLocation; } -void Incidence::setSchedulingID( const QString& sid ) +void Incidence::setSchedulingID( const TQString& sid ) { mSchedulingID = sid; } -QString Incidence::schedulingID() const +TQString Incidence::schedulingID() const { if ( mSchedulingID.isNull() ) // Nothing set, so use the normal uid diff --git a/libkcal/incidence.h b/libkcal/incidence.h index 5c90fd910..268b2cede 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h @@ -22,9 +22,9 @@ #ifndef INCIDENCE_H #define INCIDENCE_H -#include -#include -#include +#include +#include +#include #include "recurrence.h" #include "alarm.h" @@ -125,11 +125,11 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ /** Set creation date. */ - void setCreated( const QDateTime & ); + void setCreated( const TQDateTime & ); /** Return time and date of creation. */ - QDateTime created() const; + TQDateTime created() const; /** Set the number of revisions this event has seen. @@ -143,59 +143,59 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ /** Set starting date/time. */ - virtual void setDtStart( const QDateTime &dtStart ); + virtual void setDtStart( const TQDateTime &dtStart ); /** - Return the incidence's ending date/time as a QDateTime. + Return the incidence's ending date/time as a TQDateTime. */ - virtual QDateTime dtEnd() const { return QDateTime(); } + virtual TQDateTime dtEnd() const { return TQDateTime(); } /** Set the long description. */ - void setDescription( const QString &description ); + void setDescription( const TQString &description ); /** Return long description. */ - QString description() const; + TQString description() const; /** Set short summary. */ - void setSummary( const QString &summary ); + void setSummary( const TQString &summary ); /** Return short summary. */ - QString summary() const; + TQString summary() const; /** Set categories. */ - void setCategories( const QStringList &categories ); + void setCategories( const TQStringList &categories ); /** Set categories based on a comma delimited string. */ - void setCategories(const QString &catStr); + void setCategories(const TQString &catStr); /** Return categories as a list of strings. */ - QStringList categories() const; + TQStringList categories() const; /** Return categories as a comma separated string. */ - QString categoriesStr() const; + TQString categoriesStr() const; /** Point at some other event to which the event relates. This function should only be used when constructing a calendar before the related Incidence exists. */ - void setRelatedToUid(const QString &); + void setRelatedToUid(const TQString &); /** What event does this one relate to? This function should only be used when constructing a calendar before the related Incidence exists. */ - QString relatedToUid() const; + TQString relatedToUid() const; /** Point at some other event to which the event relates */ @@ -241,12 +241,12 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ Returns true if the date specified is one on which the incidence will recur. */ - virtual bool recursOn( const QDate &qd ) const; + virtual bool recursOn( const TQDate &qd ) const; /** Returns true if the date/time specified is one on which the incidence will recur. */ - bool recursAt( const QDateTime &qdt ) const; + bool recursAt( const TQDateTime &qdt ) const; /** Calculates the start date/time for all recurrences that happen at some time @@ -256,7 +256,7 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ @return the start date/time of all occurences that overlap with the given date. Empty list if the incidence does not overlap with the date at all */ - virtual QValueList startDateTimesForDate( const QDate &date ) const; + virtual TQValueList startDateTimesForDate( const TQDate &date ) const; /** Calculates the start date/time for all recurrences that happen at the given @@ -266,10 +266,10 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ date/time. Empty list if the incidence does not happen at the given time at all. */ - virtual QValueList startDateTimesForDateTime( const QDateTime &datetime ) const; + virtual TQValueList startDateTimesForDateTime( const TQDateTime &datetime ) const; /** Return the end time of the occurrence if it starts at the given date/time */ - virtual QDateTime endDateForStart( const QDateTime &startDt ) const; + virtual TQDateTime endDateForStart( const TQDateTime &startDt ) const; // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -287,7 +287,7 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ /** Remove and delete all attachments with this mime type. */ - void deleteAttachments( const QString &mime ); + void deleteAttachments( const TQString &mime ); /** Return list of all associated attachments. */ @@ -295,7 +295,7 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ /** Find a list of attachments with this mime type. */ - Attachment::List attachments( const QString &mime ) const; + Attachment::List attachments( const TQString &mime ) const; /** Remove and delete all attachments. */ @@ -318,15 +318,15 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ /** Return secrecy as translated string. */ - QString secrecyStr() const; + TQString secrecyStr() const; /** Return list of all available secrecy states as list of translated strings. */ - static QStringList secrecyList(); + static TQStringList secrecyList(); /** Return human-readable translated name of secrecy class. */ - static QString secrecyName( int ); + static TQString secrecyName( int ); /** Sets the incidence status to a standard status value. See @@ -338,7 +338,7 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ @param status non-standard status string. If empty, the incidence status will be set to StatusNone. */ - void setCustomStatus( const QString &status ); + void setCustomStatus( const TQString &status ); /** Return the event's status. */ @@ -346,11 +346,11 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ /** Return the event's status string. */ - QString statusStr() const; + TQString statusStr() const; /** Return human-readable translated name of status value. */ - static QString statusName( Status ); + static TQString statusName( Status ); // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -360,11 +360,11 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ /** Set resources used, such as Office, Car, etc. */ - void setResources( const QStringList &resources ); + void setResources( const TQStringList &resources ); /** Return list of current resources. */ - QStringList resources() const; + TQStringList resources() const; /** Set the incidences priority. The priority has to be a value between 0 and @@ -418,11 +418,11 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ /** Set the event's/todo's location. Do _not_ use it with journal. */ - void setLocation(const QString &location); + void setLocation(const TQString &location); /** Return the event's/todo's location. Do _not_ use it with journal. */ - QString location() const; + TQString location() const; /** Set the event's/todo's scheduling ID. Does not make sense for journals. @@ -433,12 +433,12 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ end up with more than one resource having events with the same UID, if you have access to other peoples resources. */ - void setSchedulingID( const QString& sid ); + void setSchedulingID( const TQString& sid ); /** Return the event's/todo's scheduling ID. Does not make sense for journals If this is not set, it will return uid(). */ - QString schedulingID() const; + TQString schedulingID() const; /** Observer interface for the recurrence class. If the recurrence is changed, this method will be called for the incidence the recurrence object @@ -448,23 +448,23 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ /** Return the end date/time of the base incidence (e.g. due date/time for to-dos, end date/time for events). This method needs to be reimplemented by derived classes. */ - virtual QDateTime endDateRecurrenceBase() const { return dtStart(); } + virtual TQDateTime endDateRecurrenceBase() const { return dtStart(); } private: int mRevision; // base components of jounal, event and todo - QDateTime mCreated; - QString mDescription; - QString mSummary; - QStringList mCategories; + TQDateTime mCreated; + TQString mDescription; + TQString mSummary; + TQStringList mCategories; Incidence *mRelatedTo; - QString mRelatedToUid; + TQString mRelatedToUid; Incidence::List mRelations; Attachment::List mAttachments; - QStringList mResources; + TQStringList mResources; - QString mStatusString; + TQString mStatusString; Status mStatus; int mSecrecy; int mPriority; // 1 = highest, 2 = less, etc. @@ -472,10 +472,10 @@ class LIBKCAL_EXPORT Incidence : public IncidenceBase, public Recurrence::Observ Alarm::List mAlarms; Recurrence *mRecurrence; - QString mLocation; + TQString mLocation; // Scheduling ID - used only to identify between scheduling mails - QString mSchedulingID; + TQString mSchedulingID; class Private; Private *d; diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 4777e5c4f..2aeba830f 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -127,32 +127,32 @@ bool IncidenceBase::operator==( const IncidenceBase& i2 ) const -void IncidenceBase::setUid(const QString &uid) +void IncidenceBase::setUid(const TQString &uid) { mUid = uid; updated(); } -QString IncidenceBase::uid() const +TQString IncidenceBase::uid() const { return mUid; } -void IncidenceBase::setLastModified(const QDateTime &lm) +void IncidenceBase::setLastModified(const TQDateTime &lm) { // DON'T! updated() because we call this from // Calendar::updateEvent(). // Remove milliseconds part. - QDateTime current = lm; - QTime t = current.time(); + TQDateTime current = lm; + TQTime t = current.time(); t.setHMS( t.hour(), t.minute(), t.second(), 0 ); current.setTime( t ); mLastModified = current; } -QDateTime IncidenceBase::lastModified() const +TQDateTime IncidenceBase::lastModified() const { return mLastModified; } @@ -167,9 +167,9 @@ void IncidenceBase::setOrganizer( const Person &o ) updated(); } -void IncidenceBase::setOrganizer(const QString &o) +void IncidenceBase::setOrganizer(const TQString &o) { - QString mail( o ); + TQString mail( o ); if ( mail.startsWith("MAILTO:", false) ) mail = mail.remove( 0, 7 ); // split the string into full name plus email. @@ -187,29 +187,29 @@ void IncidenceBase::setReadOnly( bool readOnly ) mReadOnly = readOnly; } -void IncidenceBase::setDtStart(const QDateTime &dtStart) +void IncidenceBase::setDtStart(const TQDateTime &dtStart) { // if (mReadOnly) return; mDtStart = dtStart; updated(); } -QDateTime IncidenceBase::dtStart() const +TQDateTime IncidenceBase::dtStart() const { return mDtStart; } -QString IncidenceBase::dtStartTimeStr() const +TQString IncidenceBase::dtStartTimeStr() const { return KGlobal::locale()->formatTime(dtStart().time()); } -QString IncidenceBase::dtStartDateStr(bool shortfmt) const +TQString IncidenceBase::dtStartDateStr(bool shortfmt) const { return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); } -QString IncidenceBase::dtStartStr() const +TQString IncidenceBase::dtStartStr() const { return KGlobal::locale()->formatDateTime(dtStart()); } @@ -228,15 +228,15 @@ void IncidenceBase::setFloats(bool f) } -void IncidenceBase::addComment(const QString& comment) +void IncidenceBase::addComment(const TQString& comment) { mComments += comment; } -bool IncidenceBase::removeComment( const QString& comment) +bool IncidenceBase::removeComment( const TQString& comment) { bool found = false; - QStringList::Iterator i; + TQStringList::Iterator i; for ( i = mComments.begin(); !found && i != mComments.end(); ++i ) { if ( (*i) == comment ) { @@ -253,7 +253,7 @@ void IncidenceBase::clearComments() mComments.clear(); } -QStringList IncidenceBase::comments() const +TQStringList IncidenceBase::comments() const { return mComments; } @@ -298,7 +298,7 @@ void IncidenceBase::clearAttendees() mAttendees.clear(); } -Attendee *IncidenceBase::attendeeByMail( const QString &email ) const +Attendee *IncidenceBase::attendeeByMail( const TQString &email ) const { Attendee::List::ConstIterator it; for( it = mAttendees.begin(); it != mAttendees.end(); ++it ) { @@ -308,15 +308,15 @@ Attendee *IncidenceBase::attendeeByMail( const QString &email ) const return 0; } -Attendee *IncidenceBase::attendeeByMails( const QStringList &emails, - const QString &email) const +Attendee *IncidenceBase::attendeeByMails( const TQStringList &emails, + const TQString &email) const { - QStringList mails = emails; + TQStringList mails = emails; if ( !email.isEmpty() ) mails.append( email ); Attendee::List::ConstIterator itA; for( itA = mAttendees.begin(); itA != mAttendees.end(); ++itA ) { - for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) { + for ( TQStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) { if ( (*itA)->email() == (*it) ) return *itA; } } @@ -324,7 +324,7 @@ Attendee *IncidenceBase::attendeeByMails( const QStringList &emails, return 0; } -Attendee *IncidenceBase::attendeeByUid( const QString &uid ) const +Attendee *IncidenceBase::attendeeByUid( const TQString &uid ) const { Attendee::List::ConstIterator it; for( it = mAttendees.begin(); it != mAttendees.end(); ++it ) { @@ -400,7 +400,7 @@ void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer ) void IncidenceBase::updated() { - QPtrListIterator it(mObservers); + TQPtrListIterator it(mObservers); while( it.current() ) { Observer *o = it.current(); ++it; @@ -415,7 +415,7 @@ void IncidenceBase::customPropertyUpdated() void IncidenceBase::updatedSilent() { - QPtrListIterator it(mObservers); + TQPtrListIterator it(mObservers); while( it.current() ) { Observer *o = it.current(); ++it; diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index 1cccb4dde..72455b432 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h @@ -22,18 +22,18 @@ #ifndef KCAL_INCIDENCEBASE_H #define KCAL_INCIDENCEBASE_H -#include -#include -#include -#include +#include +#include +#include +#include #include "customproperties.h" #include "attendee.h" namespace KCal { -typedef QValueList DateList; -typedef QValueList DateTimeList; +typedef TQValueList DateList; +typedef TQValueList DateTimeList; class Event; class Todo; class Journal; @@ -106,21 +106,21 @@ class LIBKCAL_EXPORT IncidenceBase : public CustomProperties */ virtual bool accept(Visitor &) { return false; } - virtual QCString type() const = 0; + virtual TQCString type() const = 0; /** Set the unique id for the event */ - void setUid( const QString & ); + void setUid( const TQString & ); /** Return the unique id for the event */ - QString uid() const; + TQString uid() const; /** Sets the time the incidence was last modified. */ - void setLastModified( const QDateTime &lm ); + void setLastModified( const TQDateTime &lm ); /** Return the time the incidence was last modified. */ - QDateTime lastModified() const; + TQDateTime lastModified() const; /** sets the organizer for the event */ void setOrganizer( const Person &o ); - void setOrganizer( const QString &o ); + void setOrganizer( const TQString &o ); Person organizer() const; /** Set readonly status. */ @@ -128,19 +128,19 @@ class LIBKCAL_EXPORT IncidenceBase : public CustomProperties /** Return if the object is read-only. */ bool isReadOnly() const { return mReadOnly; } - /** for setting the event's starting date/time with a QDateTime. */ - virtual void setDtStart( const QDateTime &dtStart ); - /** returns an event's starting date/time as a QDateTime. */ - virtual QDateTime dtStart() const; + /** for setting the event's starting date/time with a TQDateTime. */ + virtual void setDtStart( const TQDateTime &dtStart ); + /** returns an event's starting date/time as a TQDateTime. */ + virtual TQDateTime dtStart() const; /** returns an event's starting time as a string formatted according to the users locale settings */ - virtual QString dtStartTimeStr() const; + virtual TQString dtStartTimeStr() const; /** returns an event's starting date as a string formatted according to the users locale settings */ - virtual QString dtStartDateStr( bool shortfmt = true ) const; + virtual TQString dtStartDateStr( bool shortfmt = true ) const; /** returns an event's starting date and time as a string formatted according to the users locale settings */ - virtual QString dtStartStr() const; + virtual TQString dtStartStr() const; virtual void setDuration( int seconds ); int duration() const; @@ -164,7 +164,7 @@ class LIBKCAL_EXPORT IncidenceBase : public CustomProperties * * @param comment The comment to add. */ - void addComment(const QString& comment); + void addComment(const TQString& comment); /** * Remove a comment from the event. @@ -174,13 +174,13 @@ class LIBKCAL_EXPORT IncidenceBase : public CustomProperties * * @return true if match found, false otherwise. */ - bool removeComment( const QString& comment ); + bool removeComment( const TQString& comment ); /** Delete all comments associated with this incidence. */ void clearComments(); /** Return all comments associated with this incidence. */ - QStringList comments() const; + TQStringList comments() const; /** Add Attendee to this incidence. IncidenceBase takes ownership of the @@ -205,16 +205,16 @@ class LIBKCAL_EXPORT IncidenceBase : public CustomProperties /** Return the Attendee with this email address. */ - Attendee *attendeeByMail( const QString & ) const; + Attendee *attendeeByMail( const TQString & ) const; /** Return first Attendee with one of the given email addresses. */ - Attendee *attendeeByMails( const QStringList &, - const QString &email = QString::null ) const; + Attendee *attendeeByMails( const TQStringList &, + const TQString &email = TQString::null ) const; /** Return attendee with given uid. */ - Attendee *attendeeByUid( const QString &uid ) const; + Attendee *attendeeByUid( const TQString &uid ) const; /** Pilot synchronization states @@ -266,12 +266,12 @@ class LIBKCAL_EXPORT IncidenceBase : public CustomProperties private: // base components - QDateTime mDtStart; + TQDateTime mDtStart; Person mOrganizer; - QString mUid; - QDateTime mLastModified; + TQString mUid; + TQDateTime mLastModified; Attendee::List mAttendees; - QStringList mComments; + TQStringList mComments; bool mFloats; @@ -282,7 +282,7 @@ class LIBKCAL_EXPORT IncidenceBase : public CustomProperties unsigned long mPilotId; // unique id for pilot sync int mSyncStatus; // status (for sync) - QPtrList mObservers; + TQPtrList mObservers; class Private; Private *d; diff --git a/libkcal/incidenceformatter.cpp b/libkcal/incidenceformatter.cpp index 766906fd8..877d8860d 100644 --- a/libkcal/incidenceformatter.cpp +++ b/libkcal/incidenceformatter.cpp @@ -48,9 +48,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include @@ -62,24 +62,24 @@ using namespace KCal; * Helper functions for the extensive display (event viewer) *******************************************************************/ -static QString eventViewerAddLink( const QString &ref, const QString &text, +static TQString eventViewerAddLink( const TQString &ref, const TQString &text, bool newline = true ) { - QString tmpStr( "" + text + "" ); + TQString tmpStr( "" + text + "" ); if ( newline ) tmpStr += "\n"; return tmpStr; } -static QString eventViewerAddTag( const QString & tag, const QString & text ) +static TQString eventViewerAddTag( const TQString & tag, const TQString & text ) { int numLineBreaks = text.contains( "\n" ); - QString str = "<" + tag + ">"; - QString tmpText = text; - QString tmpStr = str; + TQString str = "<" + tag + ">"; + TQString tmpText = text; + TQString tmpStr = str; if( numLineBreaks >= 0 ) { if ( numLineBreaks > 0) { int pos = 0; - QString tmp; + TQString tmp; for( int i = 0; i <= numLineBreaks; i++ ) { pos = tmpText.find( "\n" ); tmp = tmpText.left( pos ); @@ -94,7 +94,7 @@ static QString eventViewerAddTag( const QString & tag, const QString & text ) return tmpStr; } -static QString linkPerson( const QString& email, QString name, QString uid ) +static TQString linkPerson( const TQString& email, TQString name, TQString uid ) { // Make the search, if there is an email address to search on, // and either name or uid is missing @@ -109,12 +109,12 @@ static QString linkPerson( const QString& email, QString name, QString uid ) uid = o.uid(); } else // Email not found in the addressbook. Don't make a link - uid = QString::null; + uid = TQString::null; } kdDebug(5850) << "formatAttendees: uid = " << uid << endl; // Show the attendee - QString tmpString = "
  • "; + TQString tmpString = "
  • "; if ( !uid.isEmpty() ) { // There is a UID, so make a link to the addressbook if ( name.isEmpty() ) @@ -134,16 +134,16 @@ static QString linkPerson( const QString& email, QString name, QString uid ) KURL mailto; mailto.setProtocol( "mailto" ); mailto.setPath( person.fullName() ); - tmpString += eventViewerAddLink( mailto.url(), QString::null ); + tmpString += eventViewerAddLink( mailto.url(), TQString::null ); } tmpString += "
  • \n"; return tmpString; } -static QString eventViewerFormatAttendees( Incidence *event ) +static TQString eventViewerFormatAttendees( Incidence *event ) { - QString tmpStr; + TQString tmpStr; Attendee::List attendees = event->attendees(); if ( attendees.count() ) { @@ -151,7 +151,7 @@ static QString eventViewerFormatAttendees( Incidence *event ) tmpStr += eventViewerAddTag( "i", i18n("Organizer") ); tmpStr += "
      "; tmpStr += linkPerson( event->organizer().email(), - event->organizer().name(), QString::null ); + event->organizer().name(), TQString::null ); tmpStr += "
    "; // Add attendees links @@ -173,15 +173,15 @@ static QString eventViewerFormatAttendees( Incidence *event ) return tmpStr; } -static QString eventViewerFormatAttachments( Incidence *i ) +static TQString eventViewerFormatAttachments( Incidence *i ) { - QString tmpStr; + TQString tmpStr; Attachment::List as = i->attachments(); if ( as.count() > 0 ) { Attachment::List::ConstIterator it; for( it = as.begin(); it != as.end(); ++it ) { if ( (*it)->isUri() ) { - QString name; + TQString name; if ( (*it)->uri().startsWith( "kmail:" ) ) name = i18n( "Show mail" ); else @@ -198,16 +198,16 @@ static QString eventViewerFormatAttachments( Incidence *i ) FIXME:This function depends of kaddressbook. Is necessary a new type of event? */ -static QString eventViewerFormatBirthday( Event *event ) +static TQString eventViewerFormatBirthday( Event *event ) { - if ( !event) return QString::null; - if ( event->customProperty("KABC","BIRTHDAY") != "YES" ) return QString::null; + if ( !event) return TQString::null; + if ( event->customProperty("KABC","BIRTHDAY") != "YES" ) return TQString::null; - QString uid = event->customProperty("KABC","UID-1"); - QString name = event->customProperty("KABC","NAME-1"); - QString email= event->customProperty("KABC","EMAIL-1"); + TQString uid = event->customProperty("KABC","UID-1"); + TQString name = event->customProperty("KABC","NAME-1"); + TQString email= event->customProperty("KABC","EMAIL-1"); - QString tmpString = "
      "; + TQString tmpString = "
        "; tmpString += linkPerson( email, name, uid ); if ( event->customProperty( "KABC", "ANNIVERSARY") == "YES" ) { @@ -221,9 +221,9 @@ static QString eventViewerFormatBirthday( Event *event ) return tmpString; } -static QString eventViewerFormatHeader( Incidence *incidence ) +static TQString eventViewerFormatHeader( Incidence *incidence ) { - QString tmpStr = ""; + TQString tmpStr = "
        "; // show icons { @@ -272,10 +272,10 @@ static QString eventViewerFormatHeader( Incidence *incidence ) return tmpStr; } -static QString eventViewerFormatEvent( Event *event ) +static TQString eventViewerFormatEvent( Event *event ) { - if ( !event ) return QString::null; - QString tmpStr = eventViewerFormatHeader( event ); + if ( !event ) return TQString::null; + TQString tmpStr = eventViewerFormatHeader( event ); tmpStr += "
        "; @@ -344,8 +344,8 @@ static QString eventViewerFormatEvent( Event *event ) } if ( event->doesRecur() ) { - QDateTime dt = - event->recurrence()->getNextDateTime( QDateTime::currentDateTime() ); + TQDateTime dt = + event->recurrence()->getNextDateTime( TQDateTime::currentDateTime() ); tmpStr += ""; tmpStr += ""; if ( !event->doesFloat() ) { @@ -379,10 +379,10 @@ static QString eventViewerFormatEvent( Event *event ) return tmpStr; } -static QString eventViewerFormatTodo( Todo *todo ) +static TQString eventViewerFormatTodo( Todo *todo ) { - if ( !todo ) return QString::null; - QString tmpStr = eventViewerFormatHeader( todo ); + if ( !todo ) return TQString::null; + TQString tmpStr = eventViewerFormatHeader( todo ); tmpStr += "
        " + i18n( "Next on" ) + "
        "; @@ -425,7 +425,7 @@ static QString eventViewerFormatTodo( Todo *todo ) tmpStr += ""; tmpStr += ""; if ( todo->priority() > 0 ) { - tmpStr += ""; + tmpStr += ""; } else { tmpStr += ""; } @@ -437,8 +437,8 @@ static QString eventViewerFormatTodo( Todo *todo ) tmpStr += ""; if ( todo->doesRecur() ) { - QDateTime dt = - todo->recurrence()->getNextDateTime( QDateTime::currentDateTime() ); + TQDateTime dt = + todo->recurrence()->getNextDateTime( TQDateTime::currentDateTime() ); tmpStr += ""; tmpStr += ""; if ( !todo->doesFloat() ) { @@ -472,11 +472,11 @@ static QString eventViewerFormatTodo( Todo *todo ) return tmpStr; } -static QString eventViewerFormatJournal( Journal *journal ) +static TQString eventViewerFormatJournal( Journal *journal ) { - if ( !journal ) return QString::null; + if ( !journal ) return TQString::null; - QString tmpStr; + TQString tmpStr; if ( !journal->summary().isEmpty() ) { tmpStr += eventViewerAddTag( "u", eventViewerAddTag( "b", journal->summary() ) ); @@ -487,11 +487,11 @@ static QString eventViewerFormatJournal( Journal *journal ) return tmpStr; } -static QString eventViewerFormatFreeBusy( FreeBusy *fb ) +static TQString eventViewerFormatFreeBusy( FreeBusy *fb ) { - if ( !fb ) return QString::null; + if ( !fb ) return TQString::null; - QString tmpStr = + TQString tmpStr = eventViewerAddTag( "u", eventViewerAddTag( "b", i18n("Free/Busy information for %1") .arg( fb->organizer().fullName() ) ) ); @@ -499,15 +499,15 @@ static QString eventViewerFormatFreeBusy( FreeBusy *fb ) .arg( KGlobal::locale()->formatDate( fb->dtStart().date(), true ) ) .arg( KGlobal::locale()->formatDate( fb->dtEnd().date(), true ) ) ); - QValueList periods = fb->busyPeriods(); + TQValueList periods = fb->busyPeriods(); - QString text = eventViewerAddTag( "em", eventViewerAddTag( "b", i18n("Busy:") ) ); - QValueList::iterator it; + TQString text = eventViewerAddTag( "em", eventViewerAddTag( "b", i18n("Busy:") ) ); + TQValueList::iterator it; for ( it = periods.begin(); it != periods.end(); ++it ) { Period per = *it; if ( per.hasDuration() ) { int dur = per.duration().asSeconds(); - QString cont; + TQString cont; if ( dur >= 3600 ) { cont += i18n("1 hour ", "%n hours ", dur / 3600 ); dur %= 3600; @@ -546,7 +546,7 @@ class IncidenceFormatter::EventViewerVisitor : public IncidenceBase::Visitor public: EventViewerVisitor() { mResult = ""; } bool act( IncidenceBase *incidence ) { return incidence->accept( *this ); } - QString result() const { return mResult; } + TQString result() const { return mResult; } protected: bool visit( Event *event ) { @@ -570,17 +570,17 @@ class IncidenceFormatter::EventViewerVisitor : public IncidenceBase::Visitor } protected: - QString mResult; + TQString mResult; }; -QString IncidenceFormatter::extensiveDisplayString( IncidenceBase *incidence ) +TQString IncidenceFormatter::extensiveDisplayString( IncidenceBase *incidence ) { - if ( !incidence ) return QString::null; + if ( !incidence ) return TQString::null; EventViewerVisitor v; if ( v.act( incidence ) ) { return v.result(); } else - return QString::null; + return TQString::null; } @@ -590,14 +590,14 @@ QString IncidenceFormatter::extensiveDisplayString( IncidenceBase *incidence ) * Helper functions for the body part formatter of kmail *******************************************************************/ -static QString string2HTML( const QString& str ) +static TQString string2HTML( const TQString& str ) { - return QStyleSheet::convertFromPlainText(str, QStyleSheetItem::WhiteSpaceNormal); + return TQStyleSheet::convertFromPlainText(str, TQStyleSheetItem::WhiteSpaceNormal); } -static QString eventStartTimeStr( Event *event ) +static TQString eventStartTimeStr( Event *event ) { - QString tmp; + TQString tmp; if ( ! event->doesFloat() ) { tmp = i18n("%1: Start Date, %2: Start Time", "%1 %2") .arg( event->dtStartDateStr(), event->dtStartTimeStr() ); @@ -608,9 +608,9 @@ static QString eventStartTimeStr( Event *event ) return tmp; } -static QString eventEndTimeStr( Event *event ) +static TQString eventEndTimeStr( Event *event ) { - QString tmp; + TQString tmp; if ( event->hasEndDate() ) { if ( ! event->doesFloat() ) { tmp = i18n("%1: End Date, %2: End Time", "%1 %2") @@ -625,21 +625,21 @@ static QString eventEndTimeStr( Event *event ) return tmp; } -static QString invitationRow( const QString &cell1, const QString &cell2 ) +static TQString invitationRow( const TQString &cell1, const TQString &cell2 ) { return "\n"; } -static QString invitationsDetailsIncidence( Incidence *incidence ) +static TQString invitationsDetailsIncidence( Incidence *incidence ) { - QString html; - QString descr = incidence->description(); + TQString html; + TQString descr = incidence->description(); if( !descr.isEmpty() ) { html += "
        " + i18n("Description:") + "
        " + i18n( "Priority" ) + "" + QString::number( todo->priority() ) + "" + TQString::number( todo->priority() ) + "" + i18n( "Unspecified" ) + "
        " + i18n( "Next on" ) + "
        " + cell1 + "" + cell2 + "
         "; html += string2HTML(descr) + "
        "; } - QStringList comments = incidence->comments(); + TQStringList comments = incidence->comments(); if ( !comments.isEmpty() ) { html += "
        " + i18n("Comments:") + "
         
          "; @@ -650,27 +650,27 @@ static QString invitationsDetailsIncidence( Incidence *incidence ) return html; } -static QString invitationDetailsEvent( Event* event ) +static TQString invitationDetailsEvent( Event* event ) { // Meeting details are formatted into an HTML table if ( !event ) - return QString::null; + return TQString::null; - QString html; - QString tmp; + TQString html; + TQString tmp; - QString sSummary = i18n( "Summary unspecified" ); + TQString sSummary = i18n( "Summary unspecified" ); if ( ! event->summary().isEmpty() ) { sSummary = string2HTML( event->summary() ); } - QString sLocation = i18n( "Location unspecified" ); + TQString sLocation = i18n( "Location unspecified" ); if ( ! event->location().isEmpty() ) { sLocation = string2HTML( event->location() ); } - QString dir = ( QApplication::reverseLayout() ? "rtl" : "ltr" ); - html = QString("
          \n").arg(dir); + TQString dir = ( TQApplication::reverseLayout() ? "rtl" : "ltr" ); + html = TQString("
          \n").arg(dir); html += "\n"; @@ -686,8 +686,8 @@ static QString invitationDetailsEvent( Event* event ) // Meeting Duration Row if ( !event->doesFloat() && event->hasEndDate() ) { - tmp = QString::null; - QTime sDuration(0,0,0), t; + tmp = TQString::null; + TQTime sDuration(0,0,0), t; int secs = event->dtStart().secsTo( event->dtEnd() ); t = sDuration.addSecs( secs ); if ( t.hour() > 0 ) { @@ -707,21 +707,21 @@ static QString invitationDetailsEvent( Event* event ) return html; } -static QString invitationDetailsTodo( Todo *todo ) +static TQString invitationDetailsTodo( Todo *todo ) { // Task details are formatted into an HTML table if ( !todo ) - return QString::null; + return TQString::null; - QString sSummary = i18n( "Summary unspecified" ); - QString sDescr = i18n( "Description unspecified" ); + TQString sSummary = i18n( "Summary unspecified" ); + TQString sDescr = i18n( "Description unspecified" ); if ( ! todo->summary().isEmpty() ) { sSummary = todo->summary(); } if ( ! todo->description().isEmpty() ) { sDescr = todo->description(); } - QString html( "
          \n" ); + TQString html( "
          \n" ); html += invitationRow( i18n( "Summary:" ), sSummary ); html += invitationRow( i18n( "Description:" ), sDescr ); html += "
          \n"; @@ -730,20 +730,20 @@ static QString invitationDetailsTodo( Todo *todo ) return html; } -static QString invitationDetailsJournal( Journal *journal ) +static TQString invitationDetailsJournal( Journal *journal ) { if ( !journal ) - return QString::null; + return TQString::null; - QString sSummary = i18n( "Summary unspecified" ); - QString sDescr = i18n( "Description unspecified" ); + TQString sSummary = i18n( "Summary unspecified" ); + TQString sDescr = i18n( "Description unspecified" ); if ( ! journal->summary().isEmpty() ) { sSummary = journal->summary(); } if ( ! journal->description().isEmpty() ) { sDescr = journal->description(); } - QString html( "\n" ); + TQString html( "
          \n" ); html += invitationRow( i18n( "Summary:" ), sSummary ); html += invitationRow( i18n( "Date:" ), journal->dtStartDateStr( false ) ); html += invitationRow( i18n( "Description:" ), sDescr ); @@ -753,11 +753,11 @@ static QString invitationDetailsJournal( Journal *journal ) return html; } -static QString invitationDetailsFreeBusy( FreeBusy *fb ) +static TQString invitationDetailsFreeBusy( FreeBusy *fb ) { if ( !fb ) - return QString::null; - QString html( "
          \n" ); + return TQString::null; + TQString html( "
          \n" ); html += invitationRow( i18n("Person:"), fb->organizer().fullName() ); html += invitationRow( i18n("Start date:"), fb->dtStartDateStr() ); @@ -766,14 +766,14 @@ static QString invitationDetailsFreeBusy( FreeBusy *fb ) html += "\n"; html += "\n"; - QValueList periods = fb->busyPeriods(); + TQValueList periods = fb->busyPeriods(); - QValueList::iterator it; + TQValueList::iterator it; for ( it = periods.begin(); it != periods.end(); ++it ) { Period per = *it; if ( per.hasDuration() ) { int dur = per.duration().asSeconds(); - QString cont; + TQString cont; if ( dur >= 3600 ) { cont += i18n("1 hour ", "%n hours ", dur / 3600); dur %= 3600; @@ -785,11 +785,11 @@ static QString invitationDetailsFreeBusy( FreeBusy *fb ) if ( dur > 0 ) { cont += i18n("1 second", "%n seconds", dur); } - html += invitationRow( QString::null, i18n("startDate for duration", "%1 for %2") + html += invitationRow( TQString::null, i18n("startDate for duration", "%1 for %2") .arg( KGlobal::locale()->formatDateTime( per.start(), false ) ) .arg(cont) ); } else { - QString cont; + TQString cont; if ( per.start().date() == per.end().date() ) { cont = i18n("date, fromTime - toTime ", "%1, %2 - %3") .arg( KGlobal::locale()->formatDate( per.start().date() ) ) @@ -801,7 +801,7 @@ static QString invitationDetailsFreeBusy( FreeBusy *fb ) .arg( KGlobal::locale()->formatDateTime( per.end(), false ) ); } - html += invitationRow( QString::null, cont ); + html += invitationRow( TQString::null, cont ); } } @@ -809,10 +809,10 @@ static QString invitationDetailsFreeBusy( FreeBusy *fb ) return html; } -static QString invitationHeaderEvent( Event *event, ScheduleMessage *msg ) +static TQString invitationHeaderEvent( Event *event, ScheduleMessage *msg ) { if ( !msg || !event ) - return QString::null; + return TQString::null; switch ( msg->method() ) { case Scheduler::Publish: return i18n("This event has been published"); @@ -830,19 +830,19 @@ static QString invitationHeaderEvent( Event *event, ScheduleMessage *msg ) Attendee::List attendees = event->attendees(); if( attendees.count() == 0 ) { kdDebug(5850) << "No attendees in the iCal reply!\n"; - return QString::null; + return TQString::null; } if( attendees.count() != 1 ) kdDebug(5850) << "Warning: attendeecount in the reply should be 1 " << "but is " << attendees.count() << endl; Attendee* attendee = *attendees.begin(); - QString attendeeName = attendee->name(); + TQString attendeeName = attendee->name(); if ( attendeeName.isEmpty() ) attendeeName = attendee->email(); if ( attendeeName.isEmpty() ) attendeeName = i18n( "Sender" ); - QString delegatorName, dummy; + TQString delegatorName, dummy; KPIM::getNameAndMail( attendee->delegator(), delegatorName, dummy ); if ( delegatorName.isEmpty() ) delegatorName = attendee->delegator(); @@ -866,7 +866,7 @@ static QString invitationHeaderEvent( Event *event, ScheduleMessage *msg ) return i18n( "%1 declines this meeting invitation on behalf of %2" ) .arg( attendeeName ).arg( delegatorName ); case Attendee::Delegated: { - QString delegate, dummy; + TQString delegate, dummy; KPIM::getNameAndMail( attendee->delegate(), delegate, dummy ); if ( delegate.isEmpty() ) delegate = attendee->delegate(); @@ -891,13 +891,13 @@ static QString invitationHeaderEvent( Event *event, ScheduleMessage *msg ) return i18n("Error: iMIP message with unknown method: '%1'") .arg( msg->method() ); } - return QString::null; + return TQString::null; } -static QString invitationHeaderTodo( Todo *todo, ScheduleMessage *msg ) +static TQString invitationHeaderTodo( Todo *todo, ScheduleMessage *msg ) { if ( !msg || !todo ) - return QString::null; + return TQString::null; switch ( msg->method() ) { case Scheduler::Publish: return i18n("This task has been published"); @@ -915,7 +915,7 @@ static QString invitationHeaderTodo( Todo *todo, ScheduleMessage *msg ) Attendee::List attendees = todo->attendees(); if( attendees.count() == 0 ) { kdDebug(5850) << "No attendees in the iCal reply!\n"; - return QString::null; + return TQString::null; } if( attendees.count() != 1 ) kdDebug(5850) << "Warning: attendeecount in the reply should be 1 " @@ -932,7 +932,7 @@ static QString invitationHeaderTodo( Todo *todo, ScheduleMessage *msg ) case Attendee::Declined: return i18n( "Sender declines this task" ); case Attendee::Delegated: { - QString delegate, dummy; + TQString delegate, dummy; KPIM::getNameAndMail( attendee->delegate(), delegate, dummy ); if ( delegate.isEmpty() ) delegate = attendee->delegate(); @@ -956,14 +956,14 @@ static QString invitationHeaderTodo( Todo *todo, ScheduleMessage *msg ) return i18n("Error: iMIP message with unknown method: '%1'") .arg( msg->method() ); } - return QString::null; + return TQString::null; } -static QString invitationHeaderJournal( Journal *journal, ScheduleMessage *msg ) +static TQString invitationHeaderJournal( Journal *journal, ScheduleMessage *msg ) { // TODO: Several of the methods are not allowed for journals, so remove them. if ( !msg || !journal ) - return QString::null; + return TQString::null; switch ( msg->method() ) { case Scheduler::Publish: return i18n("This journal has been published"); @@ -979,7 +979,7 @@ static QString invitationHeaderJournal( Journal *journal, ScheduleMessage *msg ) Attendee::List attendees = journal->attendees(); if( attendees.count() == 0 ) { kdDebug(5850) << "No attendees in the iCal reply!\n"; - return QString::null; + return TQString::null; } if( attendees.count() != 1 ) kdDebug(5850) << "Warning: attendeecount in the reply should be 1 " @@ -1013,13 +1013,13 @@ static QString invitationHeaderJournal( Journal *journal, ScheduleMessage *msg ) return i18n("Error: iMIP message with unknown method: '%1'") .arg( msg->method() ); } - return QString::null; + return TQString::null; } -static QString invitationHeaderFreeBusy( FreeBusy *fb, ScheduleMessage *msg ) +static TQString invitationHeaderFreeBusy( FreeBusy *fb, ScheduleMessage *msg ) { if ( !msg || !fb ) - return QString::null; + return TQString::null; switch ( msg->method() ) { case Scheduler::Publish: return i18n("This free/busy list has been published"); @@ -1043,10 +1043,10 @@ class IncidenceFormatter::ScheduleMessageVisitor : public IncidenceBase::Visitor public: ScheduleMessageVisitor() : mMessage(0) { mResult = ""; } bool act( IncidenceBase *incidence, ScheduleMessage *msg ) { mMessage = msg; return incidence->accept( *this ); } - QString result() const { return mResult; } + TQString result() const { return mResult; } protected: - QString mResult; + TQString mResult; ScheduleMessage *mMessage; }; @@ -1113,11 +1113,11 @@ class IncidenceFormatter::IncidenceCompareVisitor : return incidence->accept( *this ); } - QString result() const + TQString result() const { if ( mChanges.isEmpty() ) - return QString(); - QString html = "
          • "; + return TQString(); + TQString html = "
            • "; html += mChanges.join( "
            • " ); html += "
              "; return html; @@ -1190,13 +1190,13 @@ class IncidenceFormatter::IncidenceCompareVisitor : private: Incidence* mExistingIncidence; - QStringList mChanges; + TQStringList mChanges; }; -QString InvitationFormatterHelper::makeLink( const QString &id, const QString &text ) +TQString InvitationFormatterHelper::makeLink( const TQString &id, const TQString &text ) { - QString res( "%2" ); + TQString res( "%2" ); return res.arg( generateLinkURL( id ) ).arg( text ); return res; } @@ -1211,16 +1211,16 @@ static bool incidenceOwnedByMe( Calendar* calendar, Incidence *incidence ) ResourceCalendar* res = cal->resource( incidence ); if ( !res ) return true; - const QString subRes = res->subresourceIdentifier( incidence ); + const TQString subRes = res->subresourceIdentifier( incidence ); if ( !subRes.contains( "/.INBOX.directory/" ) ) return false; return true; } -QString IncidenceFormatter::formatICalInvitation( QString invitation, Calendar *mCalendar, +TQString IncidenceFormatter::formatICalInvitation( TQString invitation, Calendar *mCalendar, InvitationFormatterHelper *helper ) { - if ( invitation.isEmpty() ) return QString::null; + if ( invitation.isEmpty() ) return TQString::null; ICalFormat format; // parseScheduleMessage takes the tz from the calendar, no need to set it manually here for the format! @@ -1230,7 +1230,7 @@ QString IncidenceFormatter::formatICalInvitation( QString invitation, Calendar * kdDebug( 5850 ) << "Failed to parse the scheduling message" << endl; Q_ASSERT( format.exception() ); kdDebug( 5850 ) << format.exception()->message() << endl; - return QString::null; + return TQString::null; } IncidenceBase *incBase = msg->event(); @@ -1252,11 +1252,11 @@ QString IncidenceFormatter::formatICalInvitation( QString invitation, Calendar * } // First make the text of the message - QString html; + TQString html; - QString tableStyle = QString::fromLatin1( + TQString tableStyle = TQString::fromLatin1( "style=\"border: solid 1px; margin: 0em;\"" ); - QString tableHead = QString::fromLatin1( + TQString tableHead = TQString::fromLatin1( "
              " "

            Busy periods given in this free/busy object:
            " "
            ").arg(tableStyle); @@ -1265,12 +1265,12 @@ QString IncidenceFormatter::formatICalInvitation( QString invitation, Calendar * InvitationHeaderVisitor headerVisitor; // The InvitationHeaderVisitor returns false if the incidence is somehow invalid, or not handled if ( !headerVisitor.act( incBase, msg ) ) - return QString::null; + return TQString::null; html += "" + headerVisitor.result() + ""; InvitationBodyVisitor bodyVisitor; if ( !bodyVisitor.act( incBase, msg ) ) - return QString::null; + return TQString::null; html += bodyVisitor.result(); if ( msg->method() == Scheduler::Request ) { // ### Scheduler::Publish/Refresh/Add as well? @@ -1382,15 +1382,15 @@ QString IncidenceFormatter::formatICalInvitation( QString invitation, Calendar * //----------------------------------------------------------------------------- -static QString stringProp( KTNEFMessage* tnefMsg, const Q_UINT32& key, - const QString& fallback = QString::null) +static TQString stringProp( KTNEFMessage* tnefMsg, const Q_UINT32& key, + const TQString& fallback = TQString::null) { return tnefMsg->findProp( key < 0x10000 ? key & 0xFFFF : key >> 16, fallback ); } -static QString sNamedProp( KTNEFMessage* tnefMsg, const QString& name, - const QString& fallback = QString::null ) +static TQString sNamedProp( KTNEFMessage* tnefMsg, const TQString& name, + const TQString& fallback = TQString::null ) { return tnefMsg->findNamedProp( name, fallback ); } @@ -1449,7 +1449,7 @@ static void unset_tz( struct save_tz old_tz ) if( old_tz.tz_env_str ) free( old_tz.tz_env_str ); } -static QDateTime utc2Local( const QDateTime& utcdt ) +static TQDateTime utc2Local( const TQDateTime& utcdt ) { struct tm tmL; @@ -1458,16 +1458,16 @@ static QDateTime utc2Local( const QDateTime& utcdt ) unset_tz( tmp_tz ); localtime_r( &utc, &tmL ); - return QDateTime( QDate( tmL.tm_year+1900, tmL.tm_mon+1, tmL.tm_mday ), - QTime( tmL.tm_hour, tmL.tm_min, tmL.tm_sec ) ); + return TQDateTime( TQDate( tmL.tm_year+1900, tmL.tm_mon+1, tmL.tm_mday ), + TQTime( tmL.tm_hour, tmL.tm_min, tmL.tm_sec ) ); } -static QDateTime pureISOToLocalQDateTime( const QString& dtStr, +static TQDateTime pureISOToLocalQDateTime( const TQString& dtStr, bool bDateOnly = false ) { - QDate tmpDate; - QTime tmpTime; + TQDate tmpDate; + TQTime tmpTime; int year, month, day, hour, minute, second; if( bDateOnly ) { @@ -1489,7 +1489,7 @@ static QDateTime pureISOToLocalQDateTime( const QString& dtStr, tmpTime.setHMS( hour, minute, second ); if( tmpDate.isValid() && tmpTime.isValid() ) { - QDateTime dT = QDateTime( tmpDate, tmpTime ); + TQDateTime dT = TQDateTime( tmpDate, tmpTime ); if( !bDateOnly ) { // correct for GMT ( == Zulu time == UTC ) @@ -1501,18 +1501,18 @@ static QDateTime pureISOToLocalQDateTime( const QString& dtStr, } return dT; } else - return QDateTime(); + return TQDateTime(); } -QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) +TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef ) { bool bOk = false; KTNEFParser parser; - QBuffer buf( tnef ); - CalendarLocal cal ( QString::fromLatin1( "UTC" ) ); + TQBuffer buf( tnef ); + CalendarLocal cal ( TQString::fromLatin1( "UTC" ) ); KABC::Addressee addressee; KABC::VCardConverter cardConv; ICalFormat calFormat; @@ -1520,11 +1520,11 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) if( parser.openDevice( &buf ) ) { KTNEFMessage* tnefMsg = parser.message(); - //QMap props = parser.message()->properties(); + //TQMap props = parser.message()->properties(); // Everything depends from property PR_MESSAGE_CLASS // (this is added by KTNEFParser): - QString msgClass = tnefMsg->findProp( 0x001A, QString::null, true ) + TQString msgClass = tnefMsg->findProp( 0x001A, TQString::null, true ) .upper(); if( !msgClass.isEmpty() ) { // Match the old class names that might be used by Outlook for @@ -1553,7 +1553,7 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) if( bCompatClassAppointment || "IPM.APPOINTMENT" == msgClass ) { // Compose a vCal bool bIsReply = false; - QString prodID = "-//Microsoft Corporation//Outlook "; + TQString prodID = "-//Microsoft Corporation//Outlook "; prodID += tnefMsg->findNamedProp( "0x8554", "9.0" ); prodID += "MIMEDIR/EN\n"; prodID += "VERSION:2.0\n"; @@ -1585,7 +1585,7 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) /// ### FIXME Need to get this attribute written ScheduleMessage schedMsg(event, method, ScheduleMessage::Unknown ); - QString sSenderSearchKeyEmail( tnefMsg->findProp( 0x0C1D ) ); + TQString sSenderSearchKeyEmail( tnefMsg->findProp( 0x0C1D ) ); if( !sSenderSearchKeyEmail.isEmpty() ) { int colon = sSenderSearchKeyEmail.find( ':' ); @@ -1594,10 +1594,10 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) sSenderSearchKeyEmail.remove( 0, colon+1 ); } - QString s( tnefMsg->findProp( 0x0e04 ) ); - QStringList attendees = QStringList::split( ';', s ); + TQString s( tnefMsg->findProp( 0x0e04 ) ); + TQStringList attendees = TQStringList::split( ';', s ); if( attendees.count() ) { - for( QStringList::Iterator it = attendees.begin(); + for( TQStringList::Iterator it = attendees.begin(); it != attendees.end(); ++it ) { // Skip all entries that have no '@' since these are // no mail addresses @@ -1624,7 +1624,7 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) // This must be old style, let us use the PR_SENDER_SEARCH_KEY. s = sSenderSearchKeyEmail; if( !s.isEmpty() ) { - Attendee *attendee = new Attendee( QString::null, QString::null, + Attendee *attendee = new Attendee( TQString::null, TQString::null, true ); if( bIsReply ) { if( bCompatMethodAccepted ) @@ -1647,13 +1647,13 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) if( !s.isEmpty() ) event->setOrganizer( s ); - s = tnefMsg->findProp( 0x8516 ).replace( QChar( '-' ), QString::null ) - .replace( QChar( ':' ), QString::null ); - event->setDtStart( QDateTime::fromString( s ) ); // ## Format?? + s = tnefMsg->findProp( 0x8516 ).replace( TQChar( '-' ), TQString::null ) + .replace( TQChar( ':' ), TQString::null ); + event->setDtStart( TQDateTime::fromString( s ) ); // ## Format?? - s = tnefMsg->findProp( 0x8517 ).replace( QChar( '-' ), QString::null ) - .replace( QChar( ':' ), QString::null ); - event->setDtEnd( QDateTime::fromString( s ) ); + s = tnefMsg->findProp( 0x8517 ).replace( TQChar( '-' ), TQString::null ) + .replace( TQChar( ':' ), TQString::null ); + event->setDtEnd( TQDateTime::fromString( s ) ); s = tnefMsg->findProp( 0x8208 ); event->setLocation( s ); @@ -1669,10 +1669,10 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) // PENDING(khz): is this value in local timezone? Must it be // adjusted? Most likely this is a bug in the server or in // Outlook - we ignore it for now. - s = tnefMsg->findProp( 0x8202 ).replace( QChar( '-' ), QString::null ) - .replace( QChar( ':' ), QString::null ); + s = tnefMsg->findProp( 0x8202 ).replace( TQChar( '-' ), TQString::null ) + .replace( TQChar( ':' ), TQString::null ); // ### libkcal always uses currentDateTime() - // event->setDtStamp(QDateTime::fromString(s)); + // event->setDtStamp(TQDateTime::fromString(s)); s = tnefMsg->findNamedProp( "Keywords" ); event->setCategories( s ); @@ -1689,14 +1689,14 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) // is reminder flag set ? if(!tnefMsg->findProp(0x8503).isEmpty()) { Alarm *alarm = new Alarm(event); - QDateTime highNoonTime = + TQDateTime highNoonTime = pureISOToLocalQDateTime( tnefMsg->findProp( 0x8502 ) - .replace( QChar( '-' ), "" ) - .replace( QChar( ':' ), "" ) ); - QDateTime wakeMeUpTime = + .replace( TQChar( '-' ), "" ) + .replace( TQChar( ':' ), "" ) ); + TQDateTime wakeMeUpTime = pureISOToLocalQDateTime( tnefMsg->findProp( 0x8560, "" ) - .replace( QChar( '-' ), "" ) - .replace( QChar( ':' ), "" ) ); + .replace( TQChar( '-' ), "" ) + .replace( TQChar( ':' ), "" ) ); alarm->setTime(wakeMeUpTime); if( highNoonTime.isValid() && wakeMeUpTime.isValid() ) @@ -1727,9 +1727,9 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) addressee.insertCustom( "KADDRESSBOOK", "X-Office", stringProp( tnefMsg, MAPI_TAG_PR_OFFICE_LOCATION ) ); addressee.insertCustom( "KADDRESSBOOK", "X-Profession", stringProp( tnefMsg, MAPI_TAG_PR_PROFESSION ) ); - QString s = tnefMsg->findProp( MAPI_TAG_PR_WEDDING_ANNIVERSARY ) - .replace( QChar( '-' ), QString::null ) - .replace( QChar( ':' ), QString::null ); + TQString s = tnefMsg->findProp( MAPI_TAG_PR_WEDDING_ANNIVERSARY ) + .replace( TQChar( '-' ), TQString::null ) + .replace( TQChar( ':' ), TQString::null ); if( !s.isEmpty() ) addressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", s ); @@ -1782,7 +1782,7 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) // a line looking like the following one: // vPart += "\nADR;TYPE=dom;TYPE=intl;TYPE=parcel;TYPE=postal;TYPE=work;TYPE=home:other_pobox;;other_str1\nother_str2;other_loc;other_region;other_pocode;other_country - QString nr; + TQString nr; nr = stringProp( tnefMsg, MAPI_TAG_PR_HOME_TELEPHONE_NUMBER ); addressee.insertPhoneNumber( KABC::PhoneNumber( nr, KABC::PhoneNumber::Home ) ); nr = stringProp( tnefMsg, MAPI_TAG_PR_BUSINESS_TELEPHONE_NUMBER ); @@ -1795,10 +1795,10 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) addressee.insertPhoneNumber( KABC::PhoneNumber( nr, KABC::PhoneNumber::Fax | KABC::PhoneNumber::Work ) ); s = tnefMsg->findProp( MAPI_TAG_PR_BIRTHDAY ) - .replace( QChar( '-' ), QString::null ) - .replace( QChar( ':' ), QString::null ); + .replace( TQChar( '-' ), TQString::null ) + .replace( TQChar( ':' ), TQString::null ); if( !s.isEmpty() ) - addressee.setBirthday( QDateTime::fromString( s ) ); + addressee.setBirthday( TQDateTime::fromString( s ) ); bOk = ( !addressee.isEmpty() ); } else if( "IPM.NOTE" == msgClass ) { @@ -1808,7 +1808,7 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) } // Compose return string - QString iCal = calFormat.toString( &cal ); + TQString iCal = calFormat.toString( &cal ); if( !iCal.isEmpty() ) // This was an iCal return iCal; @@ -1819,11 +1819,11 @@ QString IncidenceFormatter::msTNEFToVPart( const QByteArray& tnef ) } -QString IncidenceFormatter::formatTNEFInvitation( const QByteArray& tnef, +TQString IncidenceFormatter::formatTNEFInvitation( const TQByteArray& tnef, Calendar *mCalendar, InvitationFormatterHelper *helper ) { - QString vPart = IncidenceFormatter::msTNEFToVPart( tnef ); - QString iCal = IncidenceFormatter::formatICalInvitation( vPart, mCalendar, helper ); + TQString vPart = IncidenceFormatter::msTNEFToVPart( tnef ); + TQString iCal = IncidenceFormatter::formatICalInvitation( vPart, mCalendar, helper ); if( !iCal.isEmpty() ) return iCal; return vPart; @@ -1847,7 +1847,7 @@ class IncidenceFormatter::ToolTipVisitor : public IncidenceBase::Visitor mResult = ""; return incidence ? incidence->accept( *this ) : false; } - QString result() const { return mResult; } + TQString result() const { return mResult; } protected: bool visit( Event *event ); @@ -1855,22 +1855,22 @@ class IncidenceFormatter::ToolTipVisitor : public IncidenceBase::Visitor bool visit( Journal *journal ); bool visit( FreeBusy *fb ); - QString dateRangeText( Event*event ); - QString dateRangeText( Todo *todo ); - QString dateRangeText( Journal *journal ); - QString dateRangeText( FreeBusy *fb ); + TQString dateRangeText( Event*event ); + TQString dateRangeText( Todo *todo ); + TQString dateRangeText( Journal *journal ); + TQString dateRangeText( FreeBusy *fb ); - QString generateToolTip( Incidence* incidence, QString dtRangeText ); + TQString generateToolTip( Incidence* incidence, TQString dtRangeText ); protected: bool mRichText; - QString mResult; + TQString mResult; }; -QString IncidenceFormatter::ToolTipVisitor::dateRangeText( Event*event ) +TQString IncidenceFormatter::ToolTipVisitor::dateRangeText( Event*event ) { - QString ret; - QString tmp; + TQString ret; + TQString tmp; if ( event->isMultiDay() ) { tmp = "
            " + i18n("Event start", "From: %1"); @@ -1890,8 +1890,8 @@ QString IncidenceFormatter::ToolTipVisitor::dateRangeText( Event*event ) ret += "
            "+i18n("Date: %1"). arg( event->dtStartDateStr().replace(" ", " ") ); if ( !event->doesFloat() ) { - const QString dtStartTime = event->dtStartTimeStr().replace( " ", " " ); - const QString dtEndTime = event->dtEndTimeStr().replace( " ", " " ); + const TQString dtStartTime = event->dtStartTimeStr().replace( " ", " " ); + const TQString dtEndTime = event->dtEndTimeStr().replace( " ", " " ); if ( dtStartTime == dtEndTime ) { // to prevent 'Time: 17:00 - 17:00' tmp = "
            " + i18n("time for event,   to prevent ugly line breaks", "Time: %1"). @@ -1908,9 +1908,9 @@ QString IncidenceFormatter::ToolTipVisitor::dateRangeText( Event*event ) return ret; } -QString IncidenceFormatter::ToolTipVisitor::dateRangeText( Todo*todo ) +TQString IncidenceFormatter::ToolTipVisitor::dateRangeText( Todo*todo ) { - QString ret; + TQString ret; bool floats( todo->doesFloat() ); if (todo->hasStartDate()) // No need to add here. This is separated issue and each line @@ -1933,19 +1933,19 @@ QString IncidenceFormatter::ToolTipVisitor::dateRangeText( Todo*todo ) return ret; } -QString IncidenceFormatter::ToolTipVisitor::dateRangeText( Journal*journal ) +TQString IncidenceFormatter::ToolTipVisitor::dateRangeText( Journal*journal ) { - QString ret; + TQString ret; if (journal->dtStart().isValid() ) { ret += "
            " + i18n("Date: %1").arg( journal->dtStartDateStr( false ) ); } return ret; } -QString IncidenceFormatter::ToolTipVisitor::dateRangeText( FreeBusy *fb ) +TQString IncidenceFormatter::ToolTipVisitor::dateRangeText( FreeBusy *fb ) { - QString tmp( "
            " + i18n("Period start: %1") ); - QString ret = tmp.arg( KGlobal::locale()->formatDateTime( fb->dtStart() ) ); + TQString tmp( "
            " + i18n("Period start: %1") ); + TQString ret = tmp.arg( KGlobal::locale()->formatDateTime( fb->dtStart() ) ); tmp = "
            " + i18n("Period start: %1"); ret += tmp.arg( KGlobal::locale()->formatDateTime( fb->dtEnd() ) ); return ret; @@ -1980,12 +1980,12 @@ bool IncidenceFormatter::ToolTipVisitor::visit( FreeBusy *fb ) return !mResult.isEmpty(); } -QString IncidenceFormatter::ToolTipVisitor::generateToolTip( Incidence* incidence, QString dtRangeText ) +TQString IncidenceFormatter::ToolTipVisitor::generateToolTip( Incidence* incidence, TQString dtRangeText ) { if ( !incidence ) - return QString::null; + return TQString::null; - QString tmp = ""+ incidence->summary().replace("\n", "
            ")+"
            "; + TQString tmp = ""+ incidence->summary().replace("\n", "
            ")+"
            "; tmp += dtRangeText; @@ -1995,7 +1995,7 @@ QString IncidenceFormatter::ToolTipVisitor::generateToolTip( Incidence* incidenc arg( incidence->location().replace("\n", "
            ") ); } if (!incidence->description().isEmpty()) { - QString desc(incidence->description()); + TQString desc(incidence->description()); if (desc.length()>120) { desc = desc.left(120) + "..."; } @@ -2005,13 +2005,13 @@ QString IncidenceFormatter::ToolTipVisitor::generateToolTip( Incidence* incidenc return tmp; } -QString IncidenceFormatter::toolTipString( IncidenceBase *incidence, bool richText ) +TQString IncidenceFormatter::toolTipString( IncidenceBase *incidence, bool richText ) { ToolTipVisitor v; if ( v.act( incidence, richText ) ) { return v.result(); } else - return QString::null; + return TQString::null; } @@ -2031,7 +2031,7 @@ class IncidenceFormatter::MailBodyVisitor : public IncidenceBase::Visitor mResult = ""; return incidence ? incidence->accept( *this ) : false; } - QString result() const { return mResult; } + TQString result() const { return mResult; } protected: bool visit( Event *event ); @@ -2039,13 +2039,13 @@ class IncidenceFormatter::MailBodyVisitor : public IncidenceBase::Visitor bool visit( Journal *journal ); bool visit( FreeBusy * ) { mResult = i18n("This is a Free Busy Object"); return !mResult.isEmpty(); } protected: - QString mResult; + TQString mResult; }; -static QString mailBodyIncidence( Incidence *incidence ) +static TQString mailBodyIncidence( Incidence *incidence ) { - QString body; + TQString body; if ( !incidence->summary().isEmpty() ) { body += i18n("Summary: %1\n").arg( incidence->summary() ); } @@ -2060,7 +2060,7 @@ static QString mailBodyIncidence( Incidence *incidence ) bool IncidenceFormatter::MailBodyVisitor::visit( Event *event ) { - QString recurrence[]= {i18n("no recurrence", "None"), + TQString recurrence[]= {i18n("no recurrence", "None"), i18n("Minutely"), i18n("Hourly"), i18n("Daily"), i18n("Weekly"), i18n("Monthly Same Day"), i18n("Monthly Same Position"), i18n("Yearly"), i18n("Yearly"), i18n("Yearly")}; @@ -2090,7 +2090,7 @@ bool IncidenceFormatter::MailBodyVisitor::visit( Event *event ) } else { if ( recur->duration() != -1 ) { // TODO_Recurrence: What to do with floating - QString endstr; + TQString endstr; if ( event->doesFloat() ) { endstr = KGlobal::locale()->formatDate( recur->endDate() ); } else { @@ -2102,7 +2102,7 @@ bool IncidenceFormatter::MailBodyVisitor::visit( Event *event ) } } } - QString details = event->description(); + TQString details = event->description(); if ( !details.isEmpty() ) { mResult += i18n("Details:\n%1\n").arg( details ); } @@ -2125,7 +2125,7 @@ bool IncidenceFormatter::MailBodyVisitor::visit( Todo *todo ) mResult += i18n("Due Time: %1\n").arg( todo->dtDueTimeStr() ); } } - QString details = todo->description(); + TQString details = todo->description(); if ( !details.isEmpty() ) { mResult += i18n("Details:\n%1\n").arg( details ); } @@ -2146,21 +2146,21 @@ bool IncidenceFormatter::MailBodyVisitor::visit( Journal *journal ) -QString IncidenceFormatter::mailBodyString( IncidenceBase *incidence ) +TQString IncidenceFormatter::mailBodyString( IncidenceBase *incidence ) { if ( !incidence ) - return QString::null; + return TQString::null; MailBodyVisitor v; if ( v.act( incidence ) ) { return v.result(); } - return QString::null; + return TQString::null; } -static QString recurEnd( Incidence *incidence ) +static TQString recurEnd( Incidence *incidence ) { - QString endstr; + TQString endstr; if ( incidence->doesFloat() ) { endstr = KGlobal::locale()->formatDate( incidence->recurrence()->endDate() ); } else { @@ -2169,7 +2169,7 @@ static QString recurEnd( Incidence *incidence ) return endstr; } -QString IncidenceFormatter::recurrenceString(Incidence * incidence) +TQString IncidenceFormatter::recurrenceString(Incidence * incidence) { if ( !incidence->doesRecur() ) return i18n( "No recurrence" ); diff --git a/libkcal/incidenceformatter.h b/libkcal/incidenceformatter.h index 264bbd810..ce37b0164 100644 --- a/libkcal/incidenceformatter.h +++ b/libkcal/incidenceformatter.h @@ -22,7 +22,7 @@ #ifndef KCAL_INCIDENCEFORMATTER_H #define KCAL_INCIDENCEFORMATTER_H -#include +#include #include "libkcal_export.h" @@ -34,8 +34,8 @@ class IncidenceBase; class LIBKCAL_EXPORT InvitationFormatterHelper { public: - virtual QString generateLinkURL( const QString &id ) { return id; } - virtual QString makeLink( const QString &id, const QString &text ); + virtual TQString generateLinkURL( const TQString &id ) { return id; } + virtual TQString makeLink( const TQString &id, const TQString &text ); virtual Calendar* calendar() const { return 0; } }; @@ -49,20 +49,20 @@ class LIBKCAL_EXPORT InvitationFormatterHelper class LIBKCAL_EXPORT IncidenceFormatter { public: - static QString toolTipString( IncidenceBase *incidence, bool richText = true ); - static QString mailBodyString( IncidenceBase *incidencebase ); - static QString extensiveDisplayString( IncidenceBase *incidence ); + static TQString toolTipString( IncidenceBase *incidence, bool richText = true ); + static TQString mailBodyString( IncidenceBase *incidencebase ); + static TQString extensiveDisplayString( IncidenceBase *incidence ); - static QString formatICalInvitation( QString invitation, Calendar *mCalendar, + static TQString formatICalInvitation( TQString invitation, Calendar *mCalendar, InvitationFormatterHelper *helper ); // Format a TNEF attachment to an HTML mail - static QString formatTNEFInvitation( const QByteArray& tnef, + static TQString formatTNEFInvitation( const TQByteArray& tnef, Calendar *mCalendar, InvitationFormatterHelper *helper ); // Transform a TNEF attachment to an iCal or vCard - static QString msTNEFToVPart( const QByteArray& tnef ); + static TQString msTNEFToVPart( const TQByteArray& tnef ); - static QString recurrenceString( Incidence *incidence ); + static TQString recurrenceString( Incidence *incidence ); private: class EventViewerVisitor; class ScheduleMessageVisitor; diff --git a/libkcal/journal.h b/libkcal/journal.h index 4307c2414..52d2d8dd3 100644 --- a/libkcal/journal.h +++ b/libkcal/journal.h @@ -40,7 +40,7 @@ class LIBKCAL_EXPORT Journal : public Incidence bool accept( Visitor &v ) { return v.visit(this); } bool operator==( const Journal& ) const; - QCString type() const { return "Journal"; } + TQCString type() const { return "Journal"; } /** Return copy of this Journal. The caller owns the returned object. diff --git a/libkcal/listbase.h b/libkcal/listbase.h index 71a228168..2ce1dfa14 100644 --- a/libkcal/listbase.h +++ b/libkcal/listbase.h @@ -21,33 +21,33 @@ #ifndef KCAL_LISTBASE_H #define KCAL_LISTBASE_H -#include +#include namespace KCal { /** This class provides a template for lists of pointers. - It extends QValueList by auto delete funtionality known from QPtrList. + It extends TQValueList by auto delete funtionality known from TQPtrList. */ template -class ListBase : public QValueList +class ListBase : public TQValueList { public: ListBase() - : QValueList(), mAutoDelete( false ) + : TQValueList(), mAutoDelete( false ) { } ListBase( const ListBase &l ) - : QValueList( l ), mAutoDelete( false ) + : TQValueList( l ), mAutoDelete( false ) { } ~ListBase() { if ( mAutoDelete ) { - QValueListIterator it; - for( it = QValueList::begin(); it != QValueList::end(); ++it ) { + TQValueListIterator it; + for( it = TQValueList::begin(); it != TQValueList::end(); ++it ) { delete *it; } } @@ -56,7 +56,7 @@ class ListBase : public QValueList ListBase &operator=( const ListBase &l ) { if ( this == &l ) return *this; - QValueList::operator=( l ); + TQValueList::operator=( l ); return *this; } @@ -67,8 +67,8 @@ class ListBase : public QValueList bool removeRef( T *t ) { - QValueListIterator it = find( t ); - if ( it == QValueList::end() ) { + TQValueListIterator it = find( t ); + if ( it == TQValueList::end() ) { return false; } else { if ( mAutoDelete ) delete t; @@ -80,12 +80,12 @@ class ListBase : public QValueList void clearAll() { if ( mAutoDelete ) { - for ( QValueListIterator it = QValueList::begin(); - it != QValueList::end(); ++it ) { + for ( TQValueListIterator it = TQValueList::begin(); + it != TQValueList::end(); ++it ) { delete *it; } } - QValueList::clear(); + TQValueList::clear(); } private: diff --git a/libkcal/period.cpp b/libkcal/period.cpp index 9d37aba48..be07d7d3b 100644 --- a/libkcal/period.cpp +++ b/libkcal/period.cpp @@ -31,14 +31,14 @@ Period::Period() mHasDuration = false; } -Period::Period( const QDateTime &start, const QDateTime &end ) +Period::Period( const TQDateTime &start, const TQDateTime &end ) { mStart = start; mEnd = end; mHasDuration = false; } -Period::Period( const QDateTime &start, const Duration &duration ) +Period::Period( const TQDateTime &start, const Duration &duration ) { mStart = start; mEnd = duration.end( start ); @@ -51,12 +51,12 @@ bool Period::operator<( const Period& other ) return start() < other.start(); } -QDateTime Period::start() const +TQDateTime Period::start() const { return mStart; } -QDateTime Period::end()const +TQDateTime Period::end()const { return mEnd; } @@ -71,22 +71,22 @@ bool Period::hasDuration()const return mHasDuration; } -QString KCal::Period::summary() const +TQString KCal::Period::summary() const { return mSummary; } -void KCal::Period::setSummary(const QString & summary) +void KCal::Period::setSummary(const TQString & summary) { mSummary = summary; } -QString KCal::Period::location() const +TQString KCal::Period::location() const { return mLocation; } -void KCal::Period::setLocation(const QString & location) +void KCal::Period::setLocation(const TQString & location) { mLocation = location; } diff --git a/libkcal/period.h b/libkcal/period.h index aa87bfc9d..64dd24d9c 100644 --- a/libkcal/period.h +++ b/libkcal/period.h @@ -21,7 +21,7 @@ #ifndef KCAL_PERIOD_H #define KCAL_PERIOD_H -#include +#include #include "libkcal_export.h" #include "duration.h" @@ -36,30 +36,30 @@ class KDE_EXPORT Period { public: Period(); - Period( const QDateTime &start, const QDateTime &end ); - Period( const QDateTime &start, const Duration &duration ); + Period( const TQDateTime &start, const TQDateTime &end ); + Period( const TQDateTime &start, const Duration &duration ); /** Returns true if this element is smaller than the @param other one */ bool operator<( const Period& other ); - QDateTime start() const; - QDateTime end() const; + TQDateTime start() const; + TQDateTime end() const; Duration duration(); bool hasDuration()const; - QString summary() const; - void setSummary( const QString &summary ); - QString location() const; - void setLocation( const QString &location ); + TQString summary() const; + void setSummary( const TQString &summary ); + TQString location() const; + void setLocation( const TQString &location ); private: - QDateTime mStart; - QDateTime mEnd; + TQDateTime mStart; + TQDateTime mEnd; bool mHasDuration; - QString mSummary; - QString mLocation; + TQString mSummary; + TQString mLocation; class Private; Private *d; diff --git a/libkcal/person.cpp b/libkcal/person.cpp index 687ec6dbf..aad80f68f 100644 --- a/libkcal/person.cpp +++ b/libkcal/person.cpp @@ -27,19 +27,19 @@ #include -#include +#include using namespace KCal; -Person::Person( const QString &fullName ) +Person::Person( const TQString &fullName ) { - QString name, email; + TQString name, email; KPIM::getNameAndMail( fullName, name, email ); setName( name ); setEmail( email ); } -Person::Person( const QString &name, const QString &email ) +Person::Person( const TQString &name, const TQString &email ) { setName( name ); setEmail( email ); @@ -53,7 +53,7 @@ bool KCal::operator==( const Person& p1, const Person& p2 ) } -QString Person::fullName() const +TQString Person::fullName() const { if( mName.isEmpty() ) { return mEmail; @@ -62,8 +62,8 @@ QString Person::fullName() const return mName; else { // Taken from KABC::Addressee::fullEmail - QString name = mName; - QRegExp needQuotes( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ); + TQString name = mName; + TQRegExp needQuotes( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ); bool weNeedToQuote = name.find( needQuotes ) != -1; if ( weNeedToQuote ) { if ( name[0] != '"' ) @@ -81,12 +81,12 @@ bool Person::isEmpty() const return mEmail.isEmpty() && mName.isEmpty(); } -void Person::setName(const QString &name) +void Person::setName(const TQString &name) { mName = name; } -void Person::setEmail(const QString &email) +void Person::setEmail(const TQString &email) { if ( email.startsWith( "mailto:", false ) ) { mEmail = email.mid(7); diff --git a/libkcal/person.h b/libkcal/person.h index 55b167070..e044f7308 100644 --- a/libkcal/person.h +++ b/libkcal/person.h @@ -22,7 +22,7 @@ #ifndef KCAL_PERSON_H #define KCAL_PERSON_H -#include +#include #include "libkcal_export.h" @@ -35,21 +35,21 @@ class LIBKCAL_EXPORT Person { public: Person() {} - Person( const QString &fullName ); - Person( const QString &name, const QString &email ); + Person( const TQString &fullName ); + Person( const TQString &name, const TQString &email ); bool isEmpty() const; - QString fullName( ) const; + TQString fullName( ) const; - void setName(const QString &); - QString name() const { return mName; } + void setName(const TQString &); + TQString name() const { return mName; } - void setEmail(const QString &); - QString email() const { return mEmail; } + void setEmail(const TQString &); + TQString email() const { return mEmail; } private: - QString mName; - QString mEmail; + TQString mName; + TQString mEmail; class Private; Private *d; diff --git a/libkcal/qtopiaformat.cpp b/libkcal/qtopiaformat.cpp index b7a7b3922..372c52308 100644 --- a/libkcal/qtopiaformat.cpp +++ b/libkcal/qtopiaformat.cpp @@ -19,14 +19,14 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -43,12 +43,12 @@ class QtopiaParser : public QXmlDefaultHandler public: QtopiaParser( Calendar *calendar ) : mCalendar( calendar ) {} - bool startElement( const QString &, const QString &, const QString & qName, - const QXmlAttributes &attributes ) + bool startElement( const TQString &, const TQString &, const TQString & qName, + const TQXmlAttributes &attributes ) { if ( qName == "event" ) { Event *event = new Event; - QString uid = "Qtopia" + attributes.value( "uid" ); + TQString uid = "Qtopia" + attributes.value( "uid" ); event->setUid( uid ); event->setSummary( attributes.value( "description" ) ); @@ -63,28 +63,28 @@ class QtopiaParser : public QXmlDefaultHandler event->setFloats( false ); } - QString rtype = attributes.value( "rtype" ); + TQString rtype = attributes.value( "rtype" ); if ( !rtype.isEmpty() ) { - QDate startDate = event->dtStart().date(); + TQDate startDate = event->dtStart().date(); - QString freqStr = attributes.value( "rfreq" ); + TQString freqStr = attributes.value( "rfreq" ); int freq = freqStr.toInt(); - QString hasEndDateStr = attributes.value( "rhasenddate" ); + TQString hasEndDateStr = attributes.value( "rhasenddate" ); bool hasEndDate = hasEndDateStr == "1"; - QString endDateStr = attributes.value( "enddt" ); - QDate endDate = toDateTime( endDateStr ).date(); + TQString endDateStr = attributes.value( "enddt" ); + TQDate endDate = toDateTime( endDateStr ).date(); - QString weekDaysStr = attributes.value( "rweekdays" ); + TQString weekDaysStr = attributes.value( "rweekdays" ); int weekDaysNum = weekDaysStr.toInt(); - QBitArray weekDays( 7 ); + TQBitArray weekDays( 7 ); int i; for( i = 1; i <= 7; ++i ) { weekDays.setBit( i - 1, ( 2 << i ) & weekDaysNum ); } - QString posStr = attributes.value( "rposition" ); + TQString posStr = attributes.value( "rposition" ); int pos = posStr.toInt(); Recurrence *r = event->recurrence(); @@ -104,7 +104,7 @@ class QtopiaParser : public QXmlDefaultHandler r->setMonthly( freq ); if ( hasEndDate ) r->setEndDate( endDate ); - QBitArray days( 7 ); + TQBitArray days( 7 ); days.fill( false ); days.setBit( startDate.dayOfWeek() - 1 ); r->addMonthlyPos( pos, days ); @@ -115,10 +115,10 @@ class QtopiaParser : public QXmlDefaultHandler } } - QString categoryList = attributes.value( "categories" ); + TQString categoryList = attributes.value( "categories" ); event->setCategories( lookupCategories( categoryList ) ); - QString alarmStr = attributes.value( "alarm" ); + TQString alarmStr = attributes.value( "alarm" ); if ( !alarmStr.isEmpty() ) { kdDebug(5800) << "Alarm: " << alarmStr << endl; Alarm *alarm = new Alarm( event ); @@ -136,13 +136,13 @@ class QtopiaParser : public QXmlDefaultHandler } else if ( qName == "Task" ) { Todo *todo = new Todo; - QString uid = "Qtopia" + attributes.value( "Uid" ); + TQString uid = "Qtopia" + attributes.value( "Uid" ); todo->setUid( uid ); - QString description = attributes.value( "Description" ); + TQString description = attributes.value( "Description" ); int pos = description.find( '\n' ); if ( pos > 0 ) { - QString summary = description.left( pos ); + TQString summary = description.left( pos ); todo->setSummary( summary ); todo->setDescription( description ); } else { @@ -153,19 +153,19 @@ class QtopiaParser : public QXmlDefaultHandler // if ( priority == 0 ) priority = 3; todo->setPriority( priority ); - QString categoryList = attributes.value( "Categories" ); + TQString categoryList = attributes.value( "Categories" ); todo->setCategories( lookupCategories( categoryList ) ); - QString completedStr = attributes.value( "Completed" ); + TQString completedStr = attributes.value( "Completed" ); if ( completedStr == "1" ) todo->setCompleted( true ); - QString hasDateStr = attributes.value( "HasDate" ); + TQString hasDateStr = attributes.value( "HasDate" ); if ( hasDateStr == "1" ) { int year = attributes.value( "DateYear" ).toInt(); int month = attributes.value( "DateMonth" ).toInt(); int day = attributes.value( "DateDay" ).toInt(); - todo->setDtDue( QDateTime( QDate( year, month, day ) ) ); + todo->setDtDue( TQDateTime( TQDate( year, month, day ) ) ); todo->setHasDueDate( true ); } @@ -174,42 +174,42 @@ class QtopiaParser : public QXmlDefaultHandler mCalendar->addTodo( todo ); } else if ( qName == "Category" ) { - QString id = attributes.value( "id" ); - QString name = attributes.value( "name" ); + TQString id = attributes.value( "id" ); + TQString name = attributes.value( "name" ); setCategory( id, name ); } return true; } - bool warning ( const QXmlParseException &exception ) + bool warning ( const TQXmlParseException &exception ) { kdDebug(5800) << "WARNING" << endl; printException( exception ); return true; } - bool error ( const QXmlParseException &exception ) + bool error ( const TQXmlParseException &exception ) { kdDebug(5800) << "ERROR" << endl; printException( exception ); return false; } - bool fatalError ( const QXmlParseException &exception ) + bool fatalError ( const TQXmlParseException &exception ) { kdDebug(5800) << "FATALERROR" << endl; printException( exception ); return false; } - QString errorString () + TQString errorString () { return "QtopiaParser: Error!"; } protected: - void printException( const QXmlParseException &exception ) + void printException( const TQXmlParseException &exception ) { kdError() << "XML Parse Error (line " << exception.lineNumber() << ", col " << exception.columnNumber() << "): " @@ -218,19 +218,19 @@ class QtopiaParser : public QXmlDefaultHandler << exception.systemId() << "')" << endl; } - QDateTime toDateTime( const QString &value ) + TQDateTime toDateTime( const TQString &value ) { - QDateTime dt; + TQDateTime dt; dt.setTime_t( value.toUInt() ); return dt; } - QStringList lookupCategories( const QString &categoryList ) + TQStringList lookupCategories( const TQString &categoryList ) { - QStringList categoryIds = QStringList::split( ";", categoryList ); - QStringList categories; - QStringList::ConstIterator it; + TQStringList categoryIds = TQStringList::split( ";", categoryList ); + TQStringList categories; + TQStringList::ConstIterator it; for( it = categoryIds.begin(); it != categoryIds.end(); ++it ) { categories.append( category( *it ) ); } @@ -240,22 +240,22 @@ class QtopiaParser : public QXmlDefaultHandler private: Calendar *mCalendar; - static QString category( const QString &id ) + static TQString category( const TQString &id ) { - QMap::ConstIterator it = mCategoriesMap.find( id ); + TQMap::ConstIterator it = mCategoriesMap.find( id ); if ( it == mCategoriesMap.end() ) return id; else return *it; } - static void setCategory( const QString &id, const QString &name ) + static void setCategory( const TQString &id, const TQString &name ) { mCategoriesMap.insert( id, name ); } - static QMap mCategoriesMap; + static TQMap mCategoriesMap; }; -QMap QtopiaParser::mCategoriesMap; +TQMap QtopiaParser::mCategoriesMap; QtopiaFormat::QtopiaFormat() { @@ -265,52 +265,52 @@ QtopiaFormat::~QtopiaFormat() { } -bool QtopiaFormat::load( Calendar *calendar, const QString &fileName) +bool QtopiaFormat::load( Calendar *calendar, const TQString &fileName) { kdDebug(5800) << "QtopiaFormat::load() " << fileName << endl; clearException(); QtopiaParser handler( calendar ); - QFile xmlFile( fileName ); - QXmlInputSource source( xmlFile ); - QXmlSimpleReader reader; + TQFile xmlFile( fileName ); + TQXmlInputSource source( xmlFile ); + TQXmlSimpleReader reader; reader.setContentHandler( &handler ); return reader.parse( source ); } -bool QtopiaFormat::save( Calendar *calendar, const QString &fileName ) +bool QtopiaFormat::save( Calendar *calendar, const TQString &fileName ) { kdDebug(5800) << "QtopiaFormat::save(): " << fileName << endl; clearException(); - QString text = toString( calendar ); + TQString text = toString( calendar ); if ( text.isNull() ) return false; // TODO: write backup file - QFile file( fileName ); + TQFile file( fileName ); if (!file.open( IO_WriteOnly ) ) { setException(new ErrorFormat(ErrorFormat::SaveError, i18n("Could not open file '%1'").arg(fileName))); return false; } - QTextStream ts( &file ); + TQTextStream ts( &file ); ts << text; file.close(); return true; } -bool QtopiaFormat::fromString( Calendar *, const QString & ) +bool QtopiaFormat::fromString( Calendar *, const TQString & ) { kdDebug(5800) << "QtopiaFormat::fromString() not yet implemented." << endl; return false; } -QString QtopiaFormat::toString( Calendar * ) +TQString QtopiaFormat::toString( Calendar * ) { - return QString::null; + return TQString::null; } diff --git a/libkcal/qtopiaformat.h b/libkcal/qtopiaformat.h index ed054d00b..a2950f19d 100644 --- a/libkcal/qtopiaformat.h +++ b/libkcal/qtopiaformat.h @@ -21,7 +21,7 @@ #ifndef KCAL_QTOPIAFORMAT_H #define KCAL_QTOPIAFORMAT_H -#include +#include #include "scheduler.h" @@ -39,11 +39,11 @@ class LIBKCAL_EXPORT QtopiaFormat : public CalFormat QtopiaFormat(); virtual ~QtopiaFormat(); - bool load( Calendar *, const QString &fileName ); - bool save( Calendar *, const QString &fileName ); + bool load( Calendar *, const TQString &fileName ); + bool save( Calendar *, const TQString &fileName ); - bool fromString( Calendar *, const QString & ); - QString toString( Calendar * ); + bool fromString( Calendar *, const TQString & ); + TQString toString( Calendar * ); private: class Private; diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp index 5d1505df2..c2d7897a0 100644 --- a/libkcal/recurrence.cpp +++ b/libkcal/recurrence.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "recurrence.h" #include "recurrencerule.h" @@ -124,10 +124,10 @@ void Recurrence::removeObserver( Observer *observer ) } -QDateTime Recurrence::startDateTime() const +TQDateTime Recurrence::startDateTime() const { if ( mFloating ) - return QDateTime( mStartDateTime.date(), QTime( 0, 0, 0 ) ); + return TQDateTime( mStartDateTime.date(), TQTime( 0, 0, 0 ) ); else return mStartDateTime; } @@ -176,7 +176,7 @@ void Recurrence::updated() { // recurrenceType() re-calculates the type if it's rMax mCachedType = rMax; - for ( QValueList::ConstIterator it = mObservers.begin(); + for ( TQValueList::ConstIterator it = mObservers.begin(); it != mObservers.end(); ++it ) { if ( (*it) ) (*it)->recurrenceUpdated( this ); } @@ -266,7 +266,7 @@ ushort Recurrence::recurrenceType( const RecurrenceRule *rrule ) return rOther; } -bool Recurrence::recursOn(const QDate &qd) const +bool Recurrence::recursOn(const TQDate &qd) const { TimeList tms; // First handle dates. Exrules override @@ -327,7 +327,7 @@ bool Recurrence::recursOn(const QDate &qd) const } } -bool Recurrence::recursAt( const QDateTime &dt ) const +bool Recurrence::recursAt( const TQDateTime &dt ) const { // if it's excluded anyway, don't bother to check if it recurs at all. if ( mExDateTimes.contains( dt )) return false; @@ -350,42 +350,42 @@ bool Recurrence::recursAt( const QDateTime &dt ) const /** Calculates the cumulative end of the whole recurrence (rdates and rrules). If any rrule is infinite, or the recurrence doesn't have any rrules or rdates, an invalid date is returned. */ -QDateTime Recurrence::endDateTime() const +TQDateTime Recurrence::endDateTime() const { DateTimeList dts; dts << startDateTime(); - if ( !mRDates.isEmpty() ) dts << QDateTime( mRDates.last(), QTime( 0, 0, 0 ) ); + if ( !mRDates.isEmpty() ) dts << TQDateTime( mRDates.last(), TQTime( 0, 0, 0 ) ); if ( !mRDateTimes.isEmpty() ) dts << mRDateTimes.last(); for ( RecurrenceRule::List::ConstIterator rr = mRRules.begin(); rr != mRRules.end(); ++rr ) { - QDateTime rl( (*rr)->endDt() ); + TQDateTime rl( (*rr)->endDt() ); // if any of the rules is infinite, the whole recurrence is - if ( !rl.isValid() ) return QDateTime(); + if ( !rl.isValid() ) return TQDateTime(); dts << rl; } qSortUnique( dts ); - if ( dts.isEmpty() ) return QDateTime(); + if ( dts.isEmpty() ) return TQDateTime(); else return dts.last(); } /** Calculates the cumulative end of the whole recurrence (rdates and rrules). If any rrule is infinite, or the recurrence doesn't have any rrules or rdates, an invalid date is returned. */ -QDate Recurrence::endDate() const +TQDate Recurrence::endDate() const { - QDateTime end( endDateTime() ); + TQDateTime end( endDateTime() ); if ( end.isValid() ) { return end.date(); } - else return QDate(); + else return TQDate(); } -void Recurrence::setEndDate( const QDate &date ) +void Recurrence::setEndDate( const TQDate &date ) { if ( doesFloat() ) - setEndDateTime( QDateTime( date, QTime( 23, 59, 59 ) ) ); + setEndDateTime( TQDateTime( date, TQTime( 23, 59, 59 ) ) ); else - setEndDateTime( QDateTime( date, mStartDateTime.time() ) ); + setEndDateTime( TQDateTime( date, mStartDateTime.time() ) ); } -void Recurrence::setEndDateTime( const QDateTime &dateTime ) +void Recurrence::setEndDateTime( const TQDateTime &dateTime ) { if ( mRecurReadOnly ) return; RecurrenceRule *rrule = defaultRRule( true ); @@ -401,12 +401,12 @@ int Recurrence::duration() const else return 0; } -// int Recurrence::durationTo( const QDate &/*date*/ ) const +// int Recurrence::durationTo( const TQDate &/*date*/ ) const // { // return 0; // } -int Recurrence::durationTo( const QDateTime &datetime ) const +int Recurrence::durationTo( const TQDateTime &datetime ) const { // Emulate old behavior: This is just an interface to the first rule! RecurrenceRule *rrule = defaultRRuleConst(); @@ -443,7 +443,7 @@ void Recurrence::clear() updated(); } -void Recurrence::setStartDateTime( const QDateTime &start ) +void Recurrence::setStartDateTime( const TQDateTime &start ) { if ( mRecurReadOnly ) return; mStartDateTime = start; @@ -458,9 +458,9 @@ void Recurrence::setStartDateTime( const QDateTime &start ) updated(); } -void Recurrence::setStartDate( const QDate &start ) +void Recurrence::setStartDate( const TQDate &start ) { - setStartDateTime( QDateTime( start, QTime(0,0,0) ) ); + setStartDateTime( TQDateTime( start, TQTime(0,0,0) ) ); setFloats( true ); } @@ -493,14 +493,14 @@ int Recurrence::weekStart() const } // Emulate the old behavior -QBitArray Recurrence::days() const +TQBitArray Recurrence::days() const { - QBitArray days( 7 ); + TQBitArray days( 7 ); days.fill( 0 ); RecurrenceRule *rrule = defaultRRuleConst(); if ( rrule ) { - QValueList bydays = rrule->byDays(); - for ( QValueListConstIterator it = bydays.begin(); + TQValueList bydays = rrule->byDays(); + for ( TQValueListConstIterator it = bydays.begin(); it != bydays.end(); ++it ) { if ( (*it).pos() == 0 ) { days.setBit( (*it).day() - 1 ); @@ -514,44 +514,44 @@ QBitArray Recurrence::days() const // MONTHLY // Emulate the old behavior -QValueList Recurrence::monthDays() const +TQValueList Recurrence::monthDays() const { RecurrenceRule *rrule = defaultRRuleConst(); if ( rrule ) return rrule->byMonthDays(); - else return QValueList(); + else return TQValueList(); } // Emulate the old behavior -QValueList Recurrence::monthPositions() const +TQValueList Recurrence::monthPositions() const { RecurrenceRule *rrule = defaultRRuleConst(); if ( rrule ) return rrule->byDays(); - else return QValueList(); + else return TQValueList(); } // YEARLY -QValueList Recurrence::yearDays() const +TQValueList Recurrence::yearDays() const { RecurrenceRule *rrule = defaultRRuleConst(); if ( rrule ) return rrule->byYearDays(); - else return QValueList(); + else return TQValueList(); } -QValueList Recurrence::yearDates() const +TQValueList Recurrence::yearDates() const { return monthDays(); } -QValueList Recurrence::yearMonths() const +TQValueList Recurrence::yearMonths() const { RecurrenceRule *rrule = defaultRRuleConst(); if ( rrule ) return rrule->byMonths(); - else return QValueList(); + else return TQValueList(); } -QValueList Recurrence::yearPositions() const +TQValueList Recurrence::yearPositions() const { return monthPositions(); } @@ -597,13 +597,13 @@ void Recurrence::setWeekly( int freq, int weekStart ) updated(); } -void Recurrence::setWeekly( int freq, const QBitArray &days, int weekStart ) +void Recurrence::setWeekly( int freq, const TQBitArray &days, int weekStart ) { setWeekly( freq, weekStart ); addMonthlyPos( 0, days ); } -void Recurrence::addWeeklyDays( const QBitArray &days ) +void Recurrence::addWeeklyDays( const TQBitArray &days ) { addMonthlyPos( 0, days ); } @@ -614,14 +614,14 @@ void Recurrence::setMonthly( int freq ) updated(); } -void Recurrence::addMonthlyPos( short pos, const QBitArray &days ) +void Recurrence::addMonthlyPos( short pos, const TQBitArray &days ) { // Allow 53 for yearly! if ( mRecurReadOnly || pos > 53 || pos < -53 ) return; RecurrenceRule *rrule = defaultRRule( false ); if ( !rrule ) return; bool changed = false; - QValueList positions = rrule->byDays(); + TQValueList positions = rrule->byDays(); for ( int i = 0; i < 7; ++i ) { if ( days.testBit(i) ) { @@ -645,7 +645,7 @@ void Recurrence::addMonthlyPos( short pos, ushort day ) if ( mRecurReadOnly || pos > 53 || pos < -53 ) return; RecurrenceRule *rrule = defaultRRule( false ); if ( !rrule ) return; - QValueList positions = rrule->byDays(); + TQValueList positions = rrule->byDays(); RecurrenceRule::WDayPos p( pos, day ); if ( !positions.contains( p ) ) { @@ -662,7 +662,7 @@ void Recurrence::addMonthlyDate( short day ) RecurrenceRule *rrule = defaultRRule( true ); if ( !rrule ) return; - QValueList monthDays = rrule->byMonthDays(); + TQValueList monthDays = rrule->byMonthDays(); if ( !monthDays.contains( day ) ) { monthDays.append( day ); rrule->setByMonthDays( monthDays ); @@ -683,7 +683,7 @@ void Recurrence::addYearlyDay( int day ) RecurrenceRule *rrule = defaultRRule( false ); // It must already exist! if ( !rrule ) return; - QValueList days = rrule->byYearDays(); + TQValueList days = rrule->byYearDays(); if ( !days.contains( day ) ) { days << day; rrule->setByYearDays( days ); @@ -698,7 +698,7 @@ void Recurrence::addYearlyDate( int day ) } // day part of date within year, given as position (n-th weekday) -void Recurrence::addYearlyPos( short pos, const QBitArray &days ) +void Recurrence::addYearlyPos( short pos, const TQBitArray &days ) { addMonthlyPos( pos, days ); } @@ -711,7 +711,7 @@ void Recurrence::addYearlyMonth( short month ) RecurrenceRule *rrule = defaultRRule( false ); if ( !rrule ) return; - QValueList months = rrule->byMonths(); + TQValueList months = rrule->byMonths(); if ( !months.contains(month) ) { months << month; rrule->setByMonths( months ); @@ -720,7 +720,7 @@ void Recurrence::addYearlyMonth( short month ) } -TimeList Recurrence::recurTimesOn( const QDate &date ) const +TimeList Recurrence::recurTimesOn( const TQDate &date ) const { TimeList times; // The whole day is excepted @@ -771,10 +771,10 @@ TimeList Recurrence::recurTimesOn( const QDate &date ) const } -QDateTime Recurrence::getNextDateTime( const QDateTime &preDateTime ) const +TQDateTime Recurrence::getNextDateTime( const TQDateTime &preDateTime ) const { //kdDebug(5800) << " Recurrence::getNextDateTime after " << preDateTime << endl; - QDateTime nextDT = preDateTime; + TQDateTime nextDT = preDateTime; // prevent infinite loops, e.g. when an exrule extinguishes an rrule (e.g. // the exrule is identical to the rrule). If an occurrence is found, break // out of the loop by returning that QDateTime @@ -787,7 +787,7 @@ QDateTime Recurrence::getNextDateTime( const QDateTime &preDateTime ) const // 1.0) Add the start date if it's after preDateTime // 1.1) Use the next occurrence from the explicit RDATE lists // 1.2) Add the next recurrence for each of the RRULEs - // 2) Take the earliest recurrence of these = QDateTime nextDT + // 2) Take the earliest recurrence of these = TQDateTime nextDT // 3) If that date/time is not excluded, either explicitly by an EXDATE or // by an EXRULE, return nextDT as the next date/time of the recurrence // 4) If it's excluded, start all at 1), but starting at nextDT (instead @@ -804,12 +804,12 @@ QDateTime Recurrence::getNextDateTime( const QDateTime &preDateTime ) const /*kdDebug(5800) << " nextDT: " << nextDT << ", startDT: " << startDateTime() << endl; kdDebug(5800) << " getNextDateTime: found " << dates.count() << " RDATES and DTSTART in loop " << loop << endl;*/ DateList::ConstIterator dit = mRDates.begin(); - while ( dit != mRDates.end() && QDateTime( (*dit), startDateTime().time() ) <= nextDT ) ++dit; - if ( dit != mRDates.end() ) dates << QDateTime( (*dit), startDateTime().time() ); + while ( dit != mRDates.end() && TQDateTime( (*dit), startDateTime().time() ) <= nextDT ) ++dit; + if ( dit != mRDates.end() ) dates << TQDateTime( (*dit), startDateTime().time() ); // Add the next occurrences from all RRULEs. for ( RecurrenceRule::List::ConstIterator rr = mRRules.begin(); rr != mRRules.end(); ++rr ) { - QDateTime dt = (*rr)->getNextDate( nextDT ); + TQDateTime dt = (*rr)->getNextDate( nextDT ); if ( dt.isValid() ) dates << dt; } @@ -817,7 +817,7 @@ kdDebug(5800) << " getNextDateTime: found " << dates.count() << " RDATES and D qSortUnique( dates ); // kdDebug(5800) << " getNextDateTime: found " << dates.count() << " dates in loop " << loop << endl; - if ( dates.isEmpty() ) return QDateTime(); + if ( dates.isEmpty() ) return TQDateTime(); nextDT = dates.first(); // Check if that date/time is excluded explicitly or by an exrule: @@ -833,12 +833,12 @@ kdDebug(5800) << " getNextDateTime: found " << dates.count() << " RDATES and D } // Couldn't find a valid occurrences in 1000 loops, something is wrong! - return QDateTime(); + return TQDateTime(); } -QDateTime Recurrence::getPreviousDateTime( const QDateTime &afterDateTime ) const +TQDateTime Recurrence::getPreviousDateTime( const TQDateTime &afterDateTime ) const { - QDateTime prevDT = afterDateTime; + TQDateTime prevDT = afterDateTime; // prevent infinite loops, e.g. when an exrule extinguishes an rrule (e.g. // the exrule is identical to the rrule). If an occurrence is found, break // out of the loop by returning that QDateTime @@ -848,7 +848,7 @@ QDateTime Recurrence::getPreviousDateTime( const QDateTime &afterDateTime ) cons // 1) Find the next date/time after preDateTime when the event could recur // 1.1) Use the next occurrence from the explicit RDATE lists // 1.2) Add the next recurrence for each of the RRULEs - // 2) Take the earliest recurrence of these = QDateTime nextDT + // 2) Take the earliest recurrence of these = TQDateTime nextDT // 3) If that date/time is not excluded, either explicitly by an EXDATE or // by an EXRULE, return nextDT as the next date/time of the recurrence // 4) If it's excluded, start all at 1), but starting at nextDT (instead @@ -870,21 +870,21 @@ QDateTime Recurrence::getPreviousDateTime( const QDateTime &afterDateTime ) cons if ( dit != mRDates.begin() ) { do { --dit; - } while ( dit != mRDates.begin() && QDateTime((*dit), startDateTime().time()) >= prevDT ); - if ( QDateTime((*dit), startDateTime().time()) < prevDT ) - dates << QDateTime( (*dit), startDateTime().time() ); + } while ( dit != mRDates.begin() && TQDateTime((*dit), startDateTime().time()) >= prevDT ); + if ( TQDateTime((*dit), startDateTime().time()) < prevDT ) + dates << TQDateTime( (*dit), startDateTime().time() ); } // Add the previous occurrences from all RRULEs. for ( RecurrenceRule::List::ConstIterator rr = mRRules.begin(); rr != mRRules.end(); ++rr ) { - QDateTime dt = (*rr)->getPreviousDate( prevDT ); + TQDateTime dt = (*rr)->getPreviousDate( prevDT ); if ( dt.isValid() ) dates << dt; } //kdDebug(5800) << " getPreviousDateTime: found " << dates.count() << " dates in loop " << loop << endl; // Take the last of these (all others can't be used later on) qSortUnique( dates ); - if ( dates.isEmpty() ) return QDateTime(); + if ( dates.isEmpty() ) return TQDateTime(); prevDT = dates.last(); // Check if that date/time is excluded explicitly or by an exrule: @@ -898,7 +898,7 @@ QDateTime Recurrence::getPreviousDateTime( const QDateTime &afterDateTime ) cons } // Couldn't find a valid occurrences in 1000 loops, something is wrong! - return QDateTime(); + return TQDateTime(); } @@ -963,7 +963,7 @@ void Recurrence::setRDateTimes( const DateTimeList &rdates ) updated(); } -void Recurrence::addRDateTime( const QDateTime &rdate ) +void Recurrence::addRDateTime( const TQDateTime &rdate ) { if ( mRecurReadOnly ) return; mRDateTimes.append( rdate ); @@ -985,7 +985,7 @@ void Recurrence::setRDates( const DateList &rdates ) updated(); } -void Recurrence::addRDate( const QDate &rdate ) +void Recurrence::addRDate( const TQDate &rdate ) { if ( mRecurReadOnly ) return; mRDates.append( rdate ); @@ -1006,7 +1006,7 @@ void Recurrence::setExDateTimes( const DateTimeList &exdates ) qSortUnique( mExDateTimes ); } -void Recurrence::addExDateTime( const QDateTime &exdate ) +void Recurrence::addExDateTime( const TQDateTime &exdate ) { if ( mRecurReadOnly ) return; mExDateTimes.append( exdate ); @@ -1028,7 +1028,7 @@ void Recurrence::setExDates( const DateList &exdates ) updated(); } -void Recurrence::addExDate( const QDate &exdate ) +void Recurrence::addExDate( const TQDate &exdate ) { if ( mRecurReadOnly ) return; mExDates.append( exdate ); diff --git a/libkcal/recurrence.h b/libkcal/recurrence.h index 773a9d635..ec6965977 100644 --- a/libkcal/recurrence.h +++ b/libkcal/recurrence.h @@ -24,9 +24,9 @@ #ifndef KCAL_RECURRENCE_H #define KCAL_RECURRENCE_H -#include -#include -#include +#include +#include +#include #include "libkcal_export.h" #include "recurrencerule.h" @@ -111,17 +111,17 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer /** Return the start date/time of the recurrence (Time for floating incidences will be 0:00). @return the current start/time of the recurrence. */ - QDateTime startDateTime() const; + TQDateTime startDateTime() const; /** Return the start date/time of the recurrence */ - QDate startDate() const { return mStartDateTime.date(); } + TQDate startDate() const { return mStartDateTime.date(); } /** Set start of recurrence, as a date and time. Also sets the incidence to non-floating. @param start the new start date/time of the incidence. */ - void setStartDateTime( const QDateTime &start ); + void setStartDateTime( const TQDateTime &start ); /** Set start of recurrence, as a date. Also sets the incidence to floating. @param start The new start date of the incidence. */ - void setStartDate( const QDate &start ); + void setStartDate( const TQDate &start ); /** Set whether the recurrence has no time, just a date. * Floating means -- according to rfc2445 -- that the event has no time @@ -150,10 +150,10 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer static ushort recurrenceType( const RecurrenceRule *rrule ); /** Returns true if the date specified is one on which the event will * recur. */ - bool recursOn( const QDate &qd ) const; + bool recursOn( const TQDate &qd ) const; /** Returns true if the date/time specified is one at which the event will * recur. Times are rounded down to the nearest minute to determine the result. */ - bool recursAt( const QDateTime & ) const; + bool recursAt( const TQDateTime & ) const; /** Removes all recurrence rules. Recurrence dates and exceptions are not removed. */ void unsetRecurs(); @@ -164,21 +164,21 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer * recurrence will occur. * @param date the date for which to find the recurrence times. */ - QValueList recurTimesOn(const QDate &date) const; + TQValueList recurTimesOn(const TQDate &date) const; /** Returns the date and time of the next recurrence, after the specified date/time. * If the recurrence has no time, the next date after the specified date is returned. * @param preDateTime the date/time after which to find the recurrence. * @return date/time of next recurrence (strictly later than the given QDateTiem), or invalid date if none. */ - QDateTime getNextDateTime( const QDateTime& preDateTime ) const; + TQDateTime getNextDateTime( const TQDateTime& preDateTime ) const; /** Returns the date and time of the last previous recurrence, before the specified date/time. * If a time later than 00:00:00 is specified and the recurrence has no time, 00:00:00 on * the specified date is returned if that date recurs. * @param afterDateTime the date/time before which to find the recurrence. - * @return date/time of previous recurrence (strictly earlier than the given QDateTime), or invalid date if none. + * @return date/time of previous recurrence (strictly earlier than the given TQDateTime), or invalid date if none. */ - QDateTime getPreviousDateTime( const QDateTime& afterDateTime ) const; + TQDateTime getPreviousDateTime( const TQDateTime& afterDateTime ) const; /** Returns frequency of recurrence, in terms of the recurrence time period type. */ int frequency() const; @@ -194,25 +194,25 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer * first and last. */ void setDuration(int duration); /** Returns the number of recurrences up to and including the date/time specified. */ - int durationTo(const QDateTime &) const; + int durationTo(const TQDateTime &) const; /** Returns the number of recurrences up to and including the date specified. */ - int durationTo( const QDate &date ) const { return durationTo( QDateTime( date, QTime( 23, 59, 59 ) ) ); } + int durationTo( const TQDate &date ) const { return durationTo( TQDateTime( date, TQTime( 23, 59, 59 ) ) ); } /** Returns the date/time of the last recurrence. * An invalid date is returned if the recurrence has no end. */ - QDateTime endDateTime() const; + TQDateTime endDateTime() const; /** Returns the date of the last recurrence. * An invalid date is returned if the recurrence has no end. */ - QDate endDate() const; + TQDate endDate() const; /** Sets the date of the last recurrence. The end time is set to the recurrence start time. * @param endDate the ending date after which to stop recurring. If the * incidence is not floating, the end time will be 23:59.*/ - void setEndDate( const QDate &endDate ); + void setEndDate( const TQDate &endDate ); /** Sets the date and time of the last recurrence. * @param endDateTime the ending date/time after which to stop recurring. */ - void setEndDateTime( const QDateTime &endDateTime ); + void setEndDateTime( const TQDateTime &endDateTime ); @@ -282,11 +282,11 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer * @param days a 7 bit array indicating which days on which to recur (bit 0 = Monday). * @param weekStart the first day of the week (Monday=1 .. Sunday=7, default is Monday). */ - void setWeekly( int freq, const QBitArray &days, int weekStart = 1 ); + void setWeekly( int freq, const TQBitArray &days, int weekStart = 1 ); /** Adds days to the weekly day recurrence list. * @param days a 7 bit array indicating which days on which to recur (bit 0 = Monday). */ - void addWeeklyDays( const QBitArray &days ); + void addWeeklyDays( const TQBitArray &days ); /** Returns the first day of the week. Uses only the * first RRULE if present (i.e. a second RRULE as well as all EXRULES are * ignored! @@ -294,7 +294,7 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer */ int weekStart() const; /** Returns week day mask (bit 0 = Monday). */ - QBitArray days() const; // Emulate the old behavior + TQBitArray days() const; // Emulate the old behavior /** Sets an event to recur monthly. By default infinite recurrence is used. The date of the monthly recurrence will be taken from the start date @@ -318,7 +318,7 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer * Example: pos = 2, and bits 0 and 2 are set in days: * the rule is to repeat every 2nd Monday and Wednesday in the month. */ - void addMonthlyPos( short pos, const QBitArray &days ); + void addMonthlyPos( short pos, const TQBitArray &days ); void addMonthlyPos( short pos, ushort day ); /** Adds a date (e.g. the 15th of each month) to the monthly day * recurrence list. @@ -326,10 +326,10 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer */ void addMonthlyDate( short day ); /** Returns list of day positions in months. */ - QValueList monthPositions() const; + TQValueList monthPositions() const; /** Returns list of day numbers of a month. */ // Emulate old behavior - QValueList monthDays() const; + TQValueList monthDays() const; /** Sets an event to recur yearly. By default, this will recur every year * on the same date (e.g. every year on April 15 if the start date was @@ -392,14 +392,14 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer * If no months are specified, the fule is to repeat every year on the * 2nd Monday and Wednesday of the year. */ - void addYearlyPos( short pos, const QBitArray &days ); + void addYearlyPos( short pos, const TQBitArray &days ); /** Returns the day numbers within a yearly recurrence. * @return the days of the year for the event. E.g. if the list contains * 60, this means the recurrence happens on day 60 of the year, i.e. * on Feb 29 in leap years and March 1 in non-leap years. */ - QValueList yearDays() const; + TQValueList yearDays() const; /** Returns the dates within a yearly recurrence. * @return the days of the month for the event. E.g. if the list contains * 13, this means the recurrence happens on the 13th of the month. @@ -407,7 +407,7 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer * yearlyMonths(). If this list is empty, the month of the start * date is used. */ - QValueList yearDates() const; + TQValueList yearDates() const; /** Returns the months within a yearly recurrence. * @return the months for the event. E.g. if the list contains * 11, this means the recurrence happens in November. @@ -416,7 +416,7 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer * through yearlyPositions() if they are given as positions within the * month. If none is specified, the date of the start date is used. */ - QValueList yearMonths() const; + TQValueList yearMonths() const; /** Returns the positions within a yearly recurrence. * @return the positions for the event, either within a month (if months * are set through addYearlyMonth()) or within the year. @@ -426,10 +426,10 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer * year. */ /** Returns list of day positions in months, for a recursYearlyPos recurrence rule. */ - QValueList yearPositions() const; + TQValueList yearPositions() const; /** Upper date limit for recurrences */ - static const QDate MAX_DATE; + static const TQDate MAX_DATE; /** Debug output. @@ -451,16 +451,16 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer DateList rDates() const; void setRDateTimes( const DateTimeList &rdates); void setRDates( const DateList &rdates); - void addRDateTime( const QDateTime &rdate ); - void addRDate( const QDate &rdate ); + void addRDateTime( const TQDateTime &rdate ); + void addRDate( const TQDate &rdate ); // ExDATE DateTimeList exDateTimes() const; DateList exDates() const; void setExDateTimes( const DateTimeList &exdates); void setExDates( const DateList &exdates); - void addExDateTime( const QDateTime &exdate ); - void addExDate( const QDate &exdate ); + void addExDateTime( const TQDateTime &exdate ); + void addExDate( const TQDate &exdate ); RecurrenceRule *defaultRRule( bool create = false ) const; RecurrenceRule *defaultRRuleConst() const; @@ -490,19 +490,19 @@ class LIBKCAL_EXPORT Recurrence : public RecurrenceRule::Observer private: RecurrenceRule::List mExRules; RecurrenceRule::List mRRules; - QValueListmRDateTimes; - QValueList mRDates; - QValueList mExDateTimes; - QValueList mExDates; + TQValueListmRDateTimes; + TQValueList mRDates; + TQValueList mExDateTimes; + TQValueList mExDates; - QDateTime mStartDateTime; // date/time of first recurrence + TQDateTime mStartDateTime; // date/time of first recurrence bool mFloating; // the recurrence has no time, just a date bool mRecurReadOnly; // Cache the type of the recurrence with the old system (e.g. MonthlyPos) mutable ushort mCachedType; - QValueList mObservers; + TQValueList mObservers; class Private; Private *d; diff --git a/libkcal/recurrencerule.cpp b/libkcal/recurrencerule.cpp index ef6f9ccd9..ce64aadc1 100644 --- a/libkcal/recurrencerule.cpp +++ b/libkcal/recurrencerule.cpp @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -33,14 +33,14 @@ using namespace KCal; -// FIXME: If Qt is ever changed so that QDateTime:::addSecs takes into account +// FIXME: If Qt is ever changed so that TQDateTime:::addSecs takes into account // DST shifts, we need to use our own addSecs method, too, since we // need to caalculate things in UTC! -/** Workaround for broken QDateTime::secsTo (at least in Qt 3.3). While - QDateTime::secsTo does take time zones into account, QDateTime::addSecs +/** Workaround for broken TQDateTime::secsTo (at least in Qt 3.3). While + TQDateTime::secsTo does take time zones into account, TQDateTime::addSecs does not, so we have a problem: - QDateTime d1(QDate(2005, 10, 30), QTime(1, 30, 0) ); - QDateTime d2(QDate(2005, 10, 30), QTime(3, 30, 0) ); + TQDateTime d1(TQDate(2005, 10, 30), TQTime(1, 30, 0) ); + TQDateTime d2(TQDate(2005, 10, 30), TQTime(3, 30, 0) ); kdDebug(5800) << "d1=" << d1 << ", d2=" << d2 << endl; kdDebug(5800) << "d1.secsTo(d2)=" << d1.secsTo(d2) << endl; @@ -51,11 +51,11 @@ using namespace KCal; libkcal: d1.addSecs(d1.secsTo(d2))=Son Okt 30 04:30:00 2005 Notice that secsTo counts the hour between 2:00 and 3:00 twice, while adddSecs doesn't and so has one additional hour. This basically makes it - impossible to use QDateTime for *any* calculations, in local time zone as + impossible to use TQDateTime for *any* calculations, in local time zone as well as in UTC. Since we don't want to use time zones anyway, but do all secondsly/minutely/hourly calculations in UTC, we simply use our own secsTo, which ignores all time zone shifts. */ -long long ownSecsTo( const QDateTime &dt1, const QDateTime &dt2 ) +long long ownSecsTo( const TQDateTime &dt1, const TQDateTime &dt2 ) { long long res = static_cast( dt1.date().daysTo( dt2.date() ) ) * 24*3600; res += dt1.time().secsTo( dt2.time() ); @@ -72,17 +72,17 @@ long long ownSecsTo( const QDateTime &dt1, const QDateTime &dt2 ) class DateHelper { public: #ifndef NDEBUG - static QString dayName( short day ); + static TQString dayName( short day ); #endif - static QDate getNthWeek( int year, int weeknumber, short weekstart = 1 ); + static TQDate getNthWeek( int year, int weeknumber, short weekstart = 1 ); static int weekNumbersInYear( int year, short weekstart = 1 ); - static int getWeekNumber( const QDate &date, short weekstart, int *year = 0 ); - static int getWeekNumberNeg( const QDate &date, short weekstart, int *year = 0 ); + static int getWeekNumber( const TQDate &date, short weekstart, int *year = 0 ); + static int getWeekNumberNeg( const TQDate &date, short weekstart, int *year = 0 ); }; #ifndef NDEBUG -QString DateHelper::dayName( short day ) +TQString DateHelper::dayName( short day ) { switch ( day ) { case 1: return "MO"; break; @@ -98,11 +98,11 @@ QString DateHelper::dayName( short day ) #endif -QDate DateHelper::getNthWeek( int year, int weeknumber, short weekstart ) +TQDate DateHelper::getNthWeek( int year, int weeknumber, short weekstart ) { - if ( weeknumber == 0 ) return QDate(); + if ( weeknumber == 0 ) return TQDate(); // Adjust this to the first day of week #1 of the year and add 7*weekno days. - QDate dt( year, 1, 4 ); // Week #1 is the week that contains Jan 4 + TQDate dt( year, 1, 4 ); // Week #1 is the week that contains Jan 4 int adjust = -(7 + dt.dayOfWeek() - weekstart) % 7; if ( weeknumber > 0 ) { dt = dt.addDays( 7 * (weeknumber-1) + adjust ); @@ -114,20 +114,20 @@ QDate DateHelper::getNthWeek( int year, int weeknumber, short weekstart ) } -int DateHelper::getWeekNumber( const QDate &date, short weekstart, int *year ) +int DateHelper::getWeekNumber( const TQDate &date, short weekstart, int *year ) { // kdDebug(5800) << "Getting week number for " << date << " with weekstart="<= 0 ) { @@ -141,13 +141,13 @@ int DateHelper::getWeekNumber( const QDate &date, short weekstart, int *year ) int DateHelper::weekNumbersInYear( int year, short weekstart ) { - QDate dt( year, 1, weekstart ); - QDate dt1( year + 1, 1, weekstart ); + TQDate dt( year, 1, weekstart ); + TQDate dt1( year + 1, 1, weekstart ); return dt.daysTo( dt1 ) / 7; } // Week number from the end of the year -int DateHelper::getWeekNumberNeg( const QDate &date, short weekstart, int *year ) +int DateHelper::getWeekNumberNeg( const TQDate &date, short weekstart, int *year ) { int weekpos = getWeekNumber( date, weekstart, year ); return weekNumbersInYear( *year, weekstart ) - weekpos - 1; @@ -168,7 +168,7 @@ RecurrenceRule::Constraint::Constraint( int wkst ) clear(); } -RecurrenceRule::Constraint::Constraint( const QDateTime &preDate, PeriodType type, int wkst ) +RecurrenceRule::Constraint::Constraint( const TQDateTime &preDate, PeriodType type, int wkst ) { weekstart = wkst; readDateTime( preDate, type ); @@ -188,7 +188,7 @@ void RecurrenceRule::Constraint::clear() yearday = 0; } -bool RecurrenceRule::Constraint::matches( const QDate &dt, RecurrenceRule::PeriodType type ) const +bool RecurrenceRule::Constraint::matches( const TQDate &dt, RecurrenceRule::PeriodType type ) const { // If the event recurs in week 53 or 1, the day might not belong to the same // year as the week it is in. E.g. Jan 1, 2005 is in week 53 of year 2004. @@ -233,7 +233,7 @@ bool RecurrenceRule::Constraint::matches( const QDate &dt, RecurrenceRule::Perio return true; } -bool RecurrenceRule::Constraint::matches( const QDateTime &dt, RecurrenceRule::PeriodType type ) const +bool RecurrenceRule::Constraint::matches( const TQDateTime &dt, RecurrenceRule::PeriodType type ) const { if ( !matches( dt.date(), type ) ) return false; if ( hour >= 0 && hour != dt.time().hour() ) return false; @@ -248,28 +248,28 @@ bool RecurrenceRule::Constraint::isConsistent( PeriodType /*period*/) const return true; } -QDateTime RecurrenceRule::Constraint::intervalDateTime( RecurrenceRule::PeriodType type ) const +TQDateTime RecurrenceRule::Constraint::intervalDateTime( RecurrenceRule::PeriodType type ) const { - QDateTime dt; - dt.setTime( QTime( 0, 0, 0 ) ); - dt.setDate( QDate( year, (month>0)?month:1, (day>0)?day:1 ) ); + TQDateTime dt; + dt.setTime( TQTime( 0, 0, 0 ) ); + dt.setDate( TQDate( year, (month>0)?month:1, (day>0)?day:1 ) ); if ( day < 0 ) dt = dt.addDays( dt.date().daysInMonth() + day ); switch ( type ) { case rSecondly: - dt.setTime( QTime( hour, minute, second ) ); break; + dt.setTime( TQTime( hour, minute, second ) ); break; case rMinutely: - dt.setTime( QTime( hour, minute, 1 ) ); break; + dt.setTime( TQTime( hour, minute, 1 ) ); break; case rHourly: - dt.setTime( QTime( hour, 1, 1 ) ); break; + dt.setTime( TQTime( hour, 1, 1 ) ); break; case rDaily: break; case rWeekly: dt = DateHelper::getNthWeek( year, weeknumber, weekstart ); break; case rMonthly: - dt.setDate( QDate( year, month, 1 ) ); break; + dt.setDate( TQDate( year, month, 1 ) ); break; case rYearly: - dt.setDate( QDate( year, 1, 1 ) ); break; + dt.setDate( TQDate( year, 1, 1 ) ); break; default: break; } @@ -300,16 +300,16 @@ DateTimeList RecurrenceRule::Constraint::dateTimes( RecurrenceRule::PeriodType t DateTimeList result; bool done = false; // TODO_Recurrence: Handle floating - QTime tm( hour, minute, second ); + TQTime tm( hour, minute, second ); if ( !isConsistent( type ) ) return result; if ( !done && day > 0 && month > 0 ) { - QDateTime dt( QDate( year, month, day ), tm ); + TQDateTime dt( TQDate( year, month, day ), tm ); if ( dt.isValid() ) result.append( dt ); done = true; } if ( !done && day < 0 && month > 0 ) { - QDateTime dt( QDate( year, month, 1 ), tm ); + TQDateTime dt( TQDate( year, month, 1 ), tm ); dt = dt.addDays( dt.date().daysInMonth() + day ); if ( dt.isValid() ) result.append( dt ); done = true; @@ -325,15 +325,15 @@ DateTimeList RecurrenceRule::Constraint::dateTimes( RecurrenceRule::PeriodType t if ( day > 0 ) { dstart = dend = day; } else if ( day < 0 ) { - QDate date( year, month, 1 ); + TQDate date( year, month, 1 ); dstart = dend = date.daysInMonth() + day + 1; } else { - QDate date( year, month, 1 ); + TQDate date( year, month, 1 ); dstart = 1; dend = date.daysInMonth(); } for ( uint d = dstart; d <= dend; ++d ) { - QDateTime dt( QDate( year, m, d ), tm ); + TQDateTime dt( TQDate( year, m, d ), tm ); if ( dt.isValid() ) result.append( dt ); } } @@ -344,21 +344,21 @@ DateTimeList RecurrenceRule::Constraint::dateTimes( RecurrenceRule::PeriodType t // If we have a yearday (and of course a year), we know the exact date if ( !done && yearday != 0 ) { // yearday < 0 means from end of year, so we'll need Jan 1 of the next year - QDate d( year + ((yearday>0)?0:1), 1, 1 ); + TQDate d( year + ((yearday>0)?0:1), 1, 1 ); d = d.addDays( yearday - ((yearday>0)?1:0) ); - result.append( QDateTime( d, tm ) ); + result.append( TQDateTime( d, tm ) ); done = true; } // Else: If we have a weeknumber, we have at most 7 possible dates, loop through them if ( !done && weeknumber != 0 ) { - QDate wst( DateHelper::getNthWeek( year, weeknumber, weekstart ) ); + TQDate wst( DateHelper::getNthWeek( year, weeknumber, weekstart ) ); if ( weekday != 0 ) { wst = wst.addDays( (7 + weekday - weekstart ) % 7 ); - result.append( QDateTime( wst, tm ) ); + result.append( TQDateTime( wst, tm ) ); } else { for ( int i = 0; i < 7; ++i ) { - result.append( QDateTime( wst, tm ) ); + result.append( TQDateTime( wst, tm ) ); wst = wst.addDays( 1 ); } } @@ -367,13 +367,13 @@ DateTimeList RecurrenceRule::Constraint::dateTimes( RecurrenceRule::PeriodType t // weekday is given if ( !done && weekday != 0 ) { - QDate dt( year, 1, 1 ); + TQDate dt( year, 1, 1 ); // If type == yearly and month is given, pos is still in month not year! // TODO_Recurrence: Correct handling of n-th BYDAY... int maxloop = 53; bool inMonth = ( type == rMonthly) || ( type == rYearly && month > 0 ); if ( inMonth && month > 0 ) { - dt = QDate( year, month, 1 ); + dt = TQDate( year, month, 1 ); maxloop = 5; } if ( weekdaynr < 0 ) { @@ -388,14 +388,14 @@ DateTimeList RecurrenceRule::Constraint::dateTimes( RecurrenceRule::PeriodType t if ( weekdaynr > 0 ) { dt = dt.addDays( ( weekdaynr - 1 ) * 7 ); - result.append( QDateTime( dt, tm ) ); + result.append( TQDateTime( dt, tm ) ); } else if ( weekdaynr < 0 ) { dt = dt.addDays( weekdaynr * 7 ); - result.append( QDateTime( dt, tm ) ); + result.append( TQDateTime( dt, tm ) ); } else { // loop through all possible weeks, non-matching will be filtered later for ( int i = 0; i < maxloop; ++i ) { - result.append( QDateTime( dt, tm ) ); + result.append( TQDateTime( dt, tm ) ); dt = dt.addDays( 7 ); } } @@ -418,7 +418,7 @@ bool RecurrenceRule::Constraint::increase( RecurrenceRule::PeriodType type, int { // convert the first day of the interval to QDateTime // Sub-daily types need to be converted to UTC to correctly handle DST shifts - QDateTime dt( intervalDateTime( type ) ); + TQDateTime dt( intervalDateTime( type ) ); // Now add the intervals switch ( type ) { @@ -439,13 +439,13 @@ bool RecurrenceRule::Constraint::increase( RecurrenceRule::PeriodType type, int default: break; } - // Convert back from QDateTime to the Constraint class + // Convert back from TQDateTime to the Constraint class readDateTime( dt, type ); return true; } -bool RecurrenceRule::Constraint::readDateTime( const QDateTime &preDate, PeriodType type ) +bool RecurrenceRule::Constraint::readDateTime( const TQDateTime &preDate, PeriodType type ) { clear(); switch ( type ) { @@ -558,11 +558,11 @@ void RecurrenceRule::setRecurrenceType( PeriodType period ) setDirty(); } -QDateTime RecurrenceRule::endDt( bool *result ) const +TQDateTime RecurrenceRule::endDt( bool *result ) const { if ( result ) *result = false; - if ( mPeriod == rNone ) return QDateTime(); - if ( mDuration < 0 ) return QDateTime(); + if ( mPeriod == rNone ) return TQDateTime(); + if ( mDuration < 0 ) return TQDateTime(); if ( mDuration == 0 ) { if ( result ) *result = true; return mDateEnd; @@ -570,13 +570,13 @@ QDateTime RecurrenceRule::endDt( bool *result ) const // N occurrences. Check if we have a full cache. If so, return the cached end date. if ( ! mCached ) { // If not enough occurrences can be found (i.e. inconsistent constraints) - if ( !buildCache() ) return QDateTime(); + if ( !buildCache() ) return TQDateTime(); } if ( result ) *result = true; return mCachedDateEnd; } -void RecurrenceRule::setEndDt( const QDateTime &dateTime ) +void RecurrenceRule::setEndDt( const TQDateTime &dateTime ) { if ( isReadOnly() ) return; mDateEnd = dateTime; @@ -623,13 +623,13 @@ void RecurrenceRule::setDirty() mDirty = true; mCached = false; mCachedDates.clear(); - for ( QValueList::ConstIterator it = mObservers.begin(); + for ( TQValueList::ConstIterator it = mObservers.begin(); it != mObservers.end(); ++it ) { if ( (*it) ) (*it)->recurrenceChanged( this ); } } -void RecurrenceRule::setStartDt( const QDateTime &start ) +void RecurrenceRule::setStartDt( const TQDateTime &start ) { if ( isReadOnly() ) return; mDateStart = start; @@ -643,21 +643,21 @@ void RecurrenceRule::setFrequency(int freq) setDirty(); } -void RecurrenceRule::setBySeconds( const QValueList bySeconds ) +void RecurrenceRule::setBySeconds( const TQValueList bySeconds ) { if ( isReadOnly() ) return; mBySeconds = bySeconds; setDirty(); } -void RecurrenceRule::setByMinutes( const QValueList byMinutes ) +void RecurrenceRule::setByMinutes( const TQValueList byMinutes ) { if ( isReadOnly() ) return; mByMinutes = byMinutes; setDirty(); } -void RecurrenceRule::setByHours( const QValueList byHours ) +void RecurrenceRule::setByHours( const TQValueList byHours ) { if ( isReadOnly() ) return; mByHours = byHours; @@ -665,42 +665,42 @@ void RecurrenceRule::setByHours( const QValueList byHours ) } -void RecurrenceRule::setByDays( const QValueList byDays ) +void RecurrenceRule::setByDays( const TQValueList byDays ) { if ( isReadOnly() ) return; mByDays = byDays; setDirty(); } -void RecurrenceRule::setByMonthDays( const QValueList byMonthDays ) +void RecurrenceRule::setByMonthDays( const TQValueList byMonthDays ) { if ( isReadOnly() ) return; mByMonthDays = byMonthDays; setDirty(); } -void RecurrenceRule::setByYearDays( const QValueList byYearDays ) +void RecurrenceRule::setByYearDays( const TQValueList byYearDays ) { if ( isReadOnly() ) return; mByYearDays = byYearDays; setDirty(); } -void RecurrenceRule::setByWeekNumbers( const QValueList byWeekNumbers ) +void RecurrenceRule::setByWeekNumbers( const TQValueList byWeekNumbers ) { if ( isReadOnly() ) return; mByWeekNumbers = byWeekNumbers; setDirty(); } -void RecurrenceRule::setByMonths( const QValueList byMonths ) +void RecurrenceRule::setByMonths( const TQValueList byMonths ) { if ( isReadOnly() ) return; mByMonths = byMonths; setDirty(); } -void RecurrenceRule::setBySetPos( const QValueList bySetPos ) +void RecurrenceRule::setBySetPos( const TQValueList bySetPos ) { if ( isReadOnly() ) return; mBySetPos = bySetPos; @@ -781,7 +781,7 @@ void RecurrenceRule::buildConstraints() Constraint::List tmp; Constraint::List::const_iterator it; - QValueList::const_iterator intit; + TQValueList::const_iterator intit; #define intConstraint( list, element ) \ if ( !list.isEmpty() ) { \ @@ -807,7 +807,7 @@ void RecurrenceRule::buildConstraints() if ( !mByDays.isEmpty() ) { for ( it = mConstraints.constBegin(); it != mConstraints.constEnd(); ++it ) { - QValueList::const_iterator dayit; + TQValueList::const_iterator dayit; for ( dayit = mByDays.constBegin(); dayit != mByDays.constEnd(); ++dayit ) { con = (*it); con.weekday = (*dayit).day(); @@ -882,7 +882,7 @@ kdDebug(5800) << " RecurrenceRule::buildCache: " << endl; // Build the list of all occurrences of this event (we need that to determine // the end date!) Constraint interval( getNextValidDateInterval( startDt(), recurrenceType() ) ); - QDateTime next; + TQDateTime next; DateTimeList dts = datesForInterval( interval, recurrenceType() ); DateTimeList::Iterator it = dts.begin(); @@ -924,12 +924,12 @@ kdDebug(5800) << " Finished Building Cache, cache has " << dts.count() << " e mCachedDateEnd = dts.last(); return true; } else { - mCachedDateEnd = QDateTime(); + mCachedDateEnd = TQDateTime(); return false; } } -bool RecurrenceRule::dateMatchesRules( const QDateTime &qdt ) const +bool RecurrenceRule::dateMatchesRules( const TQDateTime &qdt ) const { bool match = false; for ( Constraint::List::ConstIterator it = mConstraints.begin(); @@ -939,7 +939,7 @@ bool RecurrenceRule::dateMatchesRules( const QDateTime &qdt ) const return match; } -bool RecurrenceRule::recursOn( const QDate &qd ) const +bool RecurrenceRule::recursOn( const TQDate &qd ) const { // kdDebug(5800) << " RecurrenceRule::recursOn: " << qd << endl; if ( qd < startDt().date() ) return false; @@ -955,7 +955,7 @@ bool RecurrenceRule::recursOn( const QDate &qd ) const match = match || ( (*it).matches( qd, recurrenceType() ) ); } if ( !match ) return false; - QDateTime tmp( qd, QTime( 0, 0, 0 ) ); + TQDateTime tmp( qd, TQTime( 0, 0, 0 ) ); Constraint interval( getNextValidDateInterval( tmp, recurrenceType() ) ); // Constraint::matches is quite efficient, so first check if it can occur at // all before we calculate all actual dates. @@ -978,7 +978,7 @@ bool RecurrenceRule::recursOn( const QDate &qd ) const } -bool RecurrenceRule::recursAt( const QDateTime &qd ) const +bool RecurrenceRule::recursAt( const TQDateTime &qd ) const { // kdDebug(5800) << " RecurrenceRule::recursAt: " << qd << endl; if ( doesFloat() ) return recursOn( qd.date() ); @@ -1001,7 +1001,7 @@ bool RecurrenceRule::recursAt( const QDateTime &qd ) const } -TimeList RecurrenceRule::recurTimesOn( const QDate &date ) const +TimeList RecurrenceRule::recurTimesOn( const TQDate &date ) const { // kdDebug(5800) << " RecurrenceRule::recurTimesOn: " << date << endl; TimeList lst; @@ -1009,7 +1009,7 @@ TimeList RecurrenceRule::recurTimesOn( const QDate &date ) const if ( doesFloat() ) return lst; - QDateTime dt( date, QTime( 0, 0, 0 ) ); + TQDateTime dt( date, TQTime( 0, 0, 0 ) ); bool valid = dt.isValid() && ( dt.date() == date ); while ( valid ) { // TODO: Add a flag so that the date is never increased! @@ -1021,7 +1021,7 @@ TimeList RecurrenceRule::recurTimesOn( const QDate &date ) const } /** Returns the number of recurrences up to and including the date/time specified. */ -int RecurrenceRule::durationTo( const QDateTime &dt ) const +int RecurrenceRule::durationTo( const TQDateTime &dt ) const { // kdDebug(5800) << " RecurrenceRule::durationTo: " << dt << endl; // Easy cases: either before start, or after all recurrences and we know @@ -1031,7 +1031,7 @@ int RecurrenceRule::durationTo( const QDateTime &dt ) const // if ( dt == startDt() ) return 1; if ( mDuration > 0 && dt >= endDt() ) return mDuration; - QDateTime next( startDt() ); + TQDateTime next( startDt() ); int found = 0; while ( next.isValid() && next <= dt ) { ++found; @@ -1041,15 +1041,15 @@ int RecurrenceRule::durationTo( const QDateTime &dt ) const } -QDateTime RecurrenceRule::getPreviousDate( const QDateTime& afterDate ) const +TQDateTime RecurrenceRule::getPreviousDate( const TQDateTime& afterDate ) const { // kdDebug(5800) << " RecurrenceRule::getPreviousDate: " << afterDate << endl; // Beyond end of recurrence if ( afterDate < startDt() ) - return QDateTime(); + return TQDateTime(); // If we have a cache (duration given), use that - QDateTime prev; + TQDateTime prev; if ( mDuration > 0 ) { if ( !mCached ) buildCache(); DateTimeList::ConstIterator it = mCachedDates.begin(); @@ -1058,7 +1058,7 @@ QDateTime RecurrenceRule::getPreviousDate( const QDateTime& afterDate ) const ++it; } if ( prev.isValid() && prev < afterDate ) return prev; - else return QDateTime(); + else return TQDateTime(); } // kdDebug(5800) << " getNext date after " << preDate << endl; @@ -1077,7 +1077,7 @@ QDateTime RecurrenceRule::getPreviousDate( const QDateTime& afterDate ) const } while ( dtit != dts.begin() && (*dtit) >= prev ); if ( (*dtit) < prev ) { if ( (*dtit) >= startDt() ) return (*dtit); - else return QDateTime(); + else return TQDateTime(); } } @@ -1092,22 +1092,22 @@ QDateTime RecurrenceRule::getPreviousDate( const QDateTime& afterDate ) const if ( dts.count() > 0 ) { prev = dts.last(); if ( prev.isValid() && prev >= startDt() ) return prev; - else return QDateTime(); + else return TQDateTime(); } } - return QDateTime(); + return TQDateTime(); } -QDateTime RecurrenceRule::getNextDate( const QDateTime &preDate ) const +TQDateTime RecurrenceRule::getNextDate( const TQDateTime &preDate ) const { // kdDebug(5800) << " RecurrenceRule::getNextDate: " << preDate << endl; // Beyond end of recurrence if ( mDuration >= 0 && endDt().isValid() && preDate >= endDt() ) - return QDateTime(); + return TQDateTime(); // Start date is only included if it really matches - QDateTime adjustedPreDate; + TQDateTime adjustedPreDate; if ( preDate < startDt() ) adjustedPreDate = startDt().addSecs( -1 ); else @@ -1129,7 +1129,7 @@ QDateTime RecurrenceRule::getNextDate( const QDateTime &preDate ) const DateTimeList::Iterator dtit = dts.begin(); while ( dtit != dts.end() && (*dtit) <= adjustedPreDate ) ++dtit; if ( dtit != dts.end() ) { - if ( mDuration >= 0 && (*dtit) > endDt() ) return QDateTime(); + if ( mDuration >= 0 && (*dtit) > endDt() ) return TQDateTime(); else return (*dtit); } @@ -1141,23 +1141,23 @@ QDateTime RecurrenceRule::getNextDate( const QDateTime &preDate ) const interval.increase( recurrenceType(), frequency() ); DateTimeList dts = datesForInterval( interval, recurrenceType() ); if ( dts.count() > 0 ) { - QDateTime ret( dts.first() ); - if ( mDuration >= 0 && ret > endDt() ) return QDateTime(); + TQDateTime ret( dts.first() ); + if ( mDuration >= 0 && ret > endDt() ) return TQDateTime(); else return ret; } ++loopnr; } - return QDateTime(); + return TQDateTime(); } -RecurrenceRule::Constraint RecurrenceRule::getPreviousValidDateInterval( const QDateTime &preDate, PeriodType type ) const +RecurrenceRule::Constraint RecurrenceRule::getPreviousValidDateInterval( const TQDateTime &preDate, PeriodType type ) const { // kdDebug(5800) << " (o) getPreviousValidDateInterval after " << preDate << ", type=" << type << endl; long periods = 0; - QDateTime nextValid = startDt(); - QDateTime start = startDt(); + TQDateTime nextValid = startDt(); + TQDateTime start = startDt(); int modifier = 1; - QDateTime toDate( preDate ); + TQDateTime toDate( preDate ); // for super-daily recurrences, don't care about the time part // Find the #intervals since the dtstart and round to the next multiple of @@ -1195,7 +1195,7 @@ RecurrenceRule::Constraint RecurrenceRule::getPreviousValidDateInterval( const Q periods = ( periods / frequency() ) * frequency(); // set the day to the first day of the month, so we don't have problems // with non-existent days like Feb 30 or April 31 - start.setDate( QDate( start.date().year(), start.date().month(), 1 ) ); + start.setDate( TQDate( start.date().year(), start.date().month(), 1 ) ); nextValid.setDate( start.date().addMonths( periods ) ); break; } case rYearly: @@ -1212,15 +1212,15 @@ RecurrenceRule::Constraint RecurrenceRule::getPreviousValidDateInterval( const Q return Constraint( nextValid, type, mWeekStart ); } -RecurrenceRule::Constraint RecurrenceRule::getNextValidDateInterval( const QDateTime &preDate, PeriodType type ) const +RecurrenceRule::Constraint RecurrenceRule::getNextValidDateInterval( const TQDateTime &preDate, PeriodType type ) const { // TODO: Simplify this! kdDebug(5800) << " (o) getNextValidDateInterval after " << preDate << ", type=" << type << endl; long periods = 0; - QDateTime start = startDt(); - QDateTime nextValid( start ); + TQDateTime start = startDt(); + TQDateTime nextValid( start ); int modifier = 1; - QDateTime toDate( preDate ); + TQDateTime toDate( preDate ); // for super-daily recurrences, don't care about the time part // Find the #intervals since the dtstart and round to the next multiple of @@ -1262,7 +1262,7 @@ RecurrenceRule::Constraint RecurrenceRule::getNextValidDateInterval( const QDate periods += (frequency() - 1 - ( (periods - 1) % frequency() ) ); // set the day to the first day of the month, so we don't have problems // with non-existent days like Feb 30 or April 31 - start.setDate( QDate( start.date().year(), start.date().month(), 1 ) ); + start.setDate( TQDate( start.date().year(), start.date().month(), 1 ) ); nextValid.setDate( start.date().addMonths( periods ) ); break; } case rYearly: @@ -1353,7 +1353,7 @@ DateTimeList RecurrenceRule::datesForInterval( const Constraint &interval, Perio if ( !mBySetPos.isEmpty() ) { DateTimeList tmplst = lst; lst.clear(); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for ( it = mBySetPos.begin(); it != mBySetPos.end(); ++it ) { int pos = *it; if ( pos > 0 ) --pos; @@ -1385,10 +1385,10 @@ void RecurrenceRule::dump() const #define dumpByIntList(list,label) \ if ( !list.isEmpty() ) {\ - QStringList lst;\ - for ( QValueList::ConstIterator it = list.begin();\ + TQStringList lst;\ + for ( TQValueList::ConstIterator it = list.begin();\ it != list.end(); ++it ) {\ - lst.append( QString::number( *it ) );\ + lst.append( TQString::number( *it ) );\ }\ kdDebug(5800) << " " << label << lst.join(", ") << endl;\ } @@ -1396,10 +1396,10 @@ void RecurrenceRule::dump() const dumpByIntList( mByMinutes, "ByMinutes: " ); dumpByIntList( mByHours, "ByHours: " ); if ( !mByDays.isEmpty() ) { - QStringList lst; - for ( QValueList::ConstIterator it = mByDays.begin(); + TQStringList lst; + for ( TQValueList::ConstIterator it = mByDays.begin(); it != mByDays.end(); ++it ) { - lst.append( ( ((*it).pos()!=0) ? QString::number( (*it).pos() ) : "" ) + + lst.append( ( ((*it).pos()!=0) ? TQString::number( (*it).pos() ) : "" ) + DateHelper::dayName( (*it).day() ) ); } kdDebug(5800) << " ByDays: " << lst.join(", ") << endl; diff --git a/libkcal/recurrencerule.h b/libkcal/recurrencerule.h index ad72f2561..049d9c523 100644 --- a/libkcal/recurrencerule.h +++ b/libkcal/recurrencerule.h @@ -24,19 +24,19 @@ #ifndef KCAL_RECURRENCERULE_H #define KCAL_RECURRENCERULE_H -#include +#include #include #include "libkcal_export.h" template -Q_INLINE_TEMPLATES void qSortUnique( QValueList &lst ) +Q_INLINE_TEMPLATES void qSortUnique( TQValueList &lst ) { qHeapSort( lst ); if ( lst.isEmpty() ) return; // Remove all duplicates from the times list // TODO: Make this more efficient! - QValueListIterator it = lst.begin(); + TQValueListIterator it = lst.begin(); T last = *it; ++it; T newlast; @@ -53,9 +53,9 @@ Q_INLINE_TEMPLATES void qSortUnique( QValueList &lst ) namespace KCal { -typedef QValueList DateTimeList; -typedef QValueList DateList; -typedef QValueList TimeList; +typedef TQValueList DateTimeList; +typedef TQValueList DateList; +typedef TQValueList TimeList; @@ -129,9 +129,9 @@ class LIBKCAL_EXPORT RecurrenceRule /** Return the start of the recurrence */ - QDateTime startDt() const { return mDateStart; } + TQDateTime startDt() const { return mDateStart; } /** Set start of recurrence, as a date and time. */ - void setStartDt(const QDateTime &start); + void setStartDt(const TQDateTime &start); /** Returns whether the start date has no time associated. Floating means -- according to rfc2445 -- that the event has no time associate. */ @@ -145,10 +145,10 @@ class LIBKCAL_EXPORT RecurrenceRule * @param result if non-null, *result is updated to true if successful, * or false if there is no recurrence. */ - QDateTime endDt( bool* result = 0 ) const; + TQDateTime endDt( bool* result = 0 ) const; /** Sets the date and time of the last recurrence. * @param endDateTime the ending date/time after which to stop recurring. */ - void setEndDt(const QDateTime &endDateTime); + void setEndDt(const TQDateTime &endDateTime); /** @@ -160,33 +160,33 @@ class LIBKCAL_EXPORT RecurrenceRule * first and last. */ void setDuration(int duration); // /** Returns the number of recurrences up to and including the date specified. */ -// int durationTo(const QDate &) const; +// int durationTo(const TQDate &) const; /** Returns the number of recurrences up to and including the date/time specified. */ - int durationTo(const QDateTime &) const; + int durationTo(const TQDateTime &) const; /** Returns the number of recurrences up to and including the date specified. */ - int durationTo( const QDate &date ) const { return durationTo( QDateTime( date, QTime( 23, 59, 59 ) ) ); } + int durationTo( const TQDate &date ) const { return durationTo( TQDateTime( date, TQTime( 23, 59, 59 ) ) ); } /** Returns true if the date specified is one on which the event will * recur. The start date returns true only if it actually matches the rule. */ - bool recursOn( const QDate &qd ) const; + bool recursOn( const TQDate &qd ) const; /** Returns true if the date/time specified is one at which the event will * recur. Times are rounded down to the nearest minute to determine the result. * The start date/time returns true only if it actually matches the rule. */ - bool recursAt( const QDateTime & ) const; + bool recursAt( const TQDateTime & ) const; /** Returns true if the date matches the rules. It does not necessarily mean that this is an actual occurrence. In particular, the method does not check if the date is after the end date, or if the frequency interval matches */ - bool dateMatchesRules( const QDateTime &qdt ) const; + bool dateMatchesRules( const TQDateTime &qdt ) const; /** Returns a list of the times on the specified date at which the * recurrence will occur. * @param date the date for which to find the recurrence times. */ - TimeList recurTimesOn( const QDate &date ) const; + TimeList recurTimesOn( const TQDate &date ) const; /** Returns the date and time of the next recurrence, after the specified date/time. @@ -194,40 +194,40 @@ class LIBKCAL_EXPORT RecurrenceRule * @param preDateTime the date/time after which to find the recurrence. * @return date/time of next recurrence, or invalid date if none. */ - QDateTime getNextDate( const QDateTime& preDateTime ) const; + TQDateTime getNextDate( const TQDateTime& preDateTime ) const; /** Returns the date and time of the last previous recurrence, before the specified date/time. * If a time later than 00:00:00 is specified and the recurrence has no time, 00:00:00 on * the specified date is returned if that date recurs. * @param afterDateTime the date/time before which to find the recurrence. * @return date/time of previous recurrence, or invalid date if none. */ - QDateTime getPreviousDate( const QDateTime& afterDateTime ) const; + TQDateTime getPreviousDate( const TQDateTime& afterDateTime ) const; - void setBySeconds( const QValueList bySeconds ); - void setByMinutes( const QValueList byMinutes ); - void setByHours( const QValueList byHours ); + void setBySeconds( const TQValueList bySeconds ); + void setByMinutes( const TQValueList byMinutes ); + void setByHours( const TQValueList byHours ); - void setByDays( const QValueList byDays ); - void setByMonthDays( const QValueList byMonthDays ); - void setByYearDays( const QValueList byYearDays ); - void setByWeekNumbers( const QValueList byWeekNumbers ); - void setByMonths( const QValueList byMonths ); - void setBySetPos( const QValueList bySetPos ); + void setByDays( const TQValueList byDays ); + void setByMonthDays( const TQValueList byMonthDays ); + void setByYearDays( const TQValueList byYearDays ); + void setByWeekNumbers( const TQValueList byWeekNumbers ); + void setByMonths( const TQValueList byMonths ); + void setBySetPos( const TQValueList bySetPos ); void setWeekStart( short weekStart ); - const QValueList &bySeconds() const { return mBySeconds; } - const QValueList &byMinutes() const { return mByMinutes; } - const QValueList &byHours() const { return mByHours; } + const TQValueList &bySeconds() const { return mBySeconds; } + const TQValueList &byMinutes() const { return mByMinutes; } + const TQValueList &byHours() const { return mByHours; } - const QValueList &byDays() const { return mByDays; } - const QValueList &byMonthDays() const { return mByMonthDays; } - const QValueList &byYearDays() const { return mByYearDays; } - const QValueList &byWeekNumbers() const { return mByWeekNumbers; } - const QValueList &byMonths() const { return mByMonths; } - const QValueList &bySetPos() const { return mBySetPos; } + const TQValueList &byDays() const { return mByDays; } + const TQValueList &byMonthDays() const { return mByMonthDays; } + const TQValueList &byYearDays() const { return mByYearDays; } + const TQValueList &byWeekNumbers() const { return mByWeekNumbers; } + const TQValueList &byMonths() const { return mByMonths; } + const TQValueList &bySetPos() const { return mBySetPos; } short weekStart() const { return mWeekStart; } @@ -252,12 +252,12 @@ class LIBKCAL_EXPORT RecurrenceRule Debug output. */ void dump() const; - QString mRRule; + TQString mRRule; private: class Constraint { public: - typedef QValueList List; + typedef TQValueList List; Constraint( int wkst = 1 ); /* Constraint( const Constraint &con ) : @@ -265,7 +265,7 @@ class LIBKCAL_EXPORT RecurrenceRule hour(con.hour), minute(con.minute), second(con.second), weekday(con.weekday), weeknumber(con.weeknumber), yearday(con.yearday), weekstart(con.weekstart) {}*/ - Constraint( const QDateTime &preDate, PeriodType type, int wkst ); + Constraint( const TQDateTime &preDate, PeriodType type, int wkst ); void clear(); int year; // 0 means unspecified @@ -280,19 +280,19 @@ class LIBKCAL_EXPORT RecurrenceRule int yearday; // 0 means unspecified int weekstart; // first day of week (1=monday, 7=sunday, 0=unspec.) - bool readDateTime( const QDateTime &preDate, PeriodType type ); - bool matches( const QDate &dt, RecurrenceRule::PeriodType type ) const; - bool matches( const QDateTime &dt, RecurrenceRule::PeriodType type ) const; + bool readDateTime( const TQDateTime &preDate, PeriodType type ); + bool matches( const TQDate &dt, RecurrenceRule::PeriodType type ) const; + bool matches( const TQDateTime &dt, RecurrenceRule::PeriodType type ) const; bool isConsistent() const; bool isConsistent( PeriodType period ) const; bool increase( PeriodType type, int freq ); - QDateTime intervalDateTime( PeriodType type ) const; + TQDateTime intervalDateTime( PeriodType type ) const; DateTimeList dateTimes( PeriodType type ) const; void dump() const; }; - Constraint getNextValidDateInterval( const QDateTime &preDate, PeriodType type ) const; - Constraint getPreviousValidDateInterval( const QDateTime &preDate, PeriodType type ) const; + Constraint getNextValidDateInterval( const TQDateTime &preDate, PeriodType type ) const; + Constraint getPreviousValidDateInterval( const TQDateTime &preDate, PeriodType type ) const; DateTimeList datesForInterval( const Constraint &interval, PeriodType type ) const; bool mergeIntervalConstraint( Constraint *merged, const Constraint &conit, const Constraint &interval ) const; @@ -300,39 +300,39 @@ class LIBKCAL_EXPORT RecurrenceRule PeriodType mPeriod; - QDateTime mDateStart; + TQDateTime mDateStart; /** how often it recurs (including dtstart): -1 means infinitely, 0 means an explicit end date, positive values give the number of occurrences */ int mDuration; - QDateTime mDateEnd; + TQDateTime mDateEnd; uint mFrequency; bool mIsReadOnly; bool mFloating; - QValueList mBySeconds; // values: second 0-59 - QValueList mByMinutes; // values: minute 0-59 - QValueList mByHours; // values: hour 0-23 + TQValueList mBySeconds; // values: second 0-59 + TQValueList mByMinutes; // values: minute 0-59 + TQValueList mByHours; // values: hour 0-23 - QValueList mByDays; // n-th weekday of the month or year - QValueList mByMonthDays; // values: day -31 to -1 and 1-31 - QValueList mByYearDays; // values: day -366 to -1 and 1-366 - QValueList mByWeekNumbers; // values: week -53 to -1 and 1-53 - QValueList mByMonths; // values: month 1-12 - QValueList mBySetPos; // values: position -366 to -1 and 1-366 + TQValueList mByDays; // n-th weekday of the month or year + TQValueList mByMonthDays; // values: day -31 to -1 and 1-31 + TQValueList mByYearDays; // values: day -366 to -1 and 1-366 + TQValueList mByWeekNumbers; // values: week -53 to -1 and 1-53 + TQValueList mByMonths; // values: month 1-12 + TQValueList mBySetPos; // values: position -366 to -1 and 1-366 short mWeekStart; // first day of the week (1=Monday, 7=Sunday) Constraint::List mConstraints; void buildConstraints(); bool mDirty; - QValueList mObservers; + TQValueList mObservers; // Cache for duration mutable DateTimeList mCachedDates; mutable bool mCached; - mutable QDateTime mCachedDateEnd; + mutable TQDateTime mCachedDateEnd; class Private; Private *d; diff --git a/libkcal/resourcecached.cpp b/libkcal/resourcecached.cpp index 09862b25a..22fa79bb9 100644 --- a/libkcal/resourcecached.cpp +++ b/libkcal/resourcecached.cpp @@ -19,11 +19,11 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -43,14 +43,14 @@ using namespace KCal; ResourceCached::ResourceCached( const KConfig* config ) - : ResourceCalendar( config ), mCalendar( QString::fromLatin1( "UTC" ) ), + : ResourceCalendar( config ), mCalendar( TQString::fromLatin1( "UTC" ) ), mReloadPolicy( ReloadNever ), mReloadInterval( 10 ), mReloadTimer( 0, "mReloadTimer" ), mReloaded( false ), mSavePolicy( SaveNever ), mSaveInterval( 10 ), mSaveTimer( 0, "mSaveTimer" ), mIdMapper( "kcal/uidmaps/" ) { - connect( &mReloadTimer, SIGNAL( timeout() ), SLOT( slotReload() ) ); - connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( slotSave() ) ); + connect( &mReloadTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotReload() ) ); + connect( &mSaveTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotSave() ) ); } ResourceCached::~ResourceCached() @@ -164,12 +164,12 @@ bool ResourceCached::deleteEvent( Event *event ) } -Event *ResourceCached::event( const QString &uid ) +Event *ResourceCached::event( const TQString &uid ) { return mCalendar.event( uid ); } -Event::List ResourceCached::rawEventsForDate( const QDate &qd, +Event::List ResourceCached::rawEventsForDate( const TQDate &qd, EventSortField sortField, SortDirection sortDirection ) { @@ -178,13 +178,13 @@ Event::List ResourceCached::rawEventsForDate( const QDate &qd, return list; } -Event::List ResourceCached::rawEvents( const QDate &start, const QDate &end, +Event::List ResourceCached::rawEvents( const TQDate &start, const TQDate &end, bool inclusive ) { return mCalendar.rawEvents( start, end, inclusive ); } -Event::List ResourceCached::rawEventsForDate( const QDateTime &qdt ) +Event::List ResourceCached::rawEventsForDate( const TQDateTime &qdt ) { return mCalendar.rawEventsForDate( qdt.date() ); } @@ -215,12 +215,12 @@ Todo::List ResourceCached::rawTodos( TodoSortField sortField, SortDirection sort return mCalendar.rawTodos( sortField, sortDirection ); } -Todo *ResourceCached::todo( const QString &uid ) +Todo *ResourceCached::todo( const TQString &uid ) { return mCalendar.todo( uid ); } -Todo::List ResourceCached::rawTodosForDate( const QDate &date ) +Todo::List ResourceCached::rawTodosForDate( const TQDate &date ) { return mCalendar.rawTodosForDate( date ); } @@ -233,7 +233,7 @@ bool ResourceCached::addJournal( Journal *journal ) return mCalendar.addJournal( journal ); } -Journal *ResourceCached::journal( const QString &uid ) +Journal *ResourceCached::journal( const TQString &uid ) { return mCalendar.journal( uid ); } @@ -243,30 +243,30 @@ Journal::List ResourceCached::rawJournals( JournalSortField sortField, SortDirec return mCalendar.rawJournals( sortField, sortDirection ); } -Journal::List ResourceCached::rawJournalsForDate( const QDate &date ) +Journal::List ResourceCached::rawJournalsForDate( const TQDate &date ) { return mCalendar.rawJournalsForDate( date ); } -Alarm::List ResourceCached::alarmsTo( const QDateTime &to ) +Alarm::List ResourceCached::alarmsTo( const TQDateTime &to ) { return mCalendar.alarmsTo( to ); } -Alarm::List ResourceCached::alarms( const QDateTime &from, const QDateTime &to ) +Alarm::List ResourceCached::alarms( const TQDateTime &from, const TQDateTime &to ) { // kdDebug(5800) << "ResourceCached::alarms(" << from.toString() << " - " << to.toString() << ")\n"; return mCalendar.alarms( from, to ); } -void ResourceCached::setTimeZoneId( const QString& tzid ) +void ResourceCached::setTimeZoneId( const TQString& tzid ) { mCalendar.setTimeZoneId( tzid ); } -QString ResourceCached::timeZoneId() const +TQString ResourceCached::timeZoneId() const { return mCalendar.timeZoneId(); } @@ -317,7 +317,7 @@ void ResourceCached::clearCache() void ResourceCached::cleanUpEventCache( const Event::List &eventList ) { - CalendarLocal calendar ( QString::fromLatin1( "UTC" ) ); + CalendarLocal calendar ( TQString::fromLatin1( "UTC" ) ); if ( KStandardDirs::exists( cacheFile() ) ) calendar.load( cacheFile() ); @@ -346,7 +346,7 @@ void ResourceCached::cleanUpEventCache( const Event::List &eventList ) void ResourceCached::cleanUpTodoCache( const Todo::List &todoList ) { - CalendarLocal calendar ( QString::fromLatin1( "UTC" ) ); + CalendarLocal calendar ( TQString::fromLatin1( "UTC" ) ); if ( KStandardDirs::exists( cacheFile() ) ) calendar.load( cacheFile() ); @@ -379,22 +379,22 @@ KPIM::IdMapper& ResourceCached::idMapper() return mIdMapper; } -QString ResourceCached::cacheFile() const +TQString ResourceCached::cacheFile() const { return locateLocal( "cache", "kcal/kresources/" + identifier() ); } -QString ResourceCached::changesCacheFile( const QString &type ) const +TQString ResourceCached::changesCacheFile( const TQString &type ) const { return locateLocal( "cache", "kcal/changescache/" + identifier() + "_" + type ); } -void ResourceCached::saveChangesCache( const QMap &map, const QString &type ) +void ResourceCached::saveChangesCache( const TQMap &map, const TQString &type ) { - CalendarLocal calendar ( QString::fromLatin1( "UTC" ) ); + CalendarLocal calendar ( TQString::fromLatin1( "UTC" ) ); bool isEmpty = true; - QMap::ConstIterator it; + TQMap::ConstIterator it; for ( it = map.begin(); it != map.end(); ++it ) { isEmpty = false; calendar.addIncidence( it.key()->clone() ); @@ -403,7 +403,7 @@ void ResourceCached::saveChangesCache( const QMap &map, const if ( !isEmpty ) { calendar.save( changesCacheFile( type ) ); } else { - QFile file( changesCacheFile( type ) ); + TQFile file( changesCacheFile( type ) ); file.remove(); } @@ -417,9 +417,9 @@ void ResourceCached::saveChangesCache() saveChangesCache( mChangedIncidences, "changed" ); } -void ResourceCached::loadChangesCache( QMap &map, const QString &type ) +void ResourceCached::loadChangesCache( TQMap &map, const TQString &type ) { - CalendarLocal calendar ( QString::fromLatin1( "UTC" ) ); + CalendarLocal calendar ( TQString::fromLatin1( "UTC" ) ); if ( KStandardDirs::exists( changesCacheFile( type ) ) ) calendar.load( changesCacheFile( type ) ); @@ -448,7 +448,7 @@ void ResourceCached::calendarIncidenceAdded( Incidence *i ) << i->uid() << endl; #endif - QMap::ConstIterator it; + TQMap::ConstIterator it; it = mAddedIncidences.find( i ); if ( it == mAddedIncidences.end() ) { mAddedIncidences.insert( i, true ); @@ -464,7 +464,7 @@ void ResourceCached::calendarIncidenceChanged( Incidence *i ) << i->uid() << endl; #endif - QMap::ConstIterator it; + TQMap::ConstIterator it; it = mChangedIncidences.find( i ); // FIXME: If you modify an added incidence, there's no need to add it to mChangedIncidences! if ( it == mChangedIncidences.end() ) { @@ -481,7 +481,7 @@ void ResourceCached::calendarIncidenceDeleted( Incidence *i ) << i->uid() << endl; #endif - QMap::ConstIterator it; + TQMap::ConstIterator it; it = mDeletedIncidences.find( i ); if ( it == mDeletedIncidences.end() ) { mDeletedIncidences.insert( i, true ); @@ -493,7 +493,7 @@ void ResourceCached::calendarIncidenceDeleted( Incidence *i ) Incidence::List ResourceCached::addedIncidences() const { Incidence::List added; - QMap::ConstIterator it; + TQMap::ConstIterator it; for( it = mAddedIncidences.begin(); it != mAddedIncidences.end(); ++it ) { added.append( it.key() ); } @@ -503,7 +503,7 @@ Incidence::List ResourceCached::addedIncidences() const Incidence::List ResourceCached::changedIncidences() const { Incidence::List changed; - QMap::ConstIterator it; + TQMap::ConstIterator it; for( it = mChangedIncidences.begin(); it != mChangedIncidences.end(); ++it ) { changed.append( it.key() ); } @@ -513,7 +513,7 @@ Incidence::List ResourceCached::changedIncidences() const Incidence::List ResourceCached::deletedIncidences() const { Incidence::List deleted; - QMap::ConstIterator it; + TQMap::ConstIterator it; for( it = mDeletedIncidences.begin(); it != mDeletedIncidences.end(); ++it ) { deleted.append( it.key() ); } @@ -523,7 +523,7 @@ Incidence::List ResourceCached::deletedIncidences() const Incidence::List ResourceCached::allChanges() const { Incidence::List changes; - QMap::ConstIterator it; + TQMap::ConstIterator it; for( it = mAddedIncidences.begin(); it != mAddedIncidences.end(); ++it ) { changes.append( it.key() ); } @@ -547,9 +547,9 @@ void ResourceCached::clearChange( Incidence *incidence ) clearChange( incidence->uid() ); } -void ResourceCached::clearChange( const QString &uid ) +void ResourceCached::clearChange( const TQString &uid ) { - QMap::Iterator it; + TQMap::Iterator it; for ( it = mAddedIncidences.begin(); it != mAddedIncidences.end(); ++it ) if ( it.key()->uid() == uid ) { @@ -623,7 +623,7 @@ bool ResourceCached::checkForSave() return true; } -void ResourceCached::addInfoText( QString &txt ) const +void ResourceCached::addInfoText( TQString &txt ) const { if ( mLastLoad.isValid() ) { txt += "
            "; diff --git a/libkcal/resourcecached.h b/libkcal/resourcecached.h index bd997da53..efda5a232 100644 --- a/libkcal/resourcecached.h +++ b/libkcal/resourcecached.h @@ -29,10 +29,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -123,12 +123,12 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, /** Return time of last load. */ - QDateTime lastLoad() const; + TQDateTime lastLoad() const; /** Return time of last save. */ - QDateTime lastSave() const; + TQDateTime lastSave() const; /** Add event to calendar. @@ -142,7 +142,7 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, /** Retrieves an event on the basis of the unique string ID. */ - Event *event(const QString &UniqueStr); + Event *event(const TQString &UniqueStr); /** Return filtered list of all events in calendar. */ @@ -155,17 +155,17 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, Builds and then returns a list of all events that match for the date specified. useful for dayView, etc. etc. */ - Event::List rawEventsForDate( const QDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ); + Event::List rawEventsForDate( const TQDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ); /** Get unfiltered events for date \a qdt. */ - Event::List rawEventsForDate( const QDateTime &qdt ); + Event::List rawEventsForDate( const TQDateTime &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. */ - Event::List rawEvents( const QDate &start, const QDate &end, + Event::List rawEvents( const TQDate &start, const TQDate &end, bool inclusive = false ); /** @@ -180,7 +180,7 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, Searches todolist for an event with this unique string identifier, returns a pointer or null. */ - Todo *todo( const QString &uid ); + Todo *todo( const TQString &uid ); /** Return list of all todos. */ @@ -188,7 +188,7 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, /** Returns list of todos due on the specified date. */ - Todo::List rawTodosForDate( const QDate &date ); + Todo::List rawTodosForDate( const TQDate &date ); /** Add a Journal entry to calendar */ @@ -200,7 +200,7 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, /** Return Journal with given unique id. */ - virtual Journal *journal( const QString &uid ); + virtual Journal *journal( const TQString &uid ); /** Return list of all journals. */ @@ -208,24 +208,24 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, /** Return list of journals for the given date. */ - Journal::List rawJournalsForDate( const QDate &date ); + Journal::List rawJournalsForDate( const TQDate &date ); /** Return all alarms, which ocur in the given time interval. */ - Alarm::List alarms( const QDateTime &from, const QDateTime &to ); + Alarm::List alarms( const TQDateTime &from, const TQDateTime &to ); /** Return all alarms, which ocur before given date. */ - Alarm::List alarmsTo( const QDateTime &to ); + Alarm::List alarmsTo( const TQDateTime &to ); /** Set id of timezone, e.g. "Europe/Berlin" */ - void setTimeZoneId( const QString &timeZoneId ); + void setTimeZoneId( const TQString &timeZoneId ); - QString timeZoneId() const; + TQString timeZoneId() const; /** Return the owner of the calendar's full name. @@ -240,7 +240,7 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, void disableChangeNotification(); void clearChange( Incidence * ); - void clearChange( const QString &uid ); + void clearChange( const TQString &uid ); void clearChanges(); @@ -304,7 +304,7 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, void checkForAutomaticSave(); - void addInfoText( QString & ) const; + void addInfoText( TQString & ) const; void setupSaveTimer(); void setupReloadTimer(); @@ -313,15 +313,15 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, This method is used by loadCache() and saveCache(), reimplement it to change the location of the cache. */ - virtual QString cacheFile() const; + virtual TQString cacheFile() const; /** Functions for keeping the changes persistent. */ - virtual QString changesCacheFile( const QString& ) const; - void loadChangesCache( QMap&, const QString& ); + virtual TQString changesCacheFile( const TQString& ) const; + void loadChangesCache( TQMap&, const TQString& ); void loadChangesCache(); - void saveChangesCache( const QMap&, const QString& ); + void saveChangesCache( const TQMap&, const TQString& ); void saveChangesCache(); protected slots: @@ -333,19 +333,19 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar, private: int mReloadPolicy; int mReloadInterval; - QTimer mReloadTimer; + TQTimer mReloadTimer; bool mReloaded; int mSavePolicy; int mSaveInterval; - QTimer mSaveTimer; + TQTimer mSaveTimer; - QDateTime mLastLoad; - QDateTime mLastSave; + TQDateTime mLastLoad; + TQDateTime mLastSave; - QMap mAddedIncidences; - QMap mChangedIncidences; - QMap mDeletedIncidences; + TQMap mAddedIncidences; + TQMap mChangedIncidences; + TQMap mDeletedIncidences; KPIM::IdMapper mIdMapper; diff --git a/libkcal/resourcecachedconfig.cpp b/libkcal/resourcecachedconfig.cpp index 4e701db3b..c1793c26a 100644 --- a/libkcal/resourcecachedconfig.cpp +++ b/libkcal/resourcecachedconfig.cpp @@ -19,12 +19,12 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -35,24 +35,24 @@ using namespace KCal; -ResourceCachedReloadConfig::ResourceCachedReloadConfig( QWidget *parent, +ResourceCachedReloadConfig::ResourceCachedReloadConfig( TQWidget *parent, const char *name ) - : QWidget( parent, name ) + : TQWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + TQBoxLayout *topLayout = new TQVBoxLayout( this ); - mGroup = new QButtonGroup( 1, Horizontal, i18n("Automatic Reload"), this ); + mGroup = new TQButtonGroup( 1, Horizontal, i18n("Automatic Reload"), this ); topLayout->addWidget( mGroup ); - new QRadioButton( i18n("Never"), mGroup ); - new QRadioButton( i18n("On startup"), mGroup ); + new TQRadioButton( i18n("Never"), mGroup ); + new TQRadioButton( i18n("On startup"), mGroup ); - QRadioButton *intervalRadio = new QRadioButton( i18n("Regular interval"), + TQRadioButton *intervalRadio = new TQRadioButton( i18n("Regular interval"), mGroup ); - connect( intervalRadio, SIGNAL( stateChanged( int ) ), - SLOT( slotIntervalStateChanged( int ) ) ); - QHBox *intervalBox = new QHBox( mGroup ); - new QLabel( i18n("Interval in minutes"), intervalBox ); - mIntervalSpin = new QSpinBox( 1,900, 1,intervalBox ); + connect( intervalRadio, TQT_SIGNAL( stateChanged( int ) ), + TQT_SLOT( slotIntervalStateChanged( int ) ) ); + TQHBox *intervalBox = new TQHBox( mGroup ); + new TQLabel( i18n("Interval in minutes"), intervalBox ); + mIntervalSpin = new TQSpinBox( 1,900, 1,intervalBox ); mIntervalSpin->setEnabled( false ); } @@ -70,33 +70,33 @@ void ResourceCachedReloadConfig::saveSettings( ResourceCached *resource ) void ResourceCachedReloadConfig::slotIntervalStateChanged( int state ) { - if ( state == QButton::On ) mIntervalSpin->setEnabled( true ); + if ( state == TQButton::On ) mIntervalSpin->setEnabled( true ); else mIntervalSpin->setEnabled( false ); } -ResourceCachedSaveConfig::ResourceCachedSaveConfig( QWidget *parent, +ResourceCachedSaveConfig::ResourceCachedSaveConfig( TQWidget *parent, const char *name ) - : QWidget( parent, name ) + : TQWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + TQBoxLayout *topLayout = new TQVBoxLayout( this ); - mGroup = new QButtonGroup( 1, Horizontal, i18n("Automatic Save"), this ); + mGroup = new TQButtonGroup( 1, Horizontal, i18n("Automatic Save"), this ); topLayout->addWidget( mGroup ); - new QRadioButton( i18n("Never"), mGroup ); - new QRadioButton( i18n("On exit"), mGroup ); + new TQRadioButton( i18n("Never"), mGroup ); + new TQRadioButton( i18n("On exit"), mGroup ); - QRadioButton *intervalRadio = new QRadioButton( i18n("Regular interval"), + TQRadioButton *intervalRadio = new TQRadioButton( i18n("Regular interval"), mGroup ); - connect( intervalRadio, SIGNAL( stateChanged( int ) ), - SLOT( slotIntervalStateChanged( int ) ) ); - QHBox *intervalBox = new QHBox( mGroup ); - new QLabel( i18n("Interval in minutes"), intervalBox ); - mIntervalSpin = new QSpinBox( 1,900, 1,intervalBox ); + connect( intervalRadio, TQT_SIGNAL( stateChanged( int ) ), + TQT_SLOT( slotIntervalStateChanged( int ) ) ); + TQHBox *intervalBox = new TQHBox( mGroup ); + new TQLabel( i18n("Interval in minutes"), intervalBox ); + mIntervalSpin = new TQSpinBox( 1,900, 1,intervalBox ); mIntervalSpin->setEnabled( false ); - new QRadioButton( i18n("Delayed after changes"), mGroup ); - new QRadioButton( i18n("On every change"), mGroup ); + new TQRadioButton( i18n("Delayed after changes"), mGroup ); + new TQRadioButton( i18n("On every change"), mGroup ); } void ResourceCachedSaveConfig::loadSettings( ResourceCached *resource ) @@ -113,7 +113,7 @@ void ResourceCachedSaveConfig::saveSettings( ResourceCached *resource ) void ResourceCachedSaveConfig::slotIntervalStateChanged( int state ) { - if ( state == QButton::On ) mIntervalSpin->setEnabled( true ); + if ( state == TQButton::On ) mIntervalSpin->setEnabled( true ); else mIntervalSpin->setEnabled( false ); } diff --git a/libkcal/resourcecachedconfig.h b/libkcal/resourcecachedconfig.h index 3eb05e054..5a227fe5e 100644 --- a/libkcal/resourcecachedconfig.h +++ b/libkcal/resourcecachedconfig.h @@ -21,7 +21,7 @@ #ifndef KCAL_RESOURCECACHEDCONFIG_H #define KCAL_RESOURCECACHEDCONFIG_H -#include +#include #include class QButtonGroup; @@ -40,7 +40,7 @@ class KDE_EXPORT ResourceCachedReloadConfig : public QWidget { Q_OBJECT public: - ResourceCachedReloadConfig( QWidget *parent = 0, const char *name = 0 ); + ResourceCachedReloadConfig( TQWidget *parent = 0, const char *name = 0 ); public slots: void loadSettings( ResourceCached *resource ); @@ -50,8 +50,8 @@ class KDE_EXPORT ResourceCachedReloadConfig : public QWidget void slotIntervalStateChanged( int ); private: - QButtonGroup *mGroup; - QSpinBox *mIntervalSpin; + TQButtonGroup *mGroup; + TQSpinBox *mIntervalSpin; class Private; Private *d; @@ -66,7 +66,7 @@ class KDE_EXPORT ResourceCachedSaveConfig : public QWidget { Q_OBJECT public: - ResourceCachedSaveConfig( QWidget *parent = 0, const char *name = 0 ); + ResourceCachedSaveConfig( TQWidget *parent = 0, const char *name = 0 ); public slots: void loadSettings( ResourceCached *resource ); @@ -76,8 +76,8 @@ class KDE_EXPORT ResourceCachedSaveConfig : public QWidget void slotIntervalStateChanged( int ); private: - QButtonGroup *mGroup; - QSpinBox *mIntervalSpin; + TQButtonGroup *mGroup; + TQSpinBox *mIntervalSpin; class Private; Private *d; diff --git a/libkcal/resourcecalendar.cpp b/libkcal/resourcecalendar.cpp index 0b994a262..c008f0308 100644 --- a/libkcal/resourcecalendar.cpp +++ b/libkcal/resourcecalendar.cpp @@ -45,15 +45,15 @@ void ResourceCalendar::setResolveConflict( bool b) { mResolveConflict = b; } -QString ResourceCalendar::infoText() const +TQString ResourceCalendar::infoText() const { - QString txt; + TQString txt; txt += "" + resourceName() + ""; txt += "
            "; KRES::Factory *factory = KRES::Factory::self( "calendar" ); - QString t = factory->typeName( type() ); + TQString t = factory->typeName( type() ); txt += i18n("Type: %1").arg( t ); addInfoText( txt ); @@ -68,7 +68,7 @@ void ResourceCalendar::writeConfig( KConfig* config ) KRES::Resource::writeConfig( config ); } -Incidence *ResourceCalendar::incidence( const QString &uid ) +Incidence *ResourceCalendar::incidence( const TQString &uid ) { Incidence *i = event( uid ); if ( i ) return i; @@ -95,16 +95,16 @@ Incidence::List ResourceCalendar::rawIncidences() return Calendar::mergeIncidenceList( rawEvents(), rawTodos(), rawJournals() ); } -void ResourceCalendar::setSubresourceActive( const QString &, bool ) +void ResourceCalendar::setSubresourceActive( const TQString &, bool ) { } -bool ResourceCalendar::addSubresource( const QString &, const QString & ) +bool ResourceCalendar::addSubresource( const TQString &, const TQString & ) { return true; } -bool ResourceCalendar::removeSubresource( const QString & ) +bool ResourceCalendar::removeSubresource( const TQString & ) { return true; } @@ -140,13 +140,13 @@ bool ResourceCalendar::load() return success; } -void ResourceCalendar::loadError( const QString &err ) +void ResourceCalendar::loadError( const TQString &err ) { kdDebug(5800) << "Error loading resource: " << err << endl; mReceivedLoadError = true; - QString msg = i18n("Error while loading %1.\n") .arg( resourceName() ); + TQString msg = i18n("Error while loading %1.\n") .arg( resourceName() ); if ( !err.isEmpty() ) { msg += err; } @@ -177,28 +177,28 @@ bool ResourceCalendar::doSave( Incidence * ) return doSave(); } -void ResourceCalendar::saveError( const QString &err ) +void ResourceCalendar::saveError( const TQString &err ) { kdDebug(5800) << "Error saving resource: " << err << endl; mReceivedSaveError = true; - QString msg = i18n("Error while saving %1.\n") .arg( resourceName() ); + TQString msg = i18n("Error while saving %1.\n") .arg( resourceName() ); if ( !err.isEmpty() ) { msg += err; } emit resourceSaveError( this, msg ); } -bool ResourceCalendar::setValue( const QString &key, const QString &value ) +bool ResourceCalendar::setValue( const TQString &key, const TQString &value ) { return false; } -QString ResourceCalendar::subresourceType( const QString &resource ) +TQString ResourceCalendar::subresourceType( const TQString &resource ) { Q_UNUSED( resource ); - return QString(); + return TQString(); } diff --git a/libkcal/resourcecalendar.h b/libkcal/resourcecalendar.h index 4cd4d91e7..3fea84a1b 100644 --- a/libkcal/resourcecalendar.h +++ b/libkcal/resourcecalendar.h @@ -25,9 +25,9 @@ #ifndef KCAL_RESOURCECALENDAR_H #define KCAL_RESOURCECALENDAR_H -#include -#include -#include +#include +#include +#include #include @@ -68,7 +68,7 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource Return rich text with info about the resource. Adds standard info and then calls addInfoText() to add info about concrete resources. */ - virtual QString infoText() const; + virtual TQString infoText() const; /** Load resource data. After calling this function all data is accessible by @@ -135,7 +135,7 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource Return incidence with given unique id. If there is no incidence with that uid, return 0. */ - Incidence *incidence( const QString &uid ); + Incidence *incidence( const TQString &uid ); /** Add event to resource. @@ -150,7 +150,7 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource /** Retrieves an event on the basis of the unique string ID. */ - virtual Event *event( const QString &uid ) = 0; + virtual Event *event( const TQString &uid ) = 0; /** Return unfiltered list of all events in calendar. Use with care, @@ -162,18 +162,18 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource Builds and then returns a list of all events that match the date specified. Useful for dayView, etc. etc. */ - virtual Event::List rawEventsForDate( const QDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ) = 0; + virtual Event::List rawEventsForDate( const TQDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ) = 0; /** Get unfiltered events for date \a qdt. */ - virtual Event::List rawEventsForDate( const QDateTime &qdt ) = 0; + virtual Event::List rawEventsForDate( const TQDateTime &qdt ) = 0; /** Get unfiltered events in a range of dates. If inclusive is set to true, only events which are completely included in the range are returned. */ - virtual Event::List rawEvents( const QDate &start, const QDate &end, + virtual Event::List rawEvents( const TQDate &start, const TQDate &end, bool inclusive = false ) = 0; /** @@ -195,7 +195,7 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource manager->add( res ); } */ - virtual bool setValue( const QString &key, const QString &value ); + virtual bool setValue( const TQString &key, const TQString &value ); signals: /** @@ -220,23 +220,23 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource /** This signal is emitted when an error occurs during loading. */ - void resourceLoadError( ResourceCalendar *, const QString &error ); + void resourceLoadError( ResourceCalendar *, const TQString &error ); /** This signal is emitted when an error occurs during saving. */ - void resourceSaveError( ResourceCalendar *, const QString &error ); + void resourceSaveError( ResourceCalendar *, const TQString &error ); /** This signal is emitted when a subresource is added. */ - void signalSubresourceAdded( ResourceCalendar *, const QString& type, - const QString& subresource, const QString& label ); + void signalSubresourceAdded( ResourceCalendar *, const TQString& type, + const TQString& subresource, const TQString& label ); /** This signal is emitted when a subresource is removed. */ - void signalSubresourceRemoved( ResourceCalendar *, const QString &, - const QString & ); + void signalSubresourceRemoved( ResourceCalendar *, const TQString &, + const TQString & ); public: /** @@ -252,7 +252,7 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource @return pointer to todo or 0 if todo wasn't found */ - virtual Todo *todo( const QString &uid ) = 0; + virtual Todo *todo( const TQString &uid ) = 0; /** Return list of all todos. */ @@ -260,7 +260,7 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource /** Returns list of todos due on the specified date. */ - virtual Todo::List rawTodosForDate( const QDate &date ) = 0; + virtual Todo::List rawTodosForDate( const TQDate &date ) = 0; /** @@ -276,7 +276,7 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource /** Return Journal with given unique id. */ - virtual Journal *journal( const QString &uid ) = 0; + virtual Journal *journal( const TQString &uid ) = 0; /** Return list of all journals. */ @@ -284,18 +284,18 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource /** Returns list of journals for the given date. */ - virtual Journal::List rawJournalsForDate( const QDate &date ) = 0; + virtual Journal::List rawJournalsForDate( const TQDate &date ) = 0; /** Return all alarms which occur in the given time interval. */ - virtual Alarm::List alarms( const QDateTime &from, - const QDateTime &to ) = 0; + virtual Alarm::List alarms( const TQDateTime &from, + const TQDateTime &to ) = 0; /** Return all alarms which occur before given date. */ - virtual Alarm::List alarmsTo( const QDateTime &to ) = 0; + virtual Alarm::List alarmsTo( const TQDateTime &to ) = 0; /** Returns a list of all incideces */ @@ -304,14 +304,14 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource /** Set time zone id used by this resource, e.g. "Europe/Berlin". */ - virtual void setTimeZoneId( const QString &timeZoneId ) = 0; + virtual void setTimeZoneId( const TQString &timeZoneId ) = 0; /** - If this resource has subresources, return a QStringList of them. + If this resource has subresources, return a TQStringList of them. In most cases, resources do not have subresources, so this is by default just empty. */ - virtual QStringList subresources() const { return QStringList(); } + virtual TQStringList subresources() const { return TQStringList(); } /** Is this subresource capable of having subresources or not? @@ -321,12 +321,12 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource /** Is this subresource active or not? */ - virtual bool subresourceActive( const QString& ) const { return true; } + virtual bool subresourceActive( const TQString& ) const { return true; } /** What is the label for this subresource? */ - virtual const QString labelForSubresource( const QString& resource ) const + virtual const TQString labelForSubresource( const TQString& resource ) const { // the resource identifier is a sane fallback return resource; @@ -338,33 +338,33 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource @return the identifier of the subresource or an empty string. */ - virtual QString subresourceIdentifier( Incidence *incidence ) - { Q_UNUSED( incidence ); return QString(); } + virtual TQString subresourceIdentifier( Incidence *incidence ) + { Q_UNUSED( incidence ); return TQString(); } /** * Remove a subresource with the id @param resource */ - virtual bool removeSubresource( const QString& resource ); + virtual bool removeSubresource( const TQString& resource ); /** * Add a subresource with the name @param resource and the parent * id @param parent. */ - virtual bool addSubresource( const QString& resource, const QString& parent ); + virtual bool addSubresource( const TQString& resource, const TQString& parent ); /** * Returns the type of the subresource: "event", "todo" or "journal", - * QString() if unknown/mixed. + * TQString() if unknown/mixed. */ - virtual QString subresourceType( const QString &resource ); + virtual TQString subresourceType( const TQString &resource ); public slots: /** (De-)activate a subresource. */ - virtual void setSubresourceActive( const QString &, bool active ); + virtual void setSubresourceActive( const TQString &, bool active ); protected: @@ -387,16 +387,16 @@ class LIBKCAL_EXPORT ResourceCalendar : public KRES::Resource /** Add info text for concrete resources. Called by infoText(). */ - virtual void addInfoText( QString & ) const {}; + virtual void addInfoText( TQString & ) const {}; /** A resource should call this function if a load error happens. */ - void loadError( const QString &errorMessage = QString::null ); + void loadError( const TQString &errorMessage = TQString::null ); /** A resource should call this function if a save error happens. */ - void saveError( const QString &errorMessage = QString::null ); + void saveError( const TQString &errorMessage = TQString::null ); private: bool mReceivedLoadError; diff --git a/libkcal/resourcelocal.cpp b/libkcal/resourcelocal.cpp index cb61cd1a6..2f10dce4b 100644 --- a/libkcal/resourcelocal.cpp +++ b/libkcal/resourcelocal.cpp @@ -23,9 +23,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -53,17 +53,17 @@ using namespace KCal; class ResourceLocal::Private { public: - QDateTime mLastModified; + TQDateTime mLastModified; }; ResourceLocal::ResourceLocal( const KConfig* config ) : ResourceCached( config ), mLock( 0 ) { if ( config ) { - QString url = config->readPathEntry( "CalendarURL" ); + TQString url = config->readPathEntry( "CalendarURL" ); mURL = KURL( url ); - QString format = config->readEntry( "Format" ); + TQString format = config->readEntry( "Format" ); if ( format == "ical" ) mFormat = new ICalFormat(); else if ( format == "vcal" ) @@ -78,7 +78,7 @@ ResourceLocal::ResourceLocal( const KConfig* config ) init(); } -ResourceLocal::ResourceLocal( const QString& fileName ) +ResourceLocal::ResourceLocal( const TQString& fileName ) : ResourceCached( 0 ) { mURL = KURL( fileName ); @@ -93,7 +93,7 @@ void ResourceLocal::writeConfig( KConfig* config ) ResourceCalendar::writeConfig( config ); config->writePathEntry( "CalendarURL", mURL.prettyURL() ); - QString typeID = typeid( *mFormat ).name(); + TQString typeID = typeid( *mFormat ).name(); if ( typeid( *mFormat ) == typeid( ICalFormat ) ) config->writeEntry( "Format", "ical" ); @@ -111,12 +111,12 @@ void ResourceLocal::init() setSavePolicy( SaveDelayed ); - connect( &mDirWatch, SIGNAL( dirty( const QString & ) ), - SLOT( reload() ) ); - connect( &mDirWatch, SIGNAL( created( const QString & ) ), - SLOT( reload() ) ); - connect( &mDirWatch, SIGNAL( deleted( const QString & ) ), - SLOT( reload() ) ); + connect( &mDirWatch, TQT_SIGNAL( dirty( const TQString & ) ), + TQT_SLOT( reload() ) ); + connect( &mDirWatch, TQT_SIGNAL( created( const TQString & ) ), + TQT_SLOT( reload() ) ); + connect( &mDirWatch, TQT_SIGNAL( deleted( const TQString & ) ), + TQT_SLOT( reload() ) ); mLock = new KABC::Lock( mURL.path() ); @@ -136,9 +136,9 @@ ResourceLocal::~ResourceLocal() delete d; } -QDateTime ResourceLocal::readLastModified() +TQDateTime ResourceLocal::readLastModified() { - QFileInfo fi( mURL.path() ); + TQFileInfo fi( mURL.path() ); return fi.lastModified(); } @@ -200,12 +200,12 @@ void ResourceLocal::dump() const kdDebug(5800) << " Url: " << mURL.url() << endl; } -QString ResourceLocal::fileName() const +TQString ResourceLocal::fileName() const { return mURL.path(); } -bool ResourceLocal::setFileName( const QString &fileName ) +bool ResourceLocal::setFileName( const TQString &fileName ) { bool open = isOpen(); if ( open ) close(); @@ -219,7 +219,7 @@ bool ResourceLocal::setFileName( const QString &fileName ) return true; } -bool ResourceLocal::setValue( const QString &key, const QString &value ) +bool ResourceLocal::setValue( const TQString &key, const TQString &value ) { if ( key == "File" ) { return setFileName( value ); diff --git a/libkcal/resourcelocal.h b/libkcal/resourcelocal.h index c5bf9c42f..ce0a112b7 100644 --- a/libkcal/resourcelocal.h +++ b/libkcal/resourcelocal.h @@ -22,8 +22,8 @@ #ifndef KCAL_RESOURCELOCAL_H #define KCAL_RESOURCELOCAL_H -#include -#include +#include +#include #include #include @@ -56,16 +56,16 @@ class LIBKCAL_EXPORT ResourceLocal : public ResourceCached /** Create resource for file named @a fileName. */ - ResourceLocal( const QString& fileName ); + ResourceLocal( const TQString& fileName ); virtual ~ResourceLocal(); virtual void writeConfig( KConfig* config ); KABC::Lock *lock(); - QString fileName() const; - bool setFileName( const QString &fileName ); - bool setValue( const QString &key, const QString &value ); + TQString fileName() const; + bool setFileName( const TQString &fileName ); + bool setValue( const TQString &key, const TQString &value ); void dump() const; @@ -83,7 +83,7 @@ class LIBKCAL_EXPORT ResourceLocal : public ResourceCached */ virtual bool doReload(); - QDateTime readLastModified(); + TQDateTime readLastModified(); private: void init(); diff --git a/libkcal/resourcelocalconfig.cpp b/libkcal/resourcelocalconfig.cpp index cfeadf788..49728fe62 100644 --- a/libkcal/resourcelocalconfig.cpp +++ b/libkcal/resourcelocalconfig.cpp @@ -22,8 +22,8 @@ #include -#include -#include +#include +#include #include #include @@ -40,21 +40,21 @@ using namespace KCal; -ResourceLocalConfig::ResourceLocalConfig( QWidget* parent, const char* name ) +ResourceLocalConfig::ResourceLocalConfig( TQWidget* parent, const char* name ) : KRES::ConfigWidget( parent, name ) { resize( 245, 115 ); - QGridLayout *mainLayout = new QGridLayout( this, 2, 2 ); + TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2 ); - QLabel *label = new QLabel( i18n( "Location:" ), this ); + TQLabel *label = new TQLabel( i18n( "Location:" ), this ); mURL = new KURLRequester( this ); mainLayout->addWidget( label, 1, 0 ); mainLayout->addWidget( mURL, 1, 1 ); - formatGroup = new QButtonGroup( 1, Horizontal, i18n( "Calendar Format" ), this ); + formatGroup = new TQButtonGroup( 1, Horizontal, i18n( "Calendar Format" ), this ); - icalButton = new QRadioButton( i18n("iCalendar"), formatGroup ); - vcalButton = new QRadioButton( i18n("vCalendar"), formatGroup ); + icalButton = new TQRadioButton( i18n("iCalendar"), formatGroup ); + vcalButton = new TQRadioButton( i18n("vCalendar"), formatGroup ); mainLayout->addWidget( formatGroup, 2, 1 ); } @@ -77,16 +77,16 @@ void ResourceLocalConfig::loadSettings( KRES::Resource *resource ) void ResourceLocalConfig::saveSettings( KRES::Resource *resource ) { - QString url = mURL->url(); + TQString url = mURL->url(); if( url.isEmpty() ) { KStandardDirs dirs; - QString saveFolder = dirs.saveLocation( "data", "korganizer" ); - QFile file( saveFolder + "/std.ics" ); + TQString saveFolder = dirs.saveLocation( "data", "korganizer" ); + TQFile file( saveFolder + "/std.ics" ); // find a non-existent name for( int i = 0; file.exists(); ++i ) - file.setName( saveFolder + "/std" + QString::number(i) + ".ics" ); + file.setName( saveFolder + "/std" + TQString::number(i) + ".ics" ); KMessageBox::information( this, i18n( "You did not specify a URL for this resource. Therefore, the resource will be saved in %1. It is still possible to change this location by editing the resource properties." ).arg( file.name() ) ); diff --git a/libkcal/resourcelocalconfig.h b/libkcal/resourcelocalconfig.h index 4752b1310..796355bce 100644 --- a/libkcal/resourcelocalconfig.h +++ b/libkcal/resourcelocalconfig.h @@ -22,8 +22,8 @@ #ifndef KCAL_RESOURCELOCALCONFIG_H #define KCAL_RESOURCELOCALCONFIG_H -#include -#include +#include +#include #include #include @@ -43,7 +43,7 @@ class LIBKCAL_EXPORT ResourceLocalConfig : public KRES::ConfigWidget { Q_OBJECT public: - ResourceLocalConfig( QWidget* parent = 0, const char* name = 0 ); + ResourceLocalConfig( TQWidget* parent = 0, const char* name = 0 ); public slots: virtual void loadSettings( KRES::Resource *resource); @@ -51,9 +51,9 @@ class LIBKCAL_EXPORT ResourceLocalConfig : public KRES::ConfigWidget private: KURLRequester *mURL; - QButtonGroup *formatGroup; - QRadioButton *icalButton; - QRadioButton *vcalButton; + TQButtonGroup *formatGroup; + TQRadioButton *icalButton; + TQRadioButton *vcalButton; class Private; Private *d; diff --git a/libkcal/resourcelocaldir.cpp b/libkcal/resourcelocaldir.cpp index 5e6528e8d..1d5c9caa8 100644 --- a/libkcal/resourcelocaldir.cpp +++ b/libkcal/resourcelocaldir.cpp @@ -22,10 +22,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -62,7 +62,7 @@ ResourceLocalDir::ResourceLocalDir( const KConfig* config ) init(); } -ResourceLocalDir::ResourceLocalDir( const QString& dirName ) +ResourceLocalDir::ResourceLocalDir( const TQString& dirName ) : ResourceCached( 0 ) { mURL = KURL( dirName ); @@ -73,7 +73,7 @@ ResourceLocalDir::ResourceLocalDir( const QString& dirName ) void ResourceLocalDir::readConfig( const KConfig *config ) { - QString url = config->readPathEntry( "CalendarURL" ); + TQString url = config->readPathEntry( "CalendarURL" ); mURL = KURL( url ); } @@ -92,12 +92,12 @@ void ResourceLocalDir::init() setSavePolicy( SaveDelayed ); - connect( &mDirWatch, SIGNAL( dirty( const QString & ) ), - SLOT( reload( const QString & ) ) ); - connect( &mDirWatch, SIGNAL( created( const QString & ) ), - SLOT( reload( const QString & ) ) ); - connect( &mDirWatch, SIGNAL( deleted( const QString & ) ), - SLOT( reload( const QString & ) ) ); + connect( &mDirWatch, TQT_SIGNAL( dirty( const TQString & ) ), + TQT_SLOT( reload( const TQString & ) ) ); + connect( &mDirWatch, TQT_SIGNAL( created( const TQString & ) ), + TQT_SLOT( reload( const TQString & ) ) ); + connect( &mDirWatch, TQT_SIGNAL( deleted( const TQString & ) ), + TQT_SLOT( reload( const TQString & ) ) ); mLock = new KABC::Lock( mURL.path() ); @@ -115,7 +115,7 @@ ResourceLocalDir::~ResourceLocalDir() bool ResourceLocalDir::doOpen() { - QFileInfo dirInfo( mURL.path() ); + TQFileInfo dirInfo( mURL.path() ); return dirInfo.isDir() && dirInfo.isReadable() && ( dirInfo.isWritable() || readOnly() ); } @@ -125,7 +125,7 @@ bool ResourceLocalDir::doLoad() kdDebug(5800) << "ResourceLocalDir::load()" << endl; mCalendar.close(); - QString dirName = mURL.path(); + TQString dirName = mURL.path(); if ( !( KStandardDirs::exists( dirName ) || KStandardDirs::exists( dirName + "/") ) ) { kdDebug(5800) << "ResourceLocalDir::load(): Directory '" << dirName @@ -138,21 +138,21 @@ bool ResourceLocalDir::doLoad() // The directory exists. Now try to open (the files in) it. kdDebug(5800) << "ResourceLocalDir::load(): '" << dirName << "'" << endl; - QFileInfo dirInfo( dirName ); + TQFileInfo dirInfo( dirName ); if ( !( dirInfo.isDir() && dirInfo.isReadable() && ( dirInfo.isWritable() || readOnly() ) ) ) return false; - QDir dir( dirName ); - QStringList entries = dir.entryList( QDir::Files | QDir::Readable ); + TQDir dir( dirName ); + TQStringList entries = dir.entryList( TQDir::Files | TQDir::Readable ); bool success = true; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for( it = entries.constBegin(); it != entries.constEnd(); ++it ) { if ( (*it).endsWith( "~" ) ) // is backup file, ignore it continue; - QString fileName = dirName + "/" + *it; + TQString fileName = dirName + "/" + *it; kdDebug(5800) << " read '" << fileName << "'" << endl; CalendarLocal cal( mCalendar.timeZoneId() ); if ( !doFileLoad( cal, fileName ) ) { @@ -163,7 +163,7 @@ bool ResourceLocalDir::doLoad() return success; } -bool ResourceLocalDir::doFileLoad( CalendarLocal &cal, const QString &fileName ) +bool ResourceLocalDir::doFileLoad( CalendarLocal &cal, const TQString &fileName ) { if ( !cal.load( fileName ) ) return false; @@ -195,7 +195,7 @@ bool ResourceLocalDir::doSave( Incidence *incidence ) { mDirWatch.stopScan(); // do prohibit the dirty() signal and a following reload() - QString fileName = mURL.path() + "/" + incidence->uid(); + TQString fileName = mURL.path() + "/" + incidence->uid(); kdDebug(5800) << "writing '" << fileName << "'" << endl; CalendarLocal cal( mCalendar.timeZoneId() ); @@ -212,7 +212,7 @@ KABC::Lock *ResourceLocalDir::lock() return mLock; } -void ResourceLocalDir::reload( const QString &file ) +void ResourceLocalDir::reload( const TQString &file ) { kdDebug(5800) << "ResourceLocalDir::reload()" << endl; @@ -264,7 +264,7 @@ void ResourceLocalDir::dump() const bool ResourceLocalDir::deleteIncidenceFile(Incidence *incidence) { - QFile file( mURL.path() + "/" + incidence->uid() ); + TQFile file( mURL.path() + "/" + incidence->uid() ); if ( !file.exists() ) return true; diff --git a/libkcal/resourcelocaldir.h b/libkcal/resourcelocaldir.h index da498a8a1..4b9014bbb 100644 --- a/libkcal/resourcelocaldir.h +++ b/libkcal/resourcelocaldir.h @@ -50,7 +50,7 @@ class LIBKCAL_EXPORT ResourceLocalDir : public ResourceCached public: ResourceLocalDir( const KConfig * ); - ResourceLocalDir( const QString& fileName ); + ResourceLocalDir( const TQString& fileName ); virtual ~ResourceLocalDir(); void readConfig( const KConfig *config ); @@ -74,14 +74,14 @@ class LIBKCAL_EXPORT ResourceLocalDir : public ResourceCached void dump() const; protected slots: - void reload( const QString & ); + void reload( const TQString & ); protected: virtual bool doOpen(); virtual bool doLoad(); virtual bool doSave(); bool doSave( Incidence * ); - virtual bool doFileLoad( CalendarLocal &, const QString &fileName ); + virtual bool doFileLoad( CalendarLocal &, const TQString &fileName ); private: void init(); diff --git a/libkcal/resourcelocaldirconfig.cpp b/libkcal/resourcelocaldirconfig.cpp index 5d0444540..2c8d89838 100644 --- a/libkcal/resourcelocaldirconfig.cpp +++ b/libkcal/resourcelocaldirconfig.cpp @@ -21,8 +21,8 @@ #include -#include -#include +#include +#include #include #include @@ -38,13 +38,13 @@ using namespace KCal; -ResourceLocalDirConfig::ResourceLocalDirConfig( QWidget* parent, const char* name ) +ResourceLocalDirConfig::ResourceLocalDirConfig( TQWidget* parent, const char* name ) : KRES::ConfigWidget( parent, name ) { resize( 245, 115 ); - QGridLayout *mainLayout = new QGridLayout( this, 2, 2 ); + TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2 ); - QLabel *label = new QLabel( i18n( "Location:" ), this ); + TQLabel *label = new TQLabel( i18n( "Location:" ), this ); mURL = new KURLRequester( this ); mURL->setMode( KFile::Directory | KFile::LocalOnly ); mainLayout->addWidget( label, 1, 0 ); diff --git a/libkcal/resourcelocaldirconfig.h b/libkcal/resourcelocaldirconfig.h index 3c88a9d92..5588d36ea 100644 --- a/libkcal/resourcelocaldirconfig.h +++ b/libkcal/resourcelocaldirconfig.h @@ -23,8 +23,8 @@ #ifndef KCAL_RESOURCELOCALDIRCONFIG_H #define KCAL_RESOURCELOCALDIRCONFIG_H -#include -#include +#include +#include #include #include @@ -45,7 +45,7 @@ class LIBKCAL_EXPORT ResourceLocalDirConfig : public KRES::ConfigWidget { Q_OBJECT public: - ResourceLocalDirConfig( QWidget *parent = 0, const char *name = 0 ); + ResourceLocalDirConfig( TQWidget *parent = 0, const char *name = 0 ); public slots: virtual void loadSettings( KRES::Resource *resource); @@ -53,9 +53,9 @@ class LIBKCAL_EXPORT ResourceLocalDirConfig : public KRES::ConfigWidget private: KURLRequester *mURL; - QButtonGroup *formatGroup; - QRadioButton *icalButton; - QRadioButton *vcalButton; + TQButtonGroup *formatGroup; + TQRadioButton *icalButton; + TQRadioButton *vcalButton; class Private; Private *d; diff --git a/libkcal/scheduler.cpp b/libkcal/scheduler.cpp index 5a29ad8c8..802c977f6 100644 --- a/libkcal/scheduler.cpp +++ b/libkcal/scheduler.cpp @@ -43,7 +43,7 @@ ScheduleMessage::ScheduleMessage(IncidenceBase *incidence,int method,ScheduleMes mStatus = status; } -QString ScheduleMessage::statusName(ScheduleMessage::Status status) +TQString ScheduleMessage::statusName(ScheduleMessage::Status status) { switch (status) { case PublishUpdate: @@ -57,7 +57,7 @@ QString ScheduleMessage::statusName(ScheduleMessage::Status status) case RequestUpdate: return i18n("Updated Request"); default: - return i18n("Unknown Status: %1").arg(QString::number(status)); + return i18n("Unknown Status: %1").arg(TQString::number(status)); } } @@ -123,31 +123,31 @@ bool Scheduler::acceptTransaction(IncidenceBase *incidence,Method method,Schedul return false; } -QString Scheduler::methodName(Method method) +TQString Scheduler::methodName(Method method) { switch (method) { case Publish: - return QString::fromLatin1("Publish"); + return TQString::fromLatin1("Publish"); case Request: - return QString::fromLatin1("Request"); + return TQString::fromLatin1("Request"); case Refresh: - return QString::fromLatin1("Refresh"); + return TQString::fromLatin1("Refresh"); case Cancel: - return QString::fromLatin1("Cancel"); + return TQString::fromLatin1("Cancel"); case Add: - return QString::fromLatin1("Add"); + return TQString::fromLatin1("Add"); case Reply: - return QString::fromLatin1("Reply"); + return TQString::fromLatin1("Reply"); case Counter: - return QString::fromLatin1("Counter"); + return TQString::fromLatin1("Counter"); case Declinecounter: - return QString::fromLatin1("Decline Counter"); + return TQString::fromLatin1("Decline Counter"); default: - return QString::fromLatin1("Unknown"); + return TQString::fromLatin1("Unknown"); } } -QString Scheduler::translatedMethodName(Method method) +TQString Scheduler::translatedMethodName(Method method) { switch (method) { case Publish: @@ -338,7 +338,7 @@ bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status /* bool attendeeAdded = false; for ( Attendee::List::ConstIterator it = attendeesNew.constBegin(); it != attendeesNew.constEnd(); ++it ) { Attendee* attNew = *it; - QString msg = i18n("%1 wants to attend %2 but was not invited.").arg( attNew->fullName() ) + TQString msg = i18n("%1 wants to attend %2 but was not invited.").arg( attNew->fullName() ) .arg( ev ? ev->summary() : to->summary() ); if ( !attNew->delegator().isEmpty() ) msg = i18n("%1 wants to attend %2 on behalf of %3.").arg( attNew->fullName() ) diff --git a/libkcal/scheduler.h b/libkcal/scheduler.h index 0aa4b366a..17e19ec47 100644 --- a/libkcal/scheduler.h +++ b/libkcal/scheduler.h @@ -21,8 +21,8 @@ #ifndef KCAL_SCHEDULER_H #define KCAL_SCHEDULER_H -#include -#include +#include +#include #include "libkcal_export.h" @@ -72,18 +72,18 @@ class ScheduleMessage /** Return error message if there is any. */ - QString error() { return mError; } + TQString error() { return mError; } /** Return a human-readable name for an iTIP message status. */ - static QString statusName( Status status ); + static TQString statusName( Status status ); private: IncidenceBase *mIncidence; int mMethod; Status mStatus; - QString mError; + TQString mError; class Private; Private *d; @@ -113,7 +113,7 @@ class LIBKCAL_EXPORT Scheduler iTIP publish action */ virtual bool publish( IncidenceBase *incidence, - const QString &recipients ) = 0; + const TQString &recipients ) = 0; /** Perform iTIP transaction on incidence. The method is specified as the method argument and can be any valid iTIP method. @@ -126,11 +126,11 @@ class LIBKCAL_EXPORT Scheduler method. */ virtual bool performTransaction( IncidenceBase *incidence, Method method, - const QString &recipients ) = 0; + const TQString &recipients ) = 0; /** Retrieve incoming iTIP transactions. */ - virtual QPtrList retrieveTransactions() = 0; + virtual TQPtrList retrieveTransactions() = 0; /** Accept transaction. The incidence argument specifies the iCal compoennt @@ -144,18 +144,18 @@ class LIBKCAL_EXPORT Scheduler /** Return a machine-readable name for a iTIP method. */ - static QString methodName( Method ); + static TQString methodName( Method ); /** Return a translated human-readable name for a iTIP method. */ - static QString translatedMethodName( Method ); + static TQString translatedMethodName( Method ); virtual bool deleteTransaction( IncidenceBase *incidence ); /** Returns the directory where the free-busy information is stored. */ - virtual QString freeBusyDir() = 0; + virtual TQString freeBusyDir() = 0; /** Set free/busy cache used to store free/busy information. diff --git a/libkcal/tests/fbrecurring.cpp b/libkcal/tests/fbrecurring.cpp index 3ea9a03aa..be70a7c8d 100644 --- a/libkcal/tests/fbrecurring.cpp +++ b/libkcal/tests/fbrecurring.cpp @@ -13,39 +13,39 @@ int main() { ICalFormat f; - CalendarLocal cal( QString::fromLatin1("UTC") ); + CalendarLocal cal( TQString::fromLatin1("UTC") ); Event *event1 = new Event; event1->setSummary("A"); - event1->setDtStart( QDateTime(QDate(2006,1,1), QTime(12,0,0)) ); + event1->setDtStart( TQDateTime(TQDate(2006,1,1), TQTime(12,0,0)) ); //event1->setDuration(60*60); - event1->setDtEnd( QDateTime(QDate(2006,1,1), QTime(13,0,0)) ); + event1->setDtEnd( TQDateTime(TQDate(2006,1,1), TQTime(13,0,0)) ); event1->setFloats(FALSE); event1->recurrence()->setDaily( 1 ); //event1->recurrence()->setDuration( 2 ); - event1->recurrence()->setEndDateTime( QDateTime(QDate(2006,1,3), QTime(13,0,0)) ); + event1->recurrence()->setEndDateTime( TQDateTime(TQDate(2006,1,3), TQTime(13,0,0)) ); cout << f.toICalString(event1).latin1() << endl; cal.addEvent(event1); Event *event2 = new Event; event2->setSummary("B"); - event2->setDtStart( QDateTime(QDate(2006,1,1), QTime(13,0,0)) ); + event2->setDtStart( TQDateTime(TQDate(2006,1,1), TQTime(13,0,0)) ); //event2->setDuration(60*60); - event2->setDtEnd( QDateTime(QDate(2006,1,1), QTime(14,0,0)) ); + event2->setDtEnd( TQDateTime(TQDate(2006,1,1), TQTime(14,0,0)) ); event2->setFloats(FALSE); event2->recurrence()->setDaily( 1 ); //event2->recurrence()->setDuration( 3 ); - event2->recurrence()->setEndDateTime( QDateTime(QDate(2006,1,4), QTime(13,0,0)) ); + event2->recurrence()->setEndDateTime( TQDateTime(TQDate(2006,1,4), TQTime(13,0,0)) ); cout << f.toICalString(event2).latin1() << endl; cal.addEvent(event2); Calendar *c = &cal; - QDateTime start = QDateTime(QDate(2006,1,2), QTime(0,0,0)); - QDateTime end = QDateTime(QDate(2006,1,3), QTime(0,0,0)); + TQDateTime start = TQDateTime(TQDate(2006,1,2), TQTime(0,0,0)); + TQDateTime end = TQDateTime(TQDate(2006,1,3), TQTime(0,0,0)); FreeBusy *freebusy = new FreeBusy( c, start, end ); - QString result = f.createScheduleMessage( freebusy, Scheduler::Publish ); + TQString result = f.createScheduleMessage( freebusy, Scheduler::Publish ); cout << result.latin1() << endl; return 0; diff --git a/libkcal/tests/readandwrite.cpp b/libkcal/tests/readandwrite.cpp index 8922080a3..076f55cbf 100644 --- a/libkcal/tests/readandwrite.cpp +++ b/libkcal/tests/readandwrite.cpp @@ -31,8 +31,8 @@ extern "C" { #include #include -#include -#include +#include +#include using namespace KCal; @@ -61,20 +61,20 @@ int main( int argc, char **argv ) // use zoneinfo data from source dir set_zone_directory( KDETOPSRCDIR "/libkcal/libical/zoneinfo" ); - QString input = QFile::decodeName( args->arg( 0 ) ); - QString output = QFile::decodeName( args->arg( 1 ) ); + TQString input = TQFile::decodeName( args->arg( 0 ) ); + TQString output = TQFile::decodeName( args->arg( 1 ) ); - QFileInfo outputFileInfo( output ); + TQFileInfo outputFileInfo( output ); output = outputFileInfo.absFilePath(); kdDebug(5800) << "Input file: " << input << endl; kdDebug(5800) << "Output file: " << output << endl; - CalendarLocal cal( QString::fromLatin1("UTC") ); + CalendarLocal cal( TQString::fromLatin1("UTC") ); if ( !cal.load( input ) ) return 1; - QString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); + TQString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); if ( !tz.isEmpty() ) { cal.setTimeZoneIdViewOnly( tz ); } diff --git a/libkcal/tests/testcalendar.cpp b/libkcal/tests/testcalendar.cpp index fe3c0d662..7d781fc54 100644 --- a/libkcal/tests/testcalendar.cpp +++ b/libkcal/tests/testcalendar.cpp @@ -48,7 +48,7 @@ int main(int argc,char **argv) Q_UNUSED( args ); - CalendarLocal cal( QString::fromLatin1("UTC") ); + CalendarLocal cal( TQString::fromLatin1("UTC") ); cal.save("mycal"); } diff --git a/libkcal/tests/testfb.cpp b/libkcal/tests/testfb.cpp index 9b44ebb76..c72d0071f 100644 --- a/libkcal/tests/testfb.cpp +++ b/libkcal/tests/testfb.cpp @@ -30,7 +30,7 @@ using namespace KCal; int main( int, char ** ) { - const QString fbString = + const TQString fbString = "BEGIN:VCALENDAR\n" "PRODID:-//proko2//freebusy 1.0//EN\n" "METHOD:PUBLISH\n" @@ -57,7 +57,7 @@ int main( int, char ** ) for ( PeriodList::ConstIterator it = l.begin(); it != l.end(); ++it ) kdDebug() << (*it).start() << " " << (*it).end() << "+ " << (*it).summary() << ":" << (*it).location() << endl; - typedef QMap FooMap; + typedef TQMap FooMap; const FooMap props = fb->customProperties(); for ( FooMap::ConstIterator it = props.begin(); it != props.end(); ++it ) kdDebug() << it.key() << ": " << it.data() << endl; diff --git a/libkcal/tests/testfields.cpp b/libkcal/tests/testfields.cpp index d0bcf0be1..6e63faa98 100644 --- a/libkcal/tests/testfields.cpp +++ b/libkcal/tests/testfields.cpp @@ -27,7 +27,7 @@ #include "calendarlocal.h" -#include +#include using namespace KCal; @@ -50,9 +50,9 @@ int main(int argc,char **argv) Q_UNUSED(args) - CalendarLocal cal( QString::fromLatin1("UTC") ); + CalendarLocal cal( TQString::fromLatin1("UTC") ); - QString file = QString::fromLatin1( INPUT ); + TQString file = TQString::fromLatin1( INPUT ); if (!cal.load( file ) ) { kdError() << "Can't load " << file << endl; return 1; @@ -60,8 +60,8 @@ int main(int argc,char **argv) // 2 tests... first uid should result in a syncStatus of 0. second uid // should have a new summary and a 1 for syncStatus. - QString uid1 = QString::fromLatin1("KOrganizer-1345486115.965"); - QString uid2 = QString::fromLatin1("KOrganizer-1345486115.967"); + TQString uid1 = TQString::fromLatin1("KOrganizer-1345486115.965"); + TQString uid2 = TQString::fromLatin1("KOrganizer-1345486115.967"); Event *e = cal.event( uid1 ); if (!e) { @@ -72,7 +72,7 @@ int main(int argc,char **argv) kdDebug() << "Event description " << e->summary() << endl; if (e->hasEndDate()) { - QDateTime d = e->dtEnd(); + TQDateTime d = e->dtEnd(); kdDebug() << "Event ends " << d << endl; } @@ -88,7 +88,7 @@ int main(int argc,char **argv) e->setSyncStatus(KCal::Incidence::SYNCNONE); - QString newSummary = QString::fromLatin1("Mooo summary"); + TQString newSummary = TQString::fromLatin1("Mooo summary"); Event *f = new Event(*e); @@ -102,7 +102,7 @@ int main(int argc,char **argv) - QString filew = file +".out"; + TQString filew = file +".out"; // weird, yes, I know, but we have a bug right now with saving the file // twice which is corrupting X-PILOTSTAT if ( !cal.save( filew ) || !cal.save( filew ) ) { @@ -112,13 +112,13 @@ int main(int argc,char **argv) // now try to read the file back in and see if our changes made it - CalendarLocal cal2( QString::fromLatin1("UTC") ); + CalendarLocal cal2( TQString::fromLatin1("UTC") ); if (!cal2.load( filew ) ) { kdError() << "Can't load " << filew << endl; return 1; } - QFile::remove( filew ); + TQFile::remove( filew ); // check for uid1--should have syncStatus of 0 e = cal2.event( uid1 ); diff --git a/libkcal/tests/testincidence.cpp b/libkcal/tests/testincidence.cpp index 1dd8c7379..9f84cc28c 100644 --- a/libkcal/tests/testincidence.cpp +++ b/libkcal/tests/testincidence.cpp @@ -57,13 +57,13 @@ int main(int argc,char **argv) event1->recurrence()->setDaily( 2 ); event1->recurrence()->setDuration( 3 ); - QString eventString1 = f.toString( event1 ); + TQString eventString1 = f.toString( event1 ); if ( verbose ) kdDebug(5800) << "EVENT1 START:" << eventString1 << "EVENT1 END" << endl; Incidence *event2 = event1->clone(); - QString eventString2 = f.toString( event2 ); + TQString eventString2 = f.toString( event2 ); if( verbose ) kdDebug(5800) << "EVENT2 START:" << eventString2 << "EVENT2 END" << endl; @@ -75,12 +75,12 @@ int main(int argc,char **argv) Todo *todo1 = new Todo; todo1->setSummary("Test todo"); - QString todoString1 = f.toString( todo1 ); + TQString todoString1 = f.toString( todo1 ); if( verbose ) kdDebug(5800) << "todo1 START:" << todoString1 << "todo1 END" << endl; Incidence *todo2 = todo1->clone(); - QString todoString2 = f.toString( todo2 ); + TQString todoString2 = f.toString( todo2 ); if( verbose ) kdDebug(5800) << "todo2 START:" << todoString2 << "todo2 END" << endl; diff --git a/libkcal/tests/testrecurprevious.cpp b/libkcal/tests/testrecurprevious.cpp index c0a90b8b0..2d127d49f 100644 --- a/libkcal/tests/testrecurprevious.cpp +++ b/libkcal/tests/testrecurprevious.cpp @@ -31,7 +31,7 @@ extern "C" { #include #include -#include +#include @@ -64,26 +64,26 @@ int main( int argc, char **argv ) // use zoneinfo data from source dir set_zone_directory( KDETOPSRCDIR "/libkcal/libical/zoneinfo" ); - QString input = QFile::decodeName( args->arg( 0 ) ); + TQString input = TQFile::decodeName( args->arg( 0 ) ); kdDebug(5800) << "Input file: " << input << endl; - QTextStream *outstream; + TQTextStream *outstream; outstream = 0; - QString fn(""); + TQString fn(""); if ( args->count() > 1 ) { fn = args->arg( 1 ); kdDebug() << "We have a file name given: " << fn << endl; } - QFile outfile( fn ); + TQFile outfile( fn ); if ( !fn.isEmpty() && outfile.open( IO_WriteOnly ) ) { kdDebug() << "Opened output file!!!" << endl; - outstream = new QTextStream( &outfile ); + outstream = new TQTextStream( &outfile ); } - CalendarLocal cal( QString::fromLatin1("UTC") ); + CalendarLocal cal( TQString::fromLatin1("UTC") ); if ( !cal.load( input ) ) return 1; - QString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); + TQString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); if ( !tz.isEmpty() ) { cal.setTimeZoneIdViewOnly( tz ); } @@ -97,10 +97,10 @@ int main( int argc, char **argv ) incidence->recurrence()->dump(); - QDateTime dt( incidence->recurrence()->endDateTime() ); + TQDateTime dt( incidence->recurrence()->endDateTime() ); int i=0; if ( outstream ) { - if ( !dt.isValid() ) dt = QDateTime( QDate( 2011, 1, 1 ), QTime( 0, 0, 1 ) ); + if ( !dt.isValid() ) dt = TQDateTime( TQDate( 2011, 1, 1 ), TQTime( 0, 0, 1 ) ); else dt = dt.addYears( 2 ); kdDebug(5800) << "-------------------------------------------" << endl; kdDebug(5800) << " *~*~*~*~ Starting with date: " << dt << endl; @@ -112,7 +112,7 @@ int main( int argc, char **argv ) (*outstream) << dt.toString( Qt::ISODate ) << endl; } } else { - if ( !dt.isValid() ) dt = QDateTime( QDate( 2005, 7, 31 ), QTime( 23, 59, 59 ) ); + if ( !dt.isValid() ) dt = TQDateTime( TQDate( 2005, 7, 31 ), TQTime( 23, 59, 59 ) ); else dt = dt.addYears( 2 ); incidence->recurrence()->dump(); kdDebug(5800) << "-------------------------------------------" << endl; diff --git a/libkcal/tests/testrecurrence.cpp b/libkcal/tests/testrecurrence.cpp index c997e9a67..8fc1c5274 100644 --- a/libkcal/tests/testrecurrence.cpp +++ b/libkcal/tests/testrecurrence.cpp @@ -31,7 +31,7 @@ extern "C" { #include #include -#include +#include @@ -64,26 +64,26 @@ int main( int argc, char **argv ) // use zoneinfo data from source dir set_zone_directory( KDETOPSRCDIR "/libkcal/libical/zoneinfo" ); - QString input = QFile::decodeName( args->arg( 0 ) ); + TQString input = TQFile::decodeName( args->arg( 0 ) ); kdDebug(5800) << "Input file: " << input << endl; - QTextStream *outstream; + TQTextStream *outstream; outstream = 0; - QString fn(""); + TQString fn(""); if ( args->count() > 1 ) { fn = args->arg( 1 ); kdDebug() << "We have a file name given: " << fn << endl; } - QFile outfile( fn ); + TQFile outfile( fn ); if ( !fn.isEmpty() && outfile.open( IO_WriteOnly ) ) { kdDebug() << "Opened output file!!!" << endl; - outstream = new QTextStream( &outfile ); + outstream = new TQTextStream( &outfile ); } - CalendarLocal cal( QString::fromLatin1("UTC") ); + CalendarLocal cal( TQString::fromLatin1("UTC") ); if ( !cal.load( input ) ) return 1; - QString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); + TQString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); if ( !tz.isEmpty() ) { cal.setTimeZoneIdViewOnly( tz ); } @@ -97,7 +97,7 @@ int main( int argc, char **argv ) incidence->recurrence()->dump(); - QDateTime dt( incidence->dtStart().addSecs(-2) ); + TQDateTime dt( incidence->dtStart().addSecs(-2) ); int i=0; if ( outstream ) { // Output to file for testing purposes diff --git a/libkcal/tests/testrecurrencetype.cpp b/libkcal/tests/testrecurrencetype.cpp index c997e9a67..8fc1c5274 100644 --- a/libkcal/tests/testrecurrencetype.cpp +++ b/libkcal/tests/testrecurrencetype.cpp @@ -31,7 +31,7 @@ extern "C" { #include #include -#include +#include @@ -64,26 +64,26 @@ int main( int argc, char **argv ) // use zoneinfo data from source dir set_zone_directory( KDETOPSRCDIR "/libkcal/libical/zoneinfo" ); - QString input = QFile::decodeName( args->arg( 0 ) ); + TQString input = TQFile::decodeName( args->arg( 0 ) ); kdDebug(5800) << "Input file: " << input << endl; - QTextStream *outstream; + TQTextStream *outstream; outstream = 0; - QString fn(""); + TQString fn(""); if ( args->count() > 1 ) { fn = args->arg( 1 ); kdDebug() << "We have a file name given: " << fn << endl; } - QFile outfile( fn ); + TQFile outfile( fn ); if ( !fn.isEmpty() && outfile.open( IO_WriteOnly ) ) { kdDebug() << "Opened output file!!!" << endl; - outstream = new QTextStream( &outfile ); + outstream = new TQTextStream( &outfile ); } - CalendarLocal cal( QString::fromLatin1("UTC") ); + CalendarLocal cal( TQString::fromLatin1("UTC") ); if ( !cal.load( input ) ) return 1; - QString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); + TQString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); if ( !tz.isEmpty() ) { cal.setTimeZoneIdViewOnly( tz ); } @@ -97,7 +97,7 @@ int main( int argc, char **argv ) incidence->recurrence()->dump(); - QDateTime dt( incidence->dtStart().addSecs(-2) ); + TQDateTime dt( incidence->dtStart().addSecs(-2) ); int i=0; if ( outstream ) { // Output to file for testing purposes diff --git a/libkcal/tests/testrecurson.cpp b/libkcal/tests/testrecurson.cpp index 154cbe676..01dfb5f7a 100644 --- a/libkcal/tests/testrecurson.cpp +++ b/libkcal/tests/testrecurson.cpp @@ -31,7 +31,7 @@ extern "C" { #include #include -#include +#include @@ -64,26 +64,26 @@ int main( int argc, char **argv ) // use zoneinfo data from source dir set_zone_directory( KDETOPSRCDIR "/libkcal/libical/zoneinfo" ); - QString input = QFile::decodeName( args->arg( 0 ) ); + TQString input = TQFile::decodeName( args->arg( 0 ) ); kdDebug(5800) << "Input file: " << input << endl; - QTextStream *outstream; + TQTextStream *outstream; outstream = 0; - QString fn(""); + TQString fn(""); if ( args->count() > 1 ) { fn = args->arg( 1 ); kdDebug() << "We have a file name given: " << fn << endl; } - QFile outfile( fn ); + TQFile outfile( fn ); if ( !fn.isEmpty() && outfile.open( IO_WriteOnly ) ) { kdDebug() << "Opened output file!!!" << endl; - outstream = new QTextStream( &outfile ); + outstream = new TQTextStream( &outfile ); } - CalendarLocal cal( QString::fromLatin1("UTC") ); + CalendarLocal cal( TQString::fromLatin1("UTC") ); if ( !cal.load( input ) ) return 1; - QString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); + TQString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); if ( !tz.isEmpty() ) { cal.setTimeZoneIdViewOnly( tz ); } @@ -97,7 +97,7 @@ int main( int argc, char **argv ) incidence->recurrence()->dump(); - QDate dt( 1996, 7, 1 ); + TQDate dt( 1996, 7, 1 ); if ( outstream ) { // Output to file for testing purposes while ( dt.year() <= 2010 ) { @@ -106,7 +106,7 @@ int main( int argc, char **argv ) dt = dt.addDays( 1 ); } } else { - dt = QDate( 2005, 1, 1 ); + dt = TQDate( 2005, 1, 1 ); while ( dt.year() < 2007 ) { if ( incidence->recursOn( dt ) ) kdDebug(5800) << dt.toString( Qt::ISODate ) << endl; diff --git a/libkcal/tests/testresource.cpp b/libkcal/tests/testresource.cpp index 25f6539d3..cd5174e2c 100644 --- a/libkcal/tests/testresource.cpp +++ b/libkcal/tests/testresource.cpp @@ -31,9 +31,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) { // Use another directory than the real one, just to keep things clean // KDEHOME needs to be writable though, for a ksycoca database - setenv( "KDEHOME", QFile::encodeName( QDir::homeDirPath() + "/.kde-testresource" ), true ); + setenv( "KDEHOME", TQFile::encodeName( TQDir::homeDirPath() + "/.kde-testresource" ), true ); setenv( "KDE_FORK_SLAVES", "yes", true ); // simpler, for the final cleanup KApplication::disableAutoDcopRegistration(); @@ -65,9 +65,9 @@ int main(int argc, char *argv[]) KApplication app; KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QString type = QString::null; + TQString type = TQString::null; if ( args->getOption( "resource" ) ) - type = QString::fromLocal8Bit( args->getOption( "resource" ) ); + type = TQString::fromLocal8Bit( args->getOption( "resource" ) ); KConfig *config = 0; if ( args->getOption( "configfile" ) ) config = new KConfig( KURL( args->getOption( "configfile" ) ).url() ); @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) namespace KCal { -TestResource::TestResource( const QString &type, KConfig *config ) +TestResource::TestResource( const TQString &type, KConfig *config ) :m_resource_type( type ), m_config( config ), m_res( 0 ) {} @@ -91,11 +91,11 @@ void TestResource::setup() CalendarResourceManager *manager = new CalendarResourceManager( "calendar" ); manager->readConfig(); - QStringList resources = manager->resourceTypeNames(); + TQStringList resources = manager->resourceTypeNames(); if ( m_resource_type.isNull() ) { - const QString & chosen = KInputDialog::getItem( "Select Resource", + const TQString & chosen = KInputDialog::getItem( "Select Resource", "Select the resource you wish to test. Test data will be used.", resources ); @@ -130,12 +130,12 @@ void TestResource::runAll() m_res->close(); } -bool TestResource::check(const QString& txt, QString a, QString b) +bool TestResource::check(const TQString& txt, TQString a, TQString b) { if (a.isEmpty()) - a = QString::null; + a = TQString::null; if (b.isEmpty()) - b = QString::null; + b = TQString::null; if (a == b) { kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; } @@ -190,11 +190,11 @@ void TestResource::testEventAddRemove() int oldcount = m_res->rawIncidences().count(); Event *event = makeTestEvent(); - const QString origString = f.toString( event ); + const TQString origString = f.toString( event ); m_res->addEvent( event ); Event *fromRes = m_res->event( event->uid() ); assert( fromRes == event ); - const QString fromResString = f.toString( fromRes ); + const TQString fromResString = f.toString( fromRes ); check( "add", origString, fromResString ); m_res->deleteEvent( event ); assert( !m_res->event( event->uid() ) ); @@ -210,11 +210,11 @@ void TestResource::testTodoAddRemove() int oldcount = m_res->rawIncidences().count(); Todo *todo = makeTestTodo(); - const QString origString = f.toString( todo ); + const TQString origString = f.toString( todo ); m_res->addTodo( todo ); Todo *fromRes = m_res->todo( todo->uid() ); assert( fromRes == todo ); - const QString fromResString = f.toString( fromRes ); + const TQString fromResString = f.toString( fromRes ); check( "add", origString, fromResString ); m_res->deleteTodo( todo ); assert( !m_res->todo( todo->uid() ) ); @@ -230,11 +230,11 @@ void TestResource::testJournalAddRemove() int oldcount = m_res->rawIncidences().count(); Journal *journal = makeTestJournal(); - const QString origString = f.toString( journal ); + const TQString origString = f.toString( journal ); m_res->addJournal( journal ); Journal *fromRes = m_res->journal( journal->uid() ); assert( fromRes == journal ); - const QString fromResString = f.toString( fromRes ); + const TQString fromResString = f.toString( fromRes ); check( "add", origString, fromResString ); m_res->deleteJournal( journal ); assert( !m_res->journal( journal->uid() ) ); diff --git a/libkcal/tests/testresource.h b/libkcal/tests/testresource.h index ae452dd23..30e61aeb5 100644 --- a/libkcal/tests/testresource.h +++ b/libkcal/tests/testresource.h @@ -19,7 +19,7 @@ #ifndef TESTRESOURCE_H #define TESTRESOURCE_H -#include +#include class KConfig; namespace KCal { @@ -31,7 +31,7 @@ class TestResource : public QObject Q_OBJECT public: - TestResource( const QString& type, KConfig *config ); + TestResource( const TQString& type, KConfig *config ); void setup(); void runAll(); void cleanup(); @@ -46,8 +46,8 @@ public: void testJournalAddRemove(); private: - bool check(const QString& txt, QString a, QString b); - QString m_resource_type; + bool check(const TQString& txt, TQString a, TQString b); + TQString m_resource_type; KConfig *m_config; ResourceCalendar *m_res; }; diff --git a/libkcal/tests/testtostring.cpp b/libkcal/tests/testtostring.cpp index 673b487a3..766bc064c 100644 --- a/libkcal/tests/testtostring.cpp +++ b/libkcal/tests/testtostring.cpp @@ -34,7 +34,7 @@ int main( int, char ** ) Event *ev = new Event; ev->setSummary("Griazi"); ICalFormat iformat; - QString icalstr = iformat.toICalString(ev); + TQString icalstr = iformat.toICalString(ev); kdDebug(5800) << icalstr << endl; Incidence *ev2 = iformat.fromString(icalstr); kdDebug(5800) << "Event reread!" << endl ; diff --git a/libkcal/tests/testvcalexport.cpp b/libkcal/tests/testvcalexport.cpp index a6ca1cfdd..7f8b61c09 100644 --- a/libkcal/tests/testvcalexport.cpp +++ b/libkcal/tests/testvcalexport.cpp @@ -35,8 +35,8 @@ extern "C" { #include #include -#include -#include +#include +#include using namespace KCal; @@ -65,20 +65,20 @@ int main( int argc, char **argv ) // use zoneinfo data from source dir set_zone_directory( KDETOPSRCDIR "/libkcal/libical/zoneinfo" ); - QString input = QFile::decodeName( args->arg( 0 ) ); - QString output = QFile::decodeName( args->arg( 1 ) ); + TQString input = TQFile::decodeName( args->arg( 0 ) ); + TQString output = TQFile::decodeName( args->arg( 1 ) ); - QFileInfo outputFileInfo( output ); + TQFileInfo outputFileInfo( output ); output = outputFileInfo.absFilePath(); kdDebug(5800) << "Input file: " << input << endl; kdDebug(5800) << "Output file: " << output << endl; - CalendarLocal cal( QString::fromLatin1("UTC") ); + CalendarLocal cal( TQString::fromLatin1("UTC") ); if ( !cal.load( input ) ) return 1; - QString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); + TQString tz = cal.nonKDECustomProperty( "X-LibKCal-Testsuite-OutTZ" ); if ( !tz.isEmpty() ) { cal.setTimeZoneIdViewOnly( tz ); } diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 87d34c4b1..9787ff2ad 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -82,7 +82,7 @@ bool Todo::operator==( const Todo& t2 ) const percentComplete() == t2.percentComplete(); } -void Todo::setDtDue(const QDateTime &dtDue, bool first ) +void Todo::setDtDue(const TQDateTime &dtDue, bool first ) { //int diffsecs = mDtDue.secsTo(dtDue); @@ -114,7 +114,7 @@ void Todo::setDtDue(const QDateTime &dtDue, bool first ) updated(); } -QDateTime Todo::dtDue( bool first ) const +TQDateTime Todo::dtDue( bool first ) const { if ( doesRecur() && !first && mDtRecurrence.isValid() ) return mDtRecurrence; @@ -122,18 +122,18 @@ QDateTime Todo::dtDue( bool first ) const return mDtDue; } -QString Todo::dtDueTimeStr() const +TQString Todo::dtDueTimeStr() const { return KGlobal::locale()->formatTime( dtDue(!doesRecur()).time() ); } -QString Todo::dtDueDateStr(bool shortfmt) const +TQString Todo::dtDueDateStr(bool shortfmt) const { return KGlobal::locale()->formatDate(dtDue( !doesRecur() ).date(),shortfmt); } // TODO: Add shortfmt param!!! -QString Todo::dtDueStr() const +TQString Todo::dtDueStr() const { return KGlobal::locale()->formatDateTime( dtDue( !doesRecur() ) ); } @@ -164,14 +164,14 @@ void Todo::setHasStartDate(bool f) if ( !comments().grep("NoStartDate").count() ) addComment("NoStartDate"); //TODO: --> custom flag? } else { - QString s("NoStartDate"); + TQString s("NoStartDate"); removeComment(s); } mHasStartDate = f; updated(); } -QDateTime Todo::dtStart( bool first ) const +TQDateTime Todo::dtStart( bool first ) const { if ( doesRecur() && !first ) return mDtRecurrence.addDays( dtDue( first ).daysTo( IncidenceBase::dtStart() ) ); @@ -179,7 +179,7 @@ QDateTime Todo::dtStart( bool first ) const return IncidenceBase::dtStart(); } -void Todo::setDtStart( const QDateTime &dtStart ) +void Todo::setDtStart( const TQDateTime &dtStart ) { // TODO: This doesn't seem right (rfc 2445/6 says, recurrence is calculated from the dtstart...) if ( doesRecur() ) { @@ -189,17 +189,17 @@ void Todo::setDtStart( const QDateTime &dtStart ) IncidenceBase::setDtStart( dtStart ); } -QString Todo::dtStartTimeStr( bool first ) const +TQString Todo::dtStartTimeStr( bool first ) const { return KGlobal::locale()->formatTime(dtStart(first).time()); } -QString Todo::dtStartDateStr(bool shortfmt, bool first) const +TQString Todo::dtStartDateStr(bool shortfmt, bool first) const { return KGlobal::locale()->formatDate(dtStart(first).date(),shortfmt); } -QString Todo::dtStartStr(bool first) const +TQString Todo::dtStartStr(bool first) const { return KGlobal::locale()->formatDateTime(dtStart(first)); } @@ -217,25 +217,25 @@ void Todo::setCompleted(bool completed) else { mPercentComplete = 0; mHasCompletedDate = false; - mCompleted = QDateTime(); + mCompleted = TQDateTime(); } updated(); } -QDateTime Todo::completed() const +TQDateTime Todo::completed() const { if ( hasCompletedDate() ) return mCompleted; else - return QDateTime(); + return TQDateTime(); } -QString Todo::completedStr() const +TQString Todo::completedStr() const { return KGlobal::locale()->formatDateTime(mCompleted); } -void Todo::setCompleted(const QDateTime &completed) +void Todo::setCompleted(const TQDateTime &completed) { if( !recurTodo() ) { mHasCompletedDate = true; @@ -262,19 +262,19 @@ void Todo::setPercentComplete(int v) updated(); } -void Todo::setDtRecurrence( const QDateTime &dt ) +void Todo::setDtRecurrence( const TQDateTime &dt ) { mDtRecurrence = dt; } -QDateTime Todo::dtRecurrence() const +TQDateTime Todo::dtRecurrence() const { return mDtRecurrence.isValid() ? mDtRecurrence : mDtDue; } -bool Todo::recursOn( const QDate &date ) const +bool Todo::recursOn( const TQDate &date ) const { - QDate today = QDate::currentDate(); + TQDate today = TQDate::currentDate(); return ( Incidence::recursOn(date) && !( date < today && mDtRecurrence.date() < today && mDtRecurrence > recurrence()->startDateTime() ) ); @@ -284,13 +284,13 @@ bool Todo::recurTodo() { if ( doesRecur() ) { Recurrence *r = recurrence(); - QDateTime endDateTime = r->endDateTime(); - QDateTime nextDate = r->getNextDateTime( dtDue() ); + TQDateTime endDateTime = r->endDateTime(); + TQDateTime nextDate = r->getNextDateTime( dtDue() ); if ( ( r->duration() == -1 || ( nextDate.isValid() && endDateTime.isValid() && nextDate <= endDateTime ) ) ) { - while ( !recursAt( nextDate ) || nextDate <= QDateTime::currentDateTime() ) { + while ( !recursAt( nextDate ) || nextDate <= TQDateTime::currentDateTime() ) { if ( !nextDate.isValid() || nextDate > endDateTime ) { return false; @@ -312,7 +312,7 @@ bool Todo::recurTodo() bool Todo::isOverdue() const { - bool inPast = doesFloat() ? dtDue().date() < QDate::currentDate() - : dtDue() < QDateTime::currentDateTime(); + bool inPast = doesFloat() ? dtDue().date() < TQDate::currentDate() + : dtDue() < TQDateTime::currentDateTime(); return ( inPast && !isCompleted() ); } diff --git a/libkcal/todo.h b/libkcal/todo.h index d81576d55..1a7b050d4 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h @@ -39,7 +39,7 @@ class LIBKCAL_EXPORT Todo : public Incidence Todo& operator=( const Todo& ); bool operator==( const Todo& ) const; - QCString type() const { return "Todo"; } + TQCString type() const { return "Todo"; } /** Returns an exact copy of this todo. The returned object is owned by the @@ -53,7 +53,7 @@ class LIBKCAL_EXPORT Todo : public Incidence @param dtDue The due date/time. @param first Set the date of the first occurrence (if the todo is recurrent). */ - void setDtDue(const QDateTime &dtDue, bool first = false); + void setDtDue(const TQDateTime &dtDue, bool first = false); /** Returns due date and time. @@ -62,12 +62,12 @@ class LIBKCAL_EXPORT Todo : public Incidence current occurrence will be returned. If non-recurrent, the normal due date will be returned. */ - QDateTime dtDue( bool first = false ) const; + TQDateTime dtDue( bool first = false ) const; /** Returns due time as string formatted according to the users locale settings. */ - QString dtDueTimeStr() const; + TQString dtDueTimeStr() const; /** Returns due date as string formatted according to the users locale settings. @@ -75,12 +75,12 @@ class LIBKCAL_EXPORT Todo : public Incidence @param shortfmt If set to true, use short date format, if set to false use long format. */ - QString dtDueDateStr( bool shortfmt = true ) const; + TQString dtDueDateStr( bool shortfmt = true ) const; /** Returns due date and time as string formatted according to the users locale settings. */ - QString dtDueStr() const; + TQString dtDueStr() const; /** Returns true if the todo has a due date, otherwise return false. @@ -111,12 +111,12 @@ class LIBKCAL_EXPORT Todo : public Incidence If false and the todo recurs, the relative startdate will be returned, based on the date returned by dtRecurrence(). */ - QDateTime dtStart( bool first = false ) const; + TQDateTime dtStart( bool first = false ) const; /** Sets the startdate of the todo. */ - void setDtStart( const QDateTime &dtStart ); + void setDtStart( const TQDateTime &dtStart ); /** Returns an todo's starting time as a string formatted according to the users locale settings. @@ -125,7 +125,7 @@ class LIBKCAL_EXPORT Todo : public Incidence If false and the todo recurs, the relative startdate will be returned, based on the date returned by dtRecurrence(). */ - QString dtStartTimeStr( bool first = false ) const; + TQString dtStartTimeStr( bool first = false ) const; /** Returns an todo's starting date as a string formatted according to the users locale settings. @param shortfmt If true, use short date format, if set to false use @@ -135,7 +135,7 @@ class LIBKCAL_EXPORT Todo : public Incidence If false and the todo recurs, the relative startdate will be returned, based on the date returned by dtRecurrence(). */ - QString dtStartDateStr( bool shortfmt = true, bool first = false ) const; + TQString dtStartDateStr( bool shortfmt = true, bool first = false ) const; /** Returns an todo's starting date and time as a string formatted according to the users locale settings. @param first If true, the startdate of the todo will be returned. If the @@ -143,7 +143,7 @@ class LIBKCAL_EXPORT Todo : public Incidence If false and the todo recurs, the relative startdate will be returned, based on the date returned by dtRecurrence(). */ - QString dtStartStr( bool first = false ) const; + TQString dtStartStr( bool first = false ) const; /** Returns true if the todo is 100% completed, otherwise return false. @@ -171,16 +171,16 @@ class LIBKCAL_EXPORT Todo : public Incidence /** Returns date and time when todo was completed. */ - QDateTime completed() const; + TQDateTime completed() const; /** Returns string contaiting date and time when the todo was completed formatted according to the users locale settings. */ - QString completedStr() const; + TQString completedStr() const; /** Set date and time of completion. */ - void setCompleted( const QDateTime &completed ); + void setCompleted( const TQDateTime &completed ); /** Returns true, if todo has a date associated with completion, otherwise @@ -191,12 +191,12 @@ class LIBKCAL_EXPORT Todo : public Incidence /** Sets the due date/time of the current occurrence if recurrent. */ - void setDtRecurrence( const QDateTime &dt ); + void setDtRecurrence( const TQDateTime &dt ); /** Returns the due date/time of the current occurrence if recurrent. */ - QDateTime dtRecurrence() const; + TQDateTime dtRecurrence() const; /** Returns true if the date specified is one on which the todo will @@ -204,7 +204,7 @@ class LIBKCAL_EXPORT Todo : public Incidence check, which make it return false if there's an occurrence between the recurstart and today. */ - virtual bool recursOn( const QDate &date ) const; + virtual bool recursOn( const TQDate &date ) const; /** Returns true if this todo is overdue (e.g. due date is lower than today @@ -214,21 +214,21 @@ class LIBKCAL_EXPORT Todo : public Incidence protected: /** Return the end date/time of the base incidence. */ - virtual QDateTime endDateRecurrenceBase() const { return dtDue(); } + virtual TQDateTime endDateRecurrenceBase() const { return dtDue(); } private: bool accept(Visitor &v) { return v.visit( this ); } /** Returns true if the todo got a new date, else false will be returned. */ bool recurTodo(); - QDateTime mDtDue; // due date of todo + TQDateTime mDtDue; // due date of todo // (first occurrence if recurrent) - QDateTime mDtRecurrence; // due date of recurrence + TQDateTime mDtRecurrence; // due date of recurrence bool mHasDueDate; // if todo has associated due date bool mHasStartDate; // if todo has associated start date - QDateTime mCompleted; + TQDateTime mCompleted; bool mHasCompletedDate; int mPercentComplete; diff --git a/libkcal/vcaldrag.cpp b/libkcal/vcaldrag.cpp index bbcc2447e..9bcfdb8d4 100644 --- a/libkcal/vcaldrag.cpp +++ b/libkcal/vcaldrag.cpp @@ -26,25 +26,25 @@ using namespace KCal; -VCalDrag::VCalDrag( Calendar *cal, QWidget *parent, const char *name ) - : QStoredDrag( "text/x-vCalendar", parent, name ) +VCalDrag::VCalDrag( Calendar *cal, TQWidget *parent, const char *name ) + : TQStoredDrag( "text/x-vCalendar", parent, name ) { VCalFormat format; setEncodedData( format.toString( cal ).utf8() ); } -bool VCalDrag::canDecode( QMimeSource *me ) +bool VCalDrag::canDecode( TQMimeSource *me ) { return me->provides( "text/x-vCalendar" ); } -bool VCalDrag::decode( QMimeSource *de, Calendar *cal ) +bool VCalDrag::decode( TQMimeSource *de, Calendar *cal ) { bool success = false; - QByteArray payload = de->encodedData( "text/x-vCalendar" ); + TQByteArray payload = de->encodedData( "text/x-vCalendar" ); if ( payload.size() ) { - QString txt = QString::fromUtf8( payload.data() ); + TQString txt = TQString::fromUtf8( payload.data() ); VCalFormat format; success = format.fromString( cal, txt ); diff --git a/libkcal/vcaldrag.h b/libkcal/vcaldrag.h index 4cb5f88ad..8855ed5ff 100644 --- a/libkcal/vcaldrag.h +++ b/libkcal/vcaldrag.h @@ -22,7 +22,7 @@ #ifndef KCAL_VCALDRAG_H #define KCAL_VCALDRAG_H -#include +#include #include "libkcal_export.h" namespace KCal { @@ -38,17 +38,17 @@ class KDE_EXPORT VCalDrag : public QStoredDrag /** Create a drag&drop object for vCalendar component \a vcal. */ - VCalDrag( Calendar *vcal, QWidget *parent = 0, const char *name = 0 ); + VCalDrag( Calendar *vcal, TQWidget *parent = 0, const char *name = 0 ); ~VCalDrag() {} /** Return, if drag&drop object can be decode to vCalendar. */ - static bool canDecode( QMimeSource * ); + static bool canDecode( TQMimeSource * ); /** Decode drag&drop object to vCalendar component \a vcal. */ - static bool decode( QMimeSource *e, Calendar *cal ); + static bool decode( TQMimeSource *e, Calendar *cal ); private: class Private; diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index 3ed492d38..3e9e613b3 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp @@ -20,14 +20,14 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -55,7 +55,7 @@ VCalFormat::~VCalFormat() { } -bool VCalFormat::load(Calendar *calendar, const QString &fileName) +bool VCalFormat::load(Calendar *calendar, const TQString &fileName) { mCalendar = calendar; @@ -67,7 +67,7 @@ bool VCalFormat::load(Calendar *calendar, const QString &fileName) // this is not necessarily only 1 vcal. Could be many vcals, or include // a vcard... - vcal = Parse_MIME_FromFileName(const_cast(QFile::encodeName(fileName).data())); + vcal = Parse_MIME_FromFileName(const_cast(TQFile::encodeName(fileName).data())); if (!vcal) { setException(new ErrorFormat(ErrorFormat::CalVersionUnknown)); @@ -87,11 +87,11 @@ bool VCalFormat::load(Calendar *calendar, const QString &fileName) } -bool VCalFormat::save(Calendar *calendar, const QString &fileName) +bool VCalFormat::save(Calendar *calendar, const TQString &fileName) { mCalendar = calendar; - QString tmpStr; + TQString tmpStr; VObject *vcal, *vo; kdDebug(5800) << "VCalFormat::save(): " << fileName << endl; @@ -118,11 +118,11 @@ bool VCalFormat::save(Calendar *calendar, const QString &fileName) addVObjectProp( vcal, vo ); } - writeVObjectToFile(QFile::encodeName(fileName).data() ,vcal); + writeVObjectToFile(TQFile::encodeName(fileName).data() ,vcal); cleanVObjects(vcal); cleanStrTbl(); - if (QFile::exists(fileName)) { + if (TQFile::exists(fileName)) { kdDebug(5800) << "No error" << endl; return true; } else { @@ -133,12 +133,12 @@ bool VCalFormat::save(Calendar *calendar, const QString &fileName) return false; } -bool VCalFormat::fromString( Calendar *calendar, const QString &text ) +bool VCalFormat::fromString( Calendar *calendar, const TQString &text ) { // TODO: Factor out VCalFormat::fromString() mCalendar = calendar; - QCString data = text.utf8(); + TQCString data = text.utf8(); if ( !data.size() ) return false; @@ -169,7 +169,7 @@ bool VCalFormat::fromString( Calendar *calendar, const QString &text ) return true; } -QString VCalFormat::toString( Calendar *calendar ) +TQString VCalFormat::toString( Calendar *calendar ) { // TODO: Factor out VCalFormat::asString() mCalendar = calendar; @@ -184,7 +184,7 @@ QString VCalFormat::toString( Calendar *calendar ) Event *event = events.first(); if ( !event ) { cleanVObject( vcal ); - return QString::null; + return TQString::null; } VObject *vevent = eventToVEvent( event ); @@ -193,7 +193,7 @@ QString VCalFormat::toString( Calendar *calendar ) char *buf = writeMemVObject( 0, 0, vcal ); - QString result( buf ); + TQString result( buf ); cleanVObject( vcal ); @@ -203,7 +203,7 @@ QString VCalFormat::toString( Calendar *calendar ) VObject *VCalFormat::eventToVTodo(const Todo *anEvent) { VObject *vtodo; - QString tmpStr; + TQString tmpStr; vtodo = newVObject(VCTodoProp); @@ -304,10 +304,10 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) } // categories - QStringList tmpStrList = anEvent->categories(); + TQStringList tmpStrList = anEvent->categories(); tmpStr = ""; - QString catStr; - for ( QStringList::Iterator it = tmpStrList.begin(); + TQString catStr; + for ( TQStringList::Iterator it = tmpStrList.begin(); it != tmpStrList.end(); ++it ) { catStr = *it; @@ -340,13 +340,13 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) a = addProp(vtodo, VCAAlarmProp); addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); + addPropValue(a, VCAudioContentProp, TQFile::encodeName(alarm->audioFile())); } else if (alarm->type() == Alarm::Procedure) { a = addProp(vtodo, VCPAlarmProp); addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); + addPropValue(a, VCProcedureNameProp, TQFile::encodeName(alarm->programFile())); } } } @@ -365,7 +365,7 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) VObject* VCalFormat::eventToVEvent(const Event *anEvent) { VObject *vevent; - QString tmpStr; + TQString tmpStr; vevent = newVObject(VCEventProp); @@ -430,7 +430,7 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) const Recurrence *recur = anEvent->recurrence(); if ( recur->doesRecur() ) { bool validRecur = true; - QString tmpStr2; + TQString tmpStr2; switch ( recur->recurrenceType() ) { case Recurrence::rDaily: tmpStr.sprintf("D%i ",recur->frequency()); @@ -438,7 +438,7 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) case Recurrence::rWeekly: tmpStr.sprintf("W%i ",recur->frequency()); for (int i = 0; i < 7; i++ ) { - QBitArray days ( recur->days() ); + TQBitArray days ( recur->days() ); if ( days.testBit(i) ) tmpStr += dayFromNum(i); } @@ -446,8 +446,8 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) case Recurrence::rMonthlyPos: { tmpStr.sprintf("MP%i ", recur->frequency()); // write out all rMonthPos's - QValueList tmpPositions = recur->monthPositions(); - for ( QValueListConstIterator posit = tmpPositions.begin(); + TQValueList tmpPositions = recur->monthPositions(); + for ( TQValueListConstIterator posit = tmpPositions.begin(); posit != tmpPositions.end(); ++posit ) { int pos = (*posit).pos(); tmpStr2.sprintf("%i", (pos>0) ? pos : (-pos) ); @@ -462,8 +462,8 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) case Recurrence::rMonthlyDay: { tmpStr.sprintf("MD%i ", recur->frequency()); // write out all rMonthDays; - QValueList tmpDays = recur->monthDays(); - for ( QValueListIterator tmpDay = tmpDays.begin(); + TQValueList tmpDays = recur->monthDays(); + for ( TQValueListIterator tmpDay = tmpDays.begin(); tmpDay != tmpDays.end(); ++tmpDay ) { tmpStr2.sprintf( "%i ", *tmpDay ); tmpStr += tmpStr2; @@ -473,8 +473,8 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) tmpStr.sprintf("YM%i ", recur->frequency()); // write out all the months;' // TODO: Any way to write out the day within the month??? - QValueList months = recur->yearMonths(); - for ( QValueListIterator mit = months.begin(); + TQValueList months = recur->yearMonths(); + for ( TQValueListIterator mit = months.begin(); mit != months.end(); ++mit ) { tmpStr2.sprintf( "%i ", *mit ); tmpStr += tmpStr2; @@ -483,8 +483,8 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) case Recurrence::rYearlyDay: { tmpStr.sprintf("YD%i ", recur->frequency()); // write out all the rYearNums; - QValueList tmpDays = recur->yearDays(); - for ( QValueListIterator tmpDay = tmpDays.begin(); + TQValueList tmpDays = recur->yearDays(); + for ( TQValueListIterator tmpDay = tmpDays.begin(); tmpDay != tmpDays.end(); ++tmpDay ) { tmpStr2.sprintf( "%i ", *tmpDay ); tmpStr += tmpStr2; @@ -515,7 +515,7 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) // exceptions to recurrence DateList dateList = recur->exDates(); DateList::ConstIterator it; - QString tmpStr2; + TQString tmpStr2; for (it = dateList.begin(); it != dateList.end(); ++it) { tmpStr = qDateToISO(*it) + ";"; @@ -564,10 +564,10 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) } // categories - QStringList tmpStrList = anEvent->categories(); + TQStringList tmpStrList = anEvent->categories(); tmpStr = ""; - QString catStr; - for ( QStringList::Iterator it = tmpStrList.begin(); + TQString catStr; + for ( TQStringList::Iterator it = tmpStrList.begin(); it != tmpStrList.end(); ++it ) { catStr = *it; @@ -612,13 +612,13 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) a = addProp(vevent, VCAAlarmProp); addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); + addPropValue(a, VCAudioContentProp, TQFile::encodeName(alarm->audioFile())); } if (alarm->type() == Alarm::Procedure) { a = addProp(vevent, VCPAlarmProp); addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); + addPropValue(a, VCProcedureNameProp, TQFile::encodeName(alarm->programFile())); } } } @@ -677,8 +677,8 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo) deleteStr(s); } else - anEvent->setLastModified(QDateTime(QDate::currentDate(), - QTime::currentTime())); + anEvent->setLastModified(TQDateTime(TQDate::currentDate(), + TQTime::currentTime())); // organizer // if our extension property for the event's ORGANIZER exists, add it. @@ -697,7 +697,7 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo) Attendee *a; VObject *vp; s = fakeCString(vObjectUStringZValue(vo)); - QString tmpStr = QString::fromLocal8Bit(s); + TQString tmpStr = TQString::fromLocal8Bit(s); deleteStr(s); tmpStr = tmpStr.simplifyWhiteSpace(); int emailPos1, emailPos2; @@ -713,7 +713,7 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo) } else { // just a name // WTF??? Replacing the spaces of a name and using this as email? - QString email = tmpStr.replace( ' ', '.' ); + TQString email = tmpStr.replace( ' ', '.' ); a = new Attendee(tmpStr,email); } @@ -731,14 +731,14 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo) // description for todo if ((vo = isAPropertyOf(vtodo, VCDescriptionProp)) != 0) { s = fakeCString(vObjectUStringZValue(vo)); - anEvent->setDescription(QString::fromLocal8Bit(s)); + anEvent->setDescription(TQString::fromLocal8Bit(s)); deleteStr(s); } // summary if ((vo = isAPropertyOf(vtodo, VCSummaryProp))) { s = fakeCString(vObjectUStringZValue(vo)); - anEvent->setSummary(QString::fromLocal8Bit(s)); + anEvent->setSummary(TQString::fromLocal8Bit(s)); deleteStr(s); } @@ -746,7 +746,7 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo) // location if ((vo = isAPropertyOf(vtodo, VCLocationProp)) != 0) { s = fakeCString(vObjectUStringZValue(vo)); - anEvent->setLocation( QString::fromLocal8Bit(s) ); + anEvent->setLocation( TQString::fromLocal8Bit(s) ); deleteStr(s); } // completed @@ -807,14 +807,14 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo) if ((vo = isAPropertyOf(vtodo, VCPAlarmProp))) { if ((a = isAPropertyOf(vo, VCProcedureNameProp))) { s = fakeCString(vObjectUStringZValue(a)); - alarm->setProcedureAlarm(QFile::decodeName(s)); + alarm->setProcedureAlarm(TQFile::decodeName(s)); deleteStr(s); } } if ((vo = isAPropertyOf(vtodo, VCAAlarmProp))) { if ((a = isAPropertyOf(vo, VCAudioContentProp))) { s = fakeCString(vObjectUStringZValue(a)); - alarm->setAudioAlarm(QFile::decodeName(s)); + alarm->setAudioAlarm(TQFile::decodeName(s)); deleteStr(s); } } @@ -830,9 +830,9 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo) // categories if ((vo = isAPropertyOf(vtodo, VCCategoriesProp)) != 0) { s = fakeCString(vObjectUStringZValue(vo)); - QString categories = QString::fromLocal8Bit(s); + TQString categories = TQString::fromLocal8Bit(s); deleteStr(s); - QStringList tmpStrList = QStringList::split( ';', categories ); + TQStringList tmpStrList = TQStringList::split( ';', categories ); anEvent->setCategories(tmpStrList); } @@ -892,8 +892,8 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) deleteStr(s); } else - anEvent->setLastModified(QDateTime(QDate::currentDate(), - QTime::currentTime())); + anEvent->setLastModified(TQDateTime(TQDate::currentDate(), + TQTime::currentTime())); // organizer // if our extension property for the event's ORGANIZER exists, add it. @@ -913,7 +913,7 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) Attendee *a; VObject *vp; s = fakeCString(vObjectUStringZValue(vo)); - QString tmpStr = QString::fromLocal8Bit(s); + TQString tmpStr = TQString::fromLocal8Bit(s); deleteStr(s); tmpStr = tmpStr.simplifyWhiteSpace(); int emailPos1, emailPos2; @@ -928,7 +928,7 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) a = new Attendee(0, tmpStr); } else { // just a name - QString email = tmpStr.replace( ' ', '.' ); + TQString email = tmpStr.replace( ' ', '.' ); a = new Attendee(tmpStr,email); } @@ -982,7 +982,7 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) // repeat stuff if ((vo = isAPropertyOf(vevent, VCRRuleProp)) != 0) { - QString tmpStr = (s = fakeCString(vObjectUStringZValue(vo))); + TQString tmpStr = (s = fakeCString(vObjectUStringZValue(vo))); deleteStr(s); tmpStr.simplifyWhiteSpace(); tmpStr = tmpStr.upper(); @@ -1024,8 +1024,8 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) break; case Recurrence::rWeekly: { - QBitArray qba(7); - QString dayStr; + TQBitArray qba(7); + TQString dayStr; if( index == last ) { // e.g. W1 #0 qba.setBit(anEvent->dtStart().date().dayOfWeek() - 1); @@ -1045,7 +1045,7 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) case Recurrence::rMonthlyPos: { anEvent->recurrence()->setMonthly( rFreq ); - QBitArray qba(7); + TQBitArray qba(7); short tmpPos; if( index == last ) { // e.g. MP1 #0 @@ -1147,7 +1147,7 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) if ( rDuration > 0 ) anEvent->recurrence()->setDuration( rDuration ); } else if ( tmpStr.find('T', index) != -1 ) { - QDate rEndDate = (ISOToQDateTime(tmpStr.mid(index, tmpStr.length()-index))).date(); + TQDate rEndDate = (ISOToQDateTime(tmpStr.mid(index, tmpStr.length()-index))).date(); anEvent->recurrence()->setEndDateTime( rEndDate ); } // anEvent->recurrence()->dump(); @@ -1161,8 +1161,8 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) // recurrence exceptions if ((vo = isAPropertyOf(vevent, VCExDateProp)) != 0) { s = fakeCString(vObjectUStringZValue(vo)); - QStringList exDates = QStringList::split(",",s); - QStringList::ConstIterator it; + TQStringList exDates = TQStringList::split(",",s); + TQStringList::ConstIterator it; for(it = exDates.begin(); it != exDates.end(); ++it ) { anEvent->recurrence()->addExDate(ISOToQDate(*it)); } @@ -1172,7 +1172,7 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) // summary if ((vo = isAPropertyOf(vevent, VCSummaryProp))) { s = fakeCString(vObjectUStringZValue(vo)); - anEvent->setSummary(QString::fromLocal8Bit(s)); + anEvent->setSummary(TQString::fromLocal8Bit(s)); deleteStr(s); } @@ -1181,9 +1181,9 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) s = fakeCString(vObjectUStringZValue(vo)); if (!anEvent->description().isEmpty()) { anEvent->setDescription(anEvent->description() + "\n" + - QString::fromLocal8Bit(s)); + TQString::fromLocal8Bit(s)); } else { - anEvent->setDescription(QString::fromLocal8Bit(s)); + anEvent->setDescription(TQString::fromLocal8Bit(s)); } deleteStr(s); } @@ -1191,7 +1191,7 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) // location if ((vo = isAPropertyOf(vevent, VCLocationProp)) != 0) { s = fakeCString(vObjectUStringZValue(vo)); - anEvent->setLocation( QString::fromLocal8Bit(s) ); + anEvent->setLocation( TQString::fromLocal8Bit(s) ); deleteStr(s); } @@ -1199,7 +1199,7 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) // instead of Summary for the default field. Correct for this. if (anEvent->summary().isEmpty() && !(anEvent->description().isEmpty())) { - QString tmpStr = anEvent->description().simplifyWhiteSpace(); + TQString tmpStr = anEvent->description().simplifyWhiteSpace(); anEvent->setDescription(""); anEvent->setSummary(tmpStr); } @@ -1207,7 +1207,7 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) #if 0 // status if ((vo = isAPropertyOf(vevent, VCStatusProp)) != 0) { - QString tmpStr(s = fakeCString(vObjectUStringZValue(vo))); + TQString tmpStr(s = fakeCString(vObjectUStringZValue(vo))); deleteStr(s); // TODO: Define Event status // anEvent->setStatus(tmpStr); @@ -1232,9 +1232,9 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) // categories if ((vo = isAPropertyOf(vevent, VCCategoriesProp)) != 0) { s = fakeCString(vObjectUStringZValue(vo)); - QString categories = QString::fromLocal8Bit(s); + TQString categories = TQString::fromLocal8Bit(s); deleteStr(s); - QStringList tmpStrList = QStringList::split( ',', categories ); + TQStringList tmpStrList = TQStringList::split( ',', categories ); anEvent->setCategories(tmpStrList); } @@ -1244,16 +1244,16 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) vo = nextVObject(&voi); if (strcmp(vObjectName(vo), VCAttachProp) == 0) { s = fakeCString(vObjectUStringZValue(vo)); - anEvent->addAttachment(new Attachment(QString(s))); + anEvent->addAttachment(new Attachment(TQString(s))); deleteStr(s); } } // resources if ((vo = isAPropertyOf(vevent, VCResourcesProp)) != 0) { - QString resources = (s = fakeCString(vObjectUStringZValue(vo))); + TQString resources = (s = fakeCString(vObjectUStringZValue(vo))); deleteStr(s); - QStringList tmpStrList = QStringList::split( ';', resources ); + TQStringList tmpStrList = TQStringList::split( ';', resources ); anEvent->setResources(tmpStrList); } @@ -1269,14 +1269,14 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) if ((vo = isAPropertyOf(vevent, VCPAlarmProp))) { if ((a = isAPropertyOf(vo, VCProcedureNameProp))) { s = fakeCString(vObjectUStringZValue(a)); - alarm->setProcedureAlarm(QFile::decodeName(s)); + alarm->setProcedureAlarm(TQFile::decodeName(s)); deleteStr(s); } } if ((vo = isAPropertyOf(vevent, VCAAlarmProp))) { if ((a = isAPropertyOf(vo, VCAudioContentProp))) { s = fakeCString(vObjectUStringZValue(a)); - alarm->setAudioAlarm(QFile::decodeName(s)); + alarm->setAudioAlarm(TQFile::decodeName(s)); deleteStr(s); } } @@ -1321,9 +1321,9 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) } -QString VCalFormat::qDateToISO(const QDate &qd) +TQString VCalFormat::qDateToISO(const TQDate &qd) { - QString tmpStr; + TQString tmpStr; Q_ASSERT(qd.isValid()); @@ -1335,7 +1335,7 @@ QString VCalFormat::qDateToISO(const QDate &qd) /* Return the offset of the named zone as seconds. tt is a time indicating the date for which you want the offset */ -int vcaltime_utc_offset( QDateTime ictt, QString tzid ) +int vcaltime_utc_offset( TQDateTime ictt, TQString tzid ) { // libical-0.23 stuff: // struct icaltimetype tt = icaltime_from_timet( ictt.toTime_t(), false ); @@ -1349,14 +1349,14 @@ int vcaltime_utc_offset( QDateTime ictt, QString tzid ) &tt, &daylight ); } -QString VCalFormat::qDateTimeToISO(const QDateTime &qdt, bool zulu) +TQString VCalFormat::qDateTimeToISO(const TQDateTime &qdt, bool zulu) { - QString tmpStr; + TQString tmpStr; Q_ASSERT(qdt.date().isValid()); Q_ASSERT(qdt.time().isValid()); if (zulu) { - QDateTime tmpDT(qdt); + TQDateTime tmpDT(qdt); // correct to GMT: tmpDT = tmpDT.addSecs(-vcaltime_utc_offset( tmpDT, mCalendar->timeZoneId())); tmpStr.sprintf( "%.2d%.2d%.2dT%.2d%.2d%.2dZ", @@ -1372,11 +1372,11 @@ QString VCalFormat::qDateTimeToISO(const QDateTime &qdt, bool zulu) return tmpStr; } -QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr) +TQDateTime VCalFormat::ISOToQDateTime(const TQString & dtStr) { - QDate tmpDate; - QTime tmpTime; - QString tmpStr; + TQDate tmpDate; + TQTime tmpTime; + TQString tmpStr; int year, month, day, hour, minute, second; tmpStr = dtStr; @@ -1391,7 +1391,7 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr) Q_ASSERT(tmpDate.isValid()); Q_ASSERT(tmpTime.isValid()); - QDateTime tmpDT(tmpDate, tmpTime); + TQDateTime tmpDT(tmpDate, tmpTime); // correct for GMT if string is in Zulu format if (dtStr.at(dtStr.length()-1) == 'Z') { tmpDT = tmpDT.addSecs(vcaltime_utc_offset( tmpDT, mCalendar->timeZoneId())); @@ -1399,7 +1399,7 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr) return tmpDT; } -QDate VCalFormat::ISOToQDate(const QString &dateStr) +TQDate VCalFormat::ISOToQDate(const TQString &dateStr) { int year, month, day; @@ -1407,7 +1407,7 @@ QDate VCalFormat::ISOToQDate(const QString &dateStr) month = dateStr.mid(4,2).toInt(); day = dateStr.mid(6,2).toInt(); - return(QDate(year, month, day)); + return(TQDate(year, month, day)); } // take a raw vcalendar (i.e. from a file on disk, clipboard, etc. etc. @@ -1490,7 +1490,7 @@ void VCalFormat::populate(VObject *vcal) // to be the case, we skip the event. if ((curVOProp = isAPropertyOf(curVO, VCUniqueStringProp)) != 0) { char *s = fakeCString(vObjectUStringZValue(curVOProp)); - QString tmpStr(s); + TQString tmpStr(s); deleteStr(s); if (mCalendar->incidence(tmpStr)) { @@ -1552,7 +1552,7 @@ const char *VCalFormat::dayFromNum(int day) return days[day]; } -int VCalFormat::numFromDay(const QString &day) +int VCalFormat::numFromDay(const TQString &day) { if (day == "MO ") return 0; if (day == "TU ") return 1; @@ -1567,7 +1567,7 @@ int VCalFormat::numFromDay(const QString &day) Attendee::PartStat VCalFormat::readStatus(const char *s) const { - QString statStr = s; + TQString statStr = s; statStr = statStr.upper(); Attendee::PartStat status; @@ -1597,7 +1597,7 @@ Attendee::PartStat VCalFormat::readStatus(const char *s) const return status; } -QCString VCalFormat::writeStatus(Attendee::PartStat status) const +TQCString VCalFormat::writeStatus(Attendee::PartStat status) const { switch(status) { default: diff --git a/libkcal/vcalformat.h b/libkcal/vcalformat.h index 039ecfc2d..cb51f4171 100644 --- a/libkcal/vcalformat.h +++ b/libkcal/vcalformat.h @@ -54,7 +54,7 @@ class LIBKCAL_EXPORT VCalFormat : public CalFormat @param fileName Name of the vCalendar file on disk. @return true on success, otherwise false */ - bool load( Calendar *calendar, const QString &fileName ); + bool load( Calendar *calendar, const TQString &fileName ); /** Writes out the given calendar to disk in vCalendar format. @@ -62,16 +62,16 @@ class LIBKCAL_EXPORT VCalFormat : public CalFormat @param fileName the name of the file @return true on success, otherwise false */ - bool save(Calendar *calendar, const QString &fileName); + bool save(Calendar *calendar, const TQString &fileName); /** Parse string and populate calendar with that information. */ - bool fromString( Calendar *, const QString & ); + bool fromString( Calendar *, const TQString & ); /** Return calendar information as string. */ - QString toString( Calendar * ); + TQString toString( Calendar * ); protected: /** translates a VObject of the TODO type into a Event */ @@ -83,16 +83,16 @@ class LIBKCAL_EXPORT VCalFormat : public CalFormat /** translate a Event into a VObject and returns a pointer to it. */ VObject* eventToVEvent(const Event *anEvent); - /** takes a QDate and returns a string in the format YYYYMMDDTHHMMSS */ - QString qDateToISO(const QDate &); - /** takes a QDateTime and returns a string in format YYYYMMDDTHHMMSS */ - QString qDateTimeToISO(const QDateTime &, bool zulu=TRUE); + /** takes a TQDate and returns a string in the format YYYYMMDDTHHMMSS */ + TQString qDateToISO(const TQDate &); + /** takes a TQDateTime and returns a string in format YYYYMMDDTHHMMSS */ + TQString qDateTimeToISO(const TQDateTime &, bool zulu=TRUE); /** takes a string in the format YYYYMMDDTHHMMSS and returns a - * valid QDateTime. */ - QDateTime ISOToQDateTime(const QString & dtStr); + * valid TQDateTime. */ + TQDateTime ISOToQDateTime(const TQString & dtStr); /** takes a string in the format YYYYMMDD and returns a - * valid QDate. */ - QDate ISOToQDate(const QString & dtStr); + * valid TQDate. */ + TQDate ISOToQDate(const TQString & dtStr); /** takes a vCalendar tree of VObjects, and puts all of them that have * the "event" property into the dictionary, todos in the todo-list, etc. */ void populate(VObject *vcal); @@ -101,10 +101,10 @@ class LIBKCAL_EXPORT VCalFormat : public CalFormat * i.e. MO, TU, WE, etc. */ const char *dayFromNum(int day); /** the reverse of the above function. */ - int numFromDay(const QString &day); + int numFromDay(const TQString &day); Attendee::PartStat readStatus(const char *s) const; - QCString writeStatus(Attendee::PartStat status) const; + TQCString writeStatus(Attendee::PartStat status) const; private: Calendar *mCalendar; -- cgit v1.2.1