diff options
Diffstat (limited to 'kalarm/alarmevent.cpp')
-rw-r--r-- | kalarm/alarmevent.cpp | 458 |
1 files changed, 229 insertions, 229 deletions
diff --git a/kalarm/alarmevent.cpp b/kalarm/alarmevent.cpp index 28b0a55a4..8aa898922 100644 --- a/kalarm/alarmevent.cpp +++ b/kalarm/alarmevent.cpp @@ -23,8 +23,8 @@ #include <stdlib.h> #include <time.h> #include <ctype.h> -#include <qcolor.h> -#include <qregexp.h> +#include <tqcolor.h> +#include <tqregexp.h> #include <klocale.h> #include <kdebug.h> @@ -39,73 +39,73 @@ using namespace KCal; -const QCString APPNAME("KALARM"); +const TQCString APPNAME("KALARM"); // KAlarm version which first used the current calendar/event format. // If this changes, KAEvent::convertKCalEvents() must be changed correspondingly. // The string version is the KAlarm version string used in the calendar file. -QString KAEvent::calVersionString() { return QString::fromLatin1("1.5.0"); } +TQString KAEvent::calVersionString() { return TQString::fromLatin1("1.5.0"); } int KAEvent::calVersion() { return KAlarm::Version(1,5,0); } // Custom calendar properties. // Note that all custom property names are prefixed with X-KDE-KALARM- in the calendar file. // - Event properties -static const QCString NEXT_RECUR_PROPERTY("NEXTRECUR"); // X-KDE-KALARM-NEXTRECUR property -static const QCString REPEAT_PROPERTY("REPEAT"); // X-KDE-KALARM-REPEAT property +static const TQCString NEXT_RECUR_PROPERTY("NEXTRECUR"); // X-KDE-KALARM-NEXTRECUR property +static const TQCString REPEAT_PROPERTY("REPEAT"); // X-KDE-KALARM-REPEAT property // - General alarm properties -static const QCString TYPE_PROPERTY("TYPE"); // X-KDE-KALARM-TYPE property -static const QString FILE_TYPE = QString::fromLatin1("FILE"); -static const QString AT_LOGIN_TYPE = QString::fromLatin1("LOGIN"); -static const QString REMINDER_TYPE = QString::fromLatin1("REMINDER"); -static const QString REMINDER_ONCE_TYPE = QString::fromLatin1("REMINDER_ONCE"); -static const QString ARCHIVE_REMINDER_ONCE_TYPE = QString::fromLatin1("ONCE"); -static const QString TIME_DEFERRAL_TYPE = QString::fromLatin1("DEFERRAL"); -static const QString DATE_DEFERRAL_TYPE = QString::fromLatin1("DATE_DEFERRAL"); -static const QString DISPLAYING_TYPE = QString::fromLatin1("DISPLAYING"); // used only in displaying calendar -static const QString PRE_ACTION_TYPE = QString::fromLatin1("PRE"); -static const QString POST_ACTION_TYPE = QString::fromLatin1("POST"); -static const QCString NEXT_REPEAT_PROPERTY("NEXTREPEAT"); // X-KDE-KALARM-NEXTREPEAT property +static const TQCString TYPE_PROPERTY("TYPE"); // X-KDE-KALARM-TYPE property +static const TQString FILE_TYPE = TQString::fromLatin1("FILE"); +static const TQString AT_LOGIN_TYPE = TQString::fromLatin1("LOGIN"); +static const TQString REMINDER_TYPE = TQString::fromLatin1("REMINDER"); +static const TQString REMINDER_ONCE_TYPE = TQString::fromLatin1("REMINDER_ONCE"); +static const TQString ARCHIVE_REMINDER_ONCE_TYPE = TQString::fromLatin1("ONCE"); +static const TQString TIME_DEFERRAL_TYPE = TQString::fromLatin1("DEFERRAL"); +static const TQString DATE_DEFERRAL_TYPE = TQString::fromLatin1("DATE_DEFERRAL"); +static const TQString DISPLAYING_TYPE = TQString::fromLatin1("DISPLAYING"); // used only in displaying calendar +static const TQString PRE_ACTION_TYPE = TQString::fromLatin1("PRE"); +static const TQString POST_ACTION_TYPE = TQString::fromLatin1("POST"); +static const TQCString NEXT_REPEAT_PROPERTY("NEXTREPEAT"); // X-KDE-KALARM-NEXTREPEAT property // - Display alarm properties -static const QCString FONT_COLOUR_PROPERTY("FONTCOLOR"); // X-KDE-KALARM-FONTCOLOR property +static const TQCString FONT_COLOUR_PROPERTY("FONTCOLOR"); // X-KDE-KALARM-FONTCOLOR property // - Email alarm properties -static const QCString EMAIL_ID_PROPERTY("EMAILID"); // X-KDE-KALARM-EMAILID property +static const TQCString EMAIL_ID_PROPERTY("EMAILID"); // X-KDE-KALARM-EMAILID property // - Audio alarm properties -static const QCString VOLUME_PROPERTY("VOLUME"); // X-KDE-KALARM-VOLUME property -static const QCString SPEAK_PROPERTY("SPEAK"); // X-KDE-KALARM-SPEAK property +static const TQCString VOLUME_PROPERTY("VOLUME"); // X-KDE-KALARM-VOLUME property +static const TQCString SPEAK_PROPERTY("SPEAK"); // X-KDE-KALARM-SPEAK property // Event categories -static const QString DATE_ONLY_CATEGORY = QString::fromLatin1("DATE"); -static const QString EMAIL_BCC_CATEGORY = QString::fromLatin1("BCC"); -static const QString CONFIRM_ACK_CATEGORY = QString::fromLatin1("ACKCONF"); -static const QString LATE_CANCEL_CATEGORY = QString::fromLatin1("LATECANCEL;"); -static const QString AUTO_CLOSE_CATEGORY = QString::fromLatin1("LATECLOSE;"); -static const QString TEMPL_AFTER_TIME_CATEGORY = QString::fromLatin1("TMPLAFTTIME;"); -static const QString KMAIL_SERNUM_CATEGORY = QString::fromLatin1("KMAIL:"); -static const QString KORGANIZER_CATEGORY = QString::fromLatin1("KORG"); -static const QString DEFER_CATEGORY = QString::fromLatin1("DEFER;"); -static const QString ARCHIVE_CATEGORY = QString::fromLatin1("SAVE"); -static const QString ARCHIVE_CATEGORIES = QString::fromLatin1("SAVE:"); -static const QString LOG_CATEGORY = QString::fromLatin1("LOG:"); -static const QString xtermURL = QString::fromLatin1("xterm:"); +static const TQString DATE_ONLY_CATEGORY = TQString::fromLatin1("DATE"); +static const TQString EMAIL_BCC_CATEGORY = TQString::fromLatin1("BCC"); +static const TQString CONFIRM_ACK_CATEGORY = TQString::fromLatin1("ACKCONF"); +static const TQString LATE_CANCEL_CATEGORY = TQString::fromLatin1("LATECANCEL;"); +static const TQString AUTO_CLOSE_CATEGORY = TQString::fromLatin1("LATECLOSE;"); +static const TQString TEMPL_AFTER_TIME_CATEGORY = TQString::fromLatin1("TMPLAFTTIME;"); +static const TQString KMAIL_SERNUM_CATEGORY = TQString::fromLatin1("KMAIL:"); +static const TQString KORGANIZER_CATEGORY = TQString::fromLatin1("KORG"); +static const TQString DEFER_CATEGORY = TQString::fromLatin1("DEFER;"); +static const TQString ARCHIVE_CATEGORY = TQString::fromLatin1("SAVE"); +static const TQString ARCHIVE_CATEGORIES = TQString::fromLatin1("SAVE:"); +static const TQString LOG_CATEGORY = TQString::fromLatin1("LOG:"); +static const TQString xtermURL = TQString::fromLatin1("xterm:"); // Event status strings -static const QString DISABLED_STATUS = QString::fromLatin1("DISABLED"); +static const TQString DISABLED_STATUS = TQString::fromLatin1("DISABLED"); -static const QString EXPIRED_UID = QString::fromLatin1("-exp-"); -static const QString DISPLAYING_UID = QString::fromLatin1("-disp-"); -static const QString TEMPLATE_UID = QString::fromLatin1("-tmpl-"); -static const QString KORGANIZER_UID = QString::fromLatin1("-korg-"); +static const TQString EXPIRED_UID = TQString::fromLatin1("-exp-"); +static const TQString DISPLAYING_UID = TQString::fromLatin1("-disp-"); +static const TQString TEMPLATE_UID = TQString::fromLatin1("-tmpl-"); +static const TQString KORGANIZER_UID = TQString::fromLatin1("-korg-"); struct AlarmData { const Alarm* alarm; - QString cleanText; // text or audio file name + TQString cleanText; // text or audio file name uint emailFromId; EmailAddressList emailAddresses; - QString emailSubject; - QStringList emailAttachments; - QFont font; - QColor bgColour, fgColour; + TQString emailSubject; + TQStringList emailAttachments; + TQFont font; + TQColor bgColour, fgColour; float soundVolume; float fadeVolume; int fadeSeconds; @@ -122,9 +122,9 @@ struct AlarmData int repeatInterval; int nextRepeat; }; -typedef QMap<KAAlarm::SubType, AlarmData> AlarmMap; +typedef TQMap<KAAlarm::SubType, AlarmData> AlarmMap; -static void setProcedureAlarm(Alarm*, const QString& commandLine); +static void setProcedureAlarm(Alarm*, const TQString& commandLine); /*============================================================================= @@ -211,8 +211,8 @@ void KAEvent::set(const Event& event) // Extract status from the event mEventID = event.uid(); mRevision = event.revision(); - mTemplateName = QString::null; - mLogFile = QString::null; + mTemplateName = TQString::null; + mLogFile = TQString::null; mTemplateAfterTime = -1; mBeep = false; mSpeak = false; @@ -228,14 +228,14 @@ void KAEvent::set(const Event& event) mDeferDefaultMinutes = 0; mLateCancel = 0; mKMailSerialNumber = 0; - mBgColour = QColor(255, 255, 255); // missing/invalid colour - return white background - mFgColour = QColor(0, 0, 0); // and black foreground + mBgColour = TQColor(255, 255, 255); // missing/invalid colour - return white background + mFgColour = TQColor(0, 0, 0); // and black foreground mDefaultFont = true; mEnabled = true; clearRecur(); bool ok; bool dateOnly = false; - const QStringList cats = event.categories(); + const TQStringList cats = event.categories(); for (unsigned int i = 0; i < cats.count(); ++i) { if (cats[i] == DATE_ONLY_CATEGORY) @@ -252,7 +252,7 @@ void KAEvent::set(const Event& event) mKMailSerialNumber = cats[i].mid(KMAIL_SERNUM_CATEGORY.length()).toULong(); else if (cats[i].startsWith(LOG_CATEGORY)) { - QString logUrl = cats[i].mid(LOG_CATEGORY.length()); + TQString logUrl = cats[i].mid(LOG_CATEGORY.length()); if (logUrl == xtermURL) mCommandXterm = true; else @@ -262,7 +262,7 @@ void KAEvent::set(const Event& event) { // It's the archive flag plus a reminder time and/or repeat-at-login flag mArchive = true; - QStringList list = QStringList::split(';', cats[i].mid(ARCHIVE_CATEGORIES.length())); + TQStringList list = TQStringList::split(';', cats[i].mid(ARCHIVE_CATEGORIES.length())); for (unsigned int j = 0; j < list.count(); ++j) { if (list[j] == AT_LOGIN_TYPE) @@ -316,11 +316,11 @@ void KAEvent::set(const Event& event) mAutoClose = true; } } - QString prop = event.customProperty(APPNAME, REPEAT_PROPERTY); + TQString prop = event.customProperty(APPNAME, REPEAT_PROPERTY); if (!prop.isEmpty()) { // This property is used when the main alarm has expired - QStringList list = QStringList::split(':', prop); + TQStringList list = TQStringList::split(':', prop); if (list.count() >= 2) { int interval = static_cast<int>(list[0].toUInt()); @@ -562,20 +562,20 @@ DateTime KAEvent::readDateTime(const Event& event, bool dateOnly, DateTime& star { start.set(event.dtStart(), dateOnly); DateTime next = start; - QString prop = event.customProperty(APPNAME, NEXT_RECUR_PROPERTY); + TQString prop = event.customProperty(APPNAME, NEXT_RECUR_PROPERTY); if (prop.length() >= 8) { // The next due recurrence time is specified - QDate d(prop.left(4).toInt(), prop.mid(4,2).toInt(), prop.mid(6,2).toInt()); + TQDate d(prop.left(4).toInt(), prop.mid(4,2).toInt(), prop.mid(6,2).toInt()); if (d.isValid()) { if (dateOnly && prop.length() == 8) next = d; - else if (!dateOnly && prop.length() == 15 && prop[8] == QChar('T')) + else if (!dateOnly && prop.length() == 15 && prop[8] == TQChar('T')) { - QTime t(prop.mid(9,2).toInt(), prop.mid(11,2).toInt(), prop.mid(13,2).toInt()); + TQTime t(prop.mid(9,2).toInt(), prop.mid(11,2).toInt(), prop.mid(13,2).toInt()); if (t.isValid()) - next = QDateTime(d, t); + next = TQDateTime(d, t); } } } @@ -617,7 +617,7 @@ void KAEvent::readAlarm(const Alarm& alarm, AlarmData& data) if (data.repeatCount) { bool ok; - QString property = alarm.customProperty(APPNAME, NEXT_REPEAT_PROPERTY); + TQString property = alarm.customProperty(APPNAME, NEXT_REPEAT_PROPERTY); int n = static_cast<int>(property.toUInt(&ok)); if (ok) data.nextRepeat = n; @@ -647,22 +647,22 @@ void KAEvent::readAlarm(const Alarm& alarm, AlarmData& data) { data.action = T_MESSAGE; data.cleanText = AlarmText::fromCalendarText(alarm.text(), data.isEmailText); - QString property = alarm.customProperty(APPNAME, FONT_COLOUR_PROPERTY); - QStringList list = QStringList::split(QChar(';'), property, true); - data.bgColour = QColor(255, 255, 255); // white - data.fgColour = QColor(0, 0, 0); // black + TQString property = alarm.customProperty(APPNAME, FONT_COLOUR_PROPERTY); + TQStringList list = TQStringList::split(TQChar(';'), property, true); + data.bgColour = TQColor(255, 255, 255); // white + data.fgColour = TQColor(0, 0, 0); // black int n = list.count(); if (n > 0) { if (!list[0].isEmpty()) { - QColor c(list[0]); + TQColor c(list[0]); if (c.isValid()) data.bgColour = c; } if (n > 1 && !list[1].isEmpty()) { - QColor c(list[1]); + TQColor c(list[1]); if (c.isValid()) data.fgColour = c; } @@ -681,13 +681,13 @@ void KAEvent::readAlarm(const Alarm& alarm, AlarmData& data) data.fadeVolume = -1; data.fadeSeconds = 0; data.speak = !alarm.customProperty(APPNAME, SPEAK_PROPERTY).isNull(); - QString property = alarm.customProperty(APPNAME, VOLUME_PROPERTY); + TQString property = alarm.customProperty(APPNAME, VOLUME_PROPERTY); if (!property.isEmpty()) { bool ok; float fadeVolume; int fadeSecs = 0; - QStringList list = QStringList::split(QChar(';'), property, true); + TQStringList list = TQStringList::split(TQChar(';'), property, true); data.soundVolume = list[0].toFloat(&ok); if (!ok) data.soundVolume = -1; @@ -716,11 +716,11 @@ void KAEvent::readAlarm(const Alarm& alarm, AlarmData& data) bool dateDeferral = false; data.reminderOnceOnly = false; data.type = KAAlarm::MAIN__ALARM; - QString property = alarm.customProperty(APPNAME, TYPE_PROPERTY); - QStringList types = QStringList::split(QChar(','), property); + TQString property = alarm.customProperty(APPNAME, TYPE_PROPERTY); + TQStringList types = TQStringList::split(TQChar(','), property); for (unsigned int i = 0; i < types.count(); ++i) { - QString type = types[i]; + TQString type = types[i]; if (type == AT_LOGIN_TYPE) atLogin = true; else if (type == FILE_TYPE && data.action == T_MESSAGE) @@ -770,8 +770,8 @@ void KAEvent::readAlarm(const Alarm& alarm, AlarmData& data) /****************************************************************************** * Initialise the KAEvent with the specified parameters. */ -void KAEvent::set(const QDateTime& dateTime, const QString& text, const QColor& bg, const QColor& fg, - const QFont& font, Action action, int lateCancel, int flags) +void KAEvent::set(const TQDateTime& dateTime, const TQString& text, const TQColor& bg, const TQColor& fg, + const TQFont& font, Action action, int lateCancel, int flags) { clearRecur(); mStartDateTime.set(dateTime, flags & ANY_TIME); @@ -789,10 +789,10 @@ void KAEvent::set(const QDateTime& dateTime, const QString& text, const QColor& break; } mText = (mActionType == T_COMMAND) ? text.stripWhiteSpace() : text; - mEventID = QString::null; - mTemplateName = QString::null; - mPreAction = QString::null; - mPostAction = QString::null; + mEventID = TQString::null; + mTemplateName = TQString::null; + mPreAction = TQString::null; + mPostAction = TQString::null; mAudioFile = ""; mSoundVolume = -1; mFadeVolume = -1; @@ -824,14 +824,14 @@ void KAEvent::set(const QDateTime& dateTime, const QString& text, const QColor& mUpdated = false; } -void KAEvent::setLogFile(const QString& logfile) +void KAEvent::setLogFile(const TQString& logfile) { mLogFile = logfile; if (!logfile.isEmpty()) mCommandXterm = false; } -void KAEvent::setEmail(uint from, const EmailAddressList& addresses, const QString& subject, const QStringList& attachments) +void KAEvent::setEmail(uint from, const EmailAddressList& addresses, const TQString& subject, const TQStringList& attachments) { mEmailFromIdentity = from; mEmailAddresses = addresses; @@ -839,7 +839,7 @@ void KAEvent::setEmail(uint from, const EmailAddressList& addresses, const QStri mEmailAttachments = attachments; } -void KAEvent::setAudioFile(const QString& filename, float volume, float fadeVolume, int fadeSeconds) +void KAEvent::setAudioFile(const TQString& filename, float volume, float fadeVolume, int fadeSeconds) { mAudioFile = filename; mSoundVolume = filename.isEmpty() ? -1 : volume; @@ -885,9 +885,9 @@ DateTime KAEvent::displayDateTime() const /****************************************************************************** * Convert a unique ID to indicate that the event is in a specified calendar file. */ -QString KAEvent::uid(const QString& id, Status status) +TQString KAEvent::uid(const TQString& id, Status status) { - QString result = id; + TQString result = id; Status oldStatus; int i, len; if ((i = result.find(EXPIRED_UID)) > 0) @@ -918,7 +918,7 @@ QString KAEvent::uid(const QString& id, Status status) } if (status != oldStatus && i > 0) { - QString part; + TQString part; switch (status) { case ACTIVE: part = "-"; break; @@ -935,7 +935,7 @@ QString KAEvent::uid(const QString& id, Status status) /****************************************************************************** * Get the calendar type for a unique ID. */ -KAEvent::Status KAEvent::uidStatus(const QString& uid) +KAEvent::Status KAEvent::uidStatus(const TQString& uid) { if (uid.find(EXPIRED_UID) > 0) return EXPIRED; @@ -992,7 +992,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc ev.removeCustomProperty(APPNAME, NEXT_RECUR_PROPERTY); ev.removeCustomProperty(APPNAME, REPEAT_PROPERTY); - QStringList cats; + TQStringList cats; if (mStartDateTime.isDateOnly()) cats.append(DATE_ONLY_CATEGORY); if (mConfirmAck) @@ -1000,7 +1000,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc if (mEmailBcc) cats.append(EMAIL_BCC_CATEGORY); if (mKMailSerialNumber) - cats.append(QString("%1%2").arg(KMAIL_SERNUM_CATEGORY).arg(mKMailSerialNumber)); + cats.append(TQString("%1%2").arg(KMAIL_SERNUM_CATEGORY).arg(mKMailSerialNumber)); if (mCopyToKOrganizer) cats.append(KORGANIZER_CATEGORY); if (mCommandXterm) @@ -1008,14 +1008,14 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc else if (!mLogFile.isEmpty()) cats.append(LOG_CATEGORY + mLogFile); if (mLateCancel) - cats.append(QString("%1%2").arg(mAutoClose ? AUTO_CLOSE_CATEGORY : LATE_CANCEL_CATEGORY).arg(mLateCancel)); + cats.append(TQString("%1%2").arg(mAutoClose ? AUTO_CLOSE_CATEGORY : LATE_CANCEL_CATEGORY).arg(mLateCancel)); if (mDeferDefaultMinutes) - cats.append(QString("%1%2").arg(DEFER_CATEGORY).arg(mDeferDefaultMinutes)); + cats.append(TQString("%1%2").arg(DEFER_CATEGORY).arg(mDeferDefaultMinutes)); if (!mTemplateName.isEmpty() && mTemplateAfterTime >= 0) - cats.append(QString("%1%2").arg(TEMPL_AFTER_TIME_CATEGORY).arg(mTemplateAfterTime)); + cats.append(TQString("%1%2").arg(TEMPL_AFTER_TIME_CATEGORY).arg(mTemplateAfterTime)); if (mArchive && !original) { - QStringList params; + TQStringList params; if (mArchiveReminderMinutes) { if (mReminderOnceOnly) @@ -1032,21 +1032,21 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc unit = 'H'; count /= 60; } - params += QString("%1%2").arg(count).arg(unit); + params += TQString("%1%2").arg(count).arg(unit); } if (mArchiveRepeatAtLogin) params += AT_LOGIN_TYPE; if (params.count() > 0) { - QString cat = ARCHIVE_CATEGORIES; - cat += params.join(QString::fromLatin1(";")); + TQString cat = ARCHIVE_CATEGORIES; + cat += params.join(TQString::fromLatin1(";")); cats.append(cat); } else cats.append(ARCHIVE_CATEGORY); } ev.setCategories(cats); - ev.setCustomStatus(mEnabled ? QString::null : DISABLED_STATUS); + ev.setCustomStatus(mEnabled ? TQString::null : DISABLED_STATUS); ev.setRevision(mRevision); ev.clearAlarms(); @@ -1071,12 +1071,12 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc */ if (!original && checkRecur() != KARecurrence::NO_RECUR) { - QDateTime dt = mNextMainDateTime.dateTime(); + TQDateTime dt = mNextMainDateTime.dateTime(); ev.setCustomProperty(APPNAME, NEXT_RECUR_PROPERTY, dt.toString(mNextMainDateTime.isDateOnly() ? "yyyyMMdd" : "yyyyMMddThhmmss")); } // Add the main alarm - initKCalAlarm(ev, 0, QStringList(), KAAlarm::MAIN_ALARM); + initKCalAlarm(ev, 0, TQStringList(), KAAlarm::MAIN_ALARM); ancillaryOffset = 0; ancillaryType = dtMain.isValid() ? 2 : 0; } @@ -1084,7 +1084,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc { // Alarm repetition is normally held in the main alarm, but since // the main alarm has expired, store in a custom property. - QString param = QString("%1:%2").arg(mRepeatInterval).arg(mRepeatCount); + TQString param = TQString("%1:%2").arg(mRepeatInterval).arg(mRepeatCount); ev.setCustomProperty(APPNAME, REPEAT_PROPERTY, param); } @@ -1097,9 +1097,9 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc else if (mAtLoginDateTime.isValid()) dtl = mAtLoginDateTime; else if (mStartDateTime.isDateOnly()) - dtl = QDate::currentDate().addDays(-1); + dtl = TQDate::currentDate().addDays(-1); else - dtl = QDateTime::currentDateTime(); + dtl = TQDateTime::currentDateTime(); initKCalAlarm(ev, dtl, AT_LOGIN_TYPE); if (!ancillaryType && dtl.isValid()) { @@ -1110,7 +1110,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc if (mReminderMinutes || mArchiveReminderMinutes && original) { int minutes = mReminderMinutes ? mReminderMinutes : mArchiveReminderMinutes; - initKCalAlarm(ev, -minutes * 60, QStringList(mReminderOnceOnly ? REMINDER_ONCE_TYPE : REMINDER_TYPE)); + initKCalAlarm(ev, -minutes * 60, TQStringList(mReminderOnceOnly ? REMINDER_ONCE_TYPE : REMINDER_TYPE)); if (!ancillaryType) { ancillaryOffset = -minutes * 60; @@ -1136,7 +1136,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc } } int startOffset; - QStringList list; + TQStringList list; if (mDeferralTime.isDateOnly()) { startOffset = nextDateTime.secsTo(mDeferralTime.dateTime()); @@ -1160,7 +1160,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc ev.setSummary(mTemplateName); else if (mDisplaying) { - QStringList list(DISPLAYING_TYPE); + TQStringList list(DISPLAYING_TYPE); if (mDisplayingFlags & REPEAT_AT_LOGIN) list += AT_LOGIN_TYPE; else if (mDisplayingFlags & DEFERRAL) @@ -1183,25 +1183,25 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc { // A sound is specified if (ancillaryType == 2) - initKCalAlarm(ev, ancillaryOffset, QStringList(), KAAlarm::AUDIO_ALARM); + initKCalAlarm(ev, ancillaryOffset, TQStringList(), KAAlarm::AUDIO_ALARM); else - initKCalAlarm(ev, ancillaryTime, QStringList(), KAAlarm::AUDIO_ALARM); + initKCalAlarm(ev, ancillaryTime, TQStringList(), KAAlarm::AUDIO_ALARM); } if (!mPreAction.isEmpty()) { // A pre-display action is specified if (ancillaryType == 2) - initKCalAlarm(ev, ancillaryOffset, QStringList(PRE_ACTION_TYPE), KAAlarm::PRE_ACTION_ALARM); + initKCalAlarm(ev, ancillaryOffset, TQStringList(PRE_ACTION_TYPE), KAAlarm::PRE_ACTION_ALARM); else - initKCalAlarm(ev, ancillaryTime, QStringList(PRE_ACTION_TYPE), KAAlarm::PRE_ACTION_ALARM); + initKCalAlarm(ev, ancillaryTime, TQStringList(PRE_ACTION_TYPE), KAAlarm::PRE_ACTION_ALARM); } if (!mPostAction.isEmpty()) { // A post-display action is specified if (ancillaryType == 2) - initKCalAlarm(ev, ancillaryOffset, QStringList(POST_ACTION_TYPE), KAAlarm::POST_ACTION_ALARM); + initKCalAlarm(ev, ancillaryOffset, TQStringList(POST_ACTION_TYPE), KAAlarm::POST_ACTION_ALARM); else - initKCalAlarm(ev, ancillaryTime, QStringList(POST_ACTION_TYPE), KAAlarm::POST_ACTION_ALARM); + initKCalAlarm(ev, ancillaryTime, TQStringList(POST_ACTION_TYPE), KAAlarm::POST_ACTION_ALARM); } if (mRecurrence) @@ -1219,16 +1219,16 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc * alarm action. If 'types' is non-null, it is appended to the X-KDE-KALARM-TYPE * property value list. */ -Alarm* KAEvent::initKCalAlarm(Event& event, const DateTime& dt, const QStringList& types, KAAlarm::Type type) const +Alarm* KAEvent::initKCalAlarm(Event& event, const DateTime& dt, const TQStringList& types, KAAlarm::Type type) const { int startOffset = dt.isDateOnly() ? mStartDateTime.secsTo(dt) : mStartDateTime.dateTime().secsTo(dt.dateTime()); return initKCalAlarm(event, startOffset, types, type); } -Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const QStringList& types, KAAlarm::Type type) const +Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const TQStringList& types, KAAlarm::Type type) const { - QStringList alltypes; + TQStringList alltypes; Alarm* alarm = event.newAlarm(); alarm->setEnabled(true); if (type != KAAlarm::MAIN_ALARM) @@ -1243,7 +1243,7 @@ Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const QStringLi case KAAlarm::AUDIO_ALARM: alarm->setAudioAlarm(mAudioFile); // empty for a beep or for speaking if (mSpeak) - alarm->setCustomProperty(APPNAME, SPEAK_PROPERTY, QString::fromLatin1("Y")); + alarm->setCustomProperty(APPNAME, SPEAK_PROPERTY, TQString::fromLatin1("Y")); if (mRepeatSound) { alarm->setRepeatCount(-1); @@ -1251,8 +1251,8 @@ Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const QStringLi } if (!mAudioFile.isEmpty() && mSoundVolume >= 0) alarm->setCustomProperty(APPNAME, VOLUME_PROPERTY, - QString::fromLatin1("%1;%2;%3").arg(QString::number(mSoundVolume, 'f', 2)) - .arg(QString::number(mFadeVolume, 'f', 2)) + TQString::fromLatin1("%1;%2;%3").arg(TQString::number(mSoundVolume, 'f', 2)) + .arg(TQString::number(mFadeVolume, 'f', 2)) .arg(mFadeSeconds)); break; case KAAlarm::PRE_ACTION_ALARM: @@ -1266,7 +1266,7 @@ Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const QStringLi alarm->setRepeatCount(mRepeatCount); if (mRepeatCount) alarm->setCustomProperty(APPNAME, NEXT_REPEAT_PROPERTY, - QString::number(mNextRepeat)); + TQString::number(mNextRepeat)); // fall through to INVALID_ALARM case KAAlarm::INVALID_ALARM: switch (mActionType) @@ -1277,9 +1277,9 @@ Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const QStringLi case T_MESSAGE: alarm->setDisplayAlarm(AlarmText::toCalendarText(mText)); alarm->setCustomProperty(APPNAME, FONT_COLOUR_PROPERTY, - QString::fromLatin1("%1;%2;%3").arg(mBgColour.name()) + TQString::fromLatin1("%1;%2;%3").arg(mBgColour.name()) .arg(mFgColour.name()) - .arg(mDefaultFont ? QString::null : mFont.toString())); + .arg(mDefaultFont ? TQString::null : mFont.toString())); break; case T_COMMAND: if (mCommandScript) @@ -1290,7 +1290,7 @@ Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const QStringLi case T_EMAIL: alarm->setEmailAlarm(mEmailSubject, mText, mEmailAddresses, mEmailAttachments); if (mEmailFromIdentity) - alarm->setCustomProperty(APPNAME, EMAIL_ID_PROPERTY, QString::number(mEmailFromIdentity)); + alarm->setCustomProperty(APPNAME, EMAIL_ID_PROPERTY, TQString::number(mEmailFromIdentity)); break; case T_AUDIO: break; @@ -1601,7 +1601,7 @@ bool KAEvent::defer(const DateTime& dateTime, bool reminder, bool adjustRecurren set_deferral(NORMAL_DEFERRAL); if (adjustRecurrence) { - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::currentDateTime(); if (mainEndRepeatTime() < now) { // The last repetition (if any) of the current recurrence has already passed. @@ -1641,7 +1641,7 @@ void KAEvent::cancelDefer() // Set the deferral time to be the same as the next recurrence/repetition. // This prevents an immediate retriggering of the alarm. if (mMainExpired - || nextOccurrence(QDateTime::currentDateTime(), mDeferralTime, RETURN_REPETITION) == NO_OCCURRENCE) + || nextOccurrence(TQDateTime::currentDateTime(), mDeferralTime, RETURN_REPETITION) == NO_OCCURRENCE) { // The main alarm has expired, so simply delete the deferral mDeferralTime = DateTime(); @@ -1678,7 +1678,7 @@ DateTime KAEvent::deferralLimit(KAEvent::DeferLimitType* limitType) const // It's a repeated alarm. Don't allow it to be deferred past its // next occurrence or repetition. DateTime reminderTime; - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::currentDateTime(); OccurType type = nextOccurrence(now, endTime, RETURN_REPETITION); if (type & OCCURRENCE_REPEAT) ltype = LIMIT_REPETITION; @@ -1695,7 +1695,7 @@ DateTime KAEvent::deferralLimit(KAEvent::DeferLimitType* limitType) const ltype = LIMIT_RECURRENCE; } else if ((mReminderMinutes || mDeferral == REMINDER_DEFERRAL || mArchiveReminderMinutes) - && QDateTime::currentDateTime() < mNextMainDateTime.dateTime()) + && TQDateTime::currentDateTime() < mNextMainDateTime.dateTime()) { // It's an reminder alarm. Don't allow it to be deferred past its main alarm time. endTime = mNextMainDateTime; @@ -1719,7 +1719,7 @@ DateTime KAEvent::deferralLimit(KAEvent::DeferLimitType* limitType) const * saved in case their end time expires before the next login. * Reply = true if successful, false if alarm was not copied. */ -bool KAEvent::setDisplaying(const KAEvent& event, KAAlarm::Type alarmType, const QDateTime& repeatAtLoginTime) +bool KAEvent::setDisplaying(const KAEvent& event, KAAlarm::Type alarmType, const TQDateTime& repeatAtLoginTime) { if (!mDisplaying && (alarmType == KAAlarm::MAIN_ALARM @@ -1804,9 +1804,9 @@ void KAEvent::reinstateFromDisplaying(const KAEvent& dispEvent) * If 'includeRepetitions' is true and the alarm has a sub-repetition, it * returns true if any repetitions occur after the specified date/time. */ -bool KAEvent::occursAfter(const QDateTime& preDateTime, bool includeRepetitions) const +bool KAEvent::occursAfter(const TQDateTime& preDateTime, bool includeRepetitions) const { - QDateTime dt; + TQDateTime dt; if (checkRecur() != KARecurrence::NO_RECUR) { if (mRecurrence->duration() < 0) @@ -1817,7 +1817,7 @@ bool KAEvent::occursAfter(const QDateTime& preDateTime, bool includeRepetitions) dt = mNextMainDateTime.dateTime(); if (mStartDateTime.isDateOnly()) { - QDate pre = preDateTime.date(); + TQDate pre = preDateTime.date(); if (preDateTime.time() < Preferences::startOfDay()) pre = pre.addDays(-1); // today's recurrence (if today recurs) is still to come if (pre < dt.date()) @@ -1839,11 +1839,11 @@ bool KAEvent::occursAfter(const QDateTime& preDateTime, bool includeRepetitions) * date/time. * 'result' = date/time of next occurrence, or invalid date/time if none. */ -KAEvent::OccurType KAEvent::nextOccurrence(const QDateTime& preDateTime, DateTime& result, +KAEvent::OccurType KAEvent::nextOccurrence(const TQDateTime& preDateTime, DateTime& result, KAEvent::OccurOption includeRepetitions) const { int repeatSecs = 0; - QDateTime pre = preDateTime; + TQDateTime pre = preDateTime; if (includeRepetitions != IGNORE_REPETITION) { if (!mRepeatCount || !mRepeatInterval) @@ -1914,11 +1914,11 @@ KAEvent::OccurType KAEvent::nextOccurrence(const QDateTime& preDateTime, DateTim * last previous repetition is returned if appropriate. * 'result' = date/time of previous occurrence, or invalid date/time if none. */ -KAEvent::OccurType KAEvent::previousOccurrence(const QDateTime& afterDateTime, DateTime& result, bool includeRepetitions) const +KAEvent::OccurType KAEvent::previousOccurrence(const TQDateTime& afterDateTime, DateTime& result, bool includeRepetitions) const { if (mStartDateTime >= afterDateTime) { - result = QDateTime(); + result = TQDateTime(); return NO_OCCURRENCE; // the event starts after the specified date/time } @@ -1931,11 +1931,11 @@ KAEvent::OccurType KAEvent::previousOccurrence(const QDateTime& afterDateTime, D } else { - QDateTime recurStart = mRecurrence->startDateTime(); - QDateTime after = afterDateTime; + TQDateTime recurStart = mRecurrence->startDateTime(); + TQDateTime after = afterDateTime; if (mStartDateTime.isDateOnly() && afterDateTime.time() > Preferences::startOfDay()) after = after.addDays(1); // today's recurrence (if today recurs) has passed - QDateTime dt = mRecurrence->getPreviousDateTime(after); + TQDateTime dt = mRecurrence->getPreviousDateTime(after); result.set(dt, mStartDateTime.isDateOnly()); if (!dt.isValid()) return NO_OCCURRENCE; @@ -1951,7 +1951,7 @@ KAEvent::OccurType KAEvent::previousOccurrence(const QDateTime& afterDateTime, D { // Find the latest repetition which is before the specified time. // N.B. This is coded to avoid 32-bit integer overflow which occurs - // in QDateTime::secsTo() for large enough time differences. + // in TQDateTime::secsTo() for large enough time differences. int repeatSecs = mRepeatInterval * 60; DateTime lastRepetition = result.addSecs(mRepeatCount * repeatSecs); if (lastRepetition < afterDateTime) @@ -1977,11 +1977,11 @@ KAEvent::OccurType KAEvent::previousOccurrence(const QDateTime& afterDateTime, D * recurrence occurs after the specified date/time, that repetition is set as * the next occurrence. */ -KAEvent::OccurType KAEvent::setNextOccurrence(const QDateTime& preDateTime) +KAEvent::OccurType KAEvent::setNextOccurrence(const TQDateTime& preDateTime) { if (preDateTime < mNextMainDateTime.dateTime()) return FIRST_OR_ONLY_OCCURRENCE; // it might not be the first recurrence - tant pis - QDateTime pre = preDateTime; + TQDateTime pre = preDateTime; // If there are repetitions, adjust the comparison date/time so that // we find the earliest recurrence which has a repetition falling after // the specified preDateTime. @@ -2053,16 +2053,16 @@ KAEvent::OccurType KAEvent::setNextOccurrence(const QDateTime& preDateTime) * date/time. * 'result' = date/time of next occurrence, or invalid date/time if none. */ -KAEvent::OccurType KAEvent::nextRecurrence(const QDateTime& preDateTime, DateTime& result) const +KAEvent::OccurType KAEvent::nextRecurrence(const TQDateTime& preDateTime, DateTime& result) const { - QDateTime recurStart = mRecurrence->startDateTime(); - QDateTime pre = preDateTime; + TQDateTime recurStart = mRecurrence->startDateTime(); + TQDateTime pre = preDateTime; if (mStartDateTime.isDateOnly() && preDateTime.time() < Preferences::startOfDay()) { pre = pre.addDays(-1); // today's recurrence (if today recurs) is still to come pre.setTime(Preferences::startOfDay()); } - QDateTime dt = mRecurrence->getNextDateTime(pre); + TQDateTime dt = mRecurrence->getNextDateTime(pre); result.set(dt, mStartDateTime.isDateOnly()); if (!dt.isValid()) return NO_OCCURRENCE; @@ -2076,7 +2076,7 @@ KAEvent::OccurType KAEvent::nextRecurrence(const QDateTime& preDateTime, DateTim /****************************************************************************** * Return the recurrence interval as text suitable for display. */ -QString KAEvent::recurrenceText(bool brief) const +TQString KAEvent::recurrenceText(bool brief) const { if (mRepeatAtLogin) return brief ? i18n("Brief form of 'At Login'", "Login") : i18n("At login"); @@ -2092,8 +2092,8 @@ QString KAEvent::recurrenceText(bool brief) const return i18n("1 Hour", "%n Hours", frequency/60); else { - QString mins; - return i18n("Hours and Minutes", "%1H %2M").arg(QString::number(frequency/60)).arg(mins.sprintf("%02d", frequency%60)); + TQString mins; + return i18n("Hours and Minutes", "%1H %2M").arg(TQString::number(frequency/60)).arg(mins.sprintf("%02d", frequency%60)); } case RecurrenceRule::rDaily: return i18n("1 Day", "%n Days", frequency); @@ -2108,13 +2108,13 @@ QString KAEvent::recurrenceText(bool brief) const break; } } - return brief ? QString::null : i18n("None"); + return brief ? TQString::null : i18n("None"); } /****************************************************************************** * Return the repetition interval as text suitable for display. */ -QString KAEvent::repetitionText(bool brief) const +TQString KAEvent::repetitionText(bool brief) const { if (mRepeatCount) { @@ -2124,14 +2124,14 @@ QString KAEvent::repetitionText(bool brief) const return i18n("1 Minute", "%n Minutes", mRepeatInterval); if (mRepeatInterval % 60 == 0) return i18n("1 Hour", "%n Hours", mRepeatInterval/60); - QString mins; - return i18n("Hours and Minutes", "%1H %2M").arg(QString::number(mRepeatInterval/60)).arg(mins.sprintf("%02d", mRepeatInterval%60)); + TQString mins; + return i18n("Hours and Minutes", "%1H %2M").arg(TQString::number(mRepeatInterval/60)).arg(mins.sprintf("%02d", mRepeatInterval%60)); } if (mRepeatInterval % (7*1440)) return i18n("1 Day", "%n Days", mRepeatInterval/1440); return i18n("1 Week", "%n Weeks", mRepeatInterval/(7*1440)); } - return brief ? QString::null : i18n("None"); + return brief ? TQString::null : i18n("None"); } /****************************************************************************** @@ -2157,7 +2157,7 @@ void KAEvent::setFirstRecurrence() case KARecurrence::MONTHLY_DAY: break; } - QDateTime recurStart = mRecurrence->startDateTime(); + TQDateTime recurStart = mRecurrence->startDateTime(); if (mRecurrence->recursOn(recurStart.date())) return; // it already recurs on the start date @@ -2236,7 +2236,7 @@ bool KAEvent::setRepetition(int interval, int count) * end = end date/time (invalid to use 'count' instead). * Reply = false if no recurrence was set up. */ -bool KAEvent::setRecurMinutely(int freq, int count, const QDateTime& end) +bool KAEvent::setRecurMinutely(int freq, int count, const TQDateTime& end) { return setRecur(RecurrenceRule::rMinutely, freq, count, end); } @@ -2252,7 +2252,7 @@ bool KAEvent::setRecurMinutely(int freq, int count, const QDateTime& end) * end = end date (invalid to use 'count' instead). * Reply = false if no recurrence was set up. */ -bool KAEvent::setRecurDaily(int freq, const QBitArray& days, int count, const QDate& end) +bool KAEvent::setRecurDaily(int freq, const TQBitArray& days, int count, const TQDate& end) { if (!setRecur(RecurrenceRule::rDaily, freq, count, end)) return false; @@ -2278,7 +2278,7 @@ bool KAEvent::setRecurDaily(int freq, const QBitArray& days, int count, const QD * end = end date (invalid to use 'count' instead). * Reply = false if no recurrence was set up. */ -bool KAEvent::setRecurWeekly(int freq, const QBitArray& days, int count, const QDate& end) +bool KAEvent::setRecurWeekly(int freq, const TQBitArray& days, int count, const TQDate& end) { if (!setRecur(RecurrenceRule::rWeekly, freq, count, end)) return false; @@ -2297,11 +2297,11 @@ bool KAEvent::setRecurWeekly(int freq, const QBitArray& days, int count, const Q * end = end date (invalid to use 'count' instead). * Reply = false if no recurrence was set up. */ -bool KAEvent::setRecurMonthlyByDate(int freq, const QValueList<int>& days, int count, const QDate& end) +bool KAEvent::setRecurMonthlyByDate(int freq, const TQValueList<int>& days, int count, const TQDate& end) { if (!setRecur(RecurrenceRule::rMonthly, freq, count, end)) return false; - for (QValueListConstIterator<int> it = days.begin(); it != days.end(); ++it) + for (TQValueListConstIterator<int> it = days.begin(); it != days.end(); ++it) mRecurrence->addMonthlyDate(*it); return true; } @@ -2318,11 +2318,11 @@ bool KAEvent::setRecurMonthlyByDate(int freq, const QValueList<int>& days, int c * end = end date (invalid to use 'count' instead). * Reply = false if no recurrence was set up. */ -bool KAEvent::setRecurMonthlyByPos(int freq, const QValueList<MonthPos>& posns, int count, const QDate& end) +bool KAEvent::setRecurMonthlyByPos(int freq, const TQValueList<MonthPos>& posns, int count, const TQDate& end) { if (!setRecur(RecurrenceRule::rMonthly, freq, count, end)) return false; - for (QValueListConstIterator<MonthPos> it = posns.begin(); it != posns.end(); ++it) + for (TQValueListConstIterator<MonthPos> it = posns.begin(); it != posns.end(); ++it) mRecurrence->addMonthlyPos((*it).weeknum, (*it).days); return true; } @@ -2341,11 +2341,11 @@ bool KAEvent::setRecurMonthlyByPos(int freq, const QValueList<MonthPos>& posns, * end = end date (invalid to use 'count' instead). * Reply = false if no recurrence was set up. */ -bool KAEvent::setRecurAnnualByDate(int freq, const QValueList<int>& months, int day, KARecurrence::Feb29Type feb29, int count, const QDate& end) +bool KAEvent::setRecurAnnualByDate(int freq, const TQValueList<int>& months, int day, KARecurrence::Feb29Type feb29, int count, const TQDate& end) { if (!setRecur(RecurrenceRule::rYearly, freq, count, end, feb29)) return false; - for (QValueListConstIterator<int> it = months.begin(); it != months.end(); ++it) + for (TQValueListConstIterator<int> it = months.begin(); it != months.end(); ++it) mRecurrence->addYearlyMonth(*it); if (day) mRecurrence->addMonthlyDate(day); @@ -2365,13 +2365,13 @@ bool KAEvent::setRecurAnnualByDate(int freq, const QValueList<int>& months, int * end = end date (invalid to use 'count' instead). * Reply = false if no recurrence was set up. */ -bool KAEvent::setRecurAnnualByPos(int freq, const QValueList<MonthPos>& posns, const QValueList<int>& months, int count, const QDate& end) +bool KAEvent::setRecurAnnualByPos(int freq, const TQValueList<MonthPos>& posns, const TQValueList<int>& months, int count, const TQDate& end) { if (!setRecur(RecurrenceRule::rYearly, freq, count, end)) return false; - for (QValueListConstIterator<int> it = months.begin(); it != months.end(); ++it) + for (TQValueListConstIterator<int> it = months.begin(); it != months.end(); ++it) mRecurrence->addYearlyMonth(*it); - for (QValueListConstIterator<MonthPos> it = posns.begin(); it != posns.end(); ++it) + for (TQValueListConstIterator<MonthPos> it = posns.begin(); it != posns.end(); ++it) mRecurrence->addYearlyPos((*it).weeknum, (*it).days); return true; } @@ -2386,7 +2386,7 @@ bool KAEvent::setRecurAnnualByPos(int freq, const QValueList<MonthPos>& posns, c * end = end date/time (invalid to use 'count' instead). * Reply = false if no recurrence was set up. */ -bool KAEvent::setRecur(RecurrenceRule::PeriodType recurType, int freq, int count, const QDateTime& end, KARecurrence::Feb29Type feb29) +bool KAEvent::setRecur(RecurrenceRule::PeriodType recurType, int freq, int count, const TQDateTime& end, KARecurrence::Feb29Type feb29) { if (count >= -1 && (count || end.date().isValid())) { @@ -2483,17 +2483,17 @@ void KAEvent::checkRepetition() const #if 0 /****************************************************************************** - * Convert a QValueList<WDayPos> to QValueList<MonthPos>. + * Convert a TQValueList<WDayPos> to TQValueList<MonthPos>. */ -QValueList<KAEvent::MonthPos> KAEvent::convRecurPos(const QValueList<KCal::RecurrenceRule::WDayPos>& wdaypos) +TQValueList<KAEvent::MonthPos> KAEvent::convRecurPos(const TQValueList<KCal::RecurrenceRule::WDayPos>& wdaypos) { - QValueList<MonthPos> mposns; - for (QValueList<KCal::RecurrenceRule::WDayPos>::ConstIterator it = wdaypos.begin(); it != wdaypos.end(); ++it) + TQValueList<MonthPos> mposns; + for (TQValueList<KCal::RecurrenceRule::WDayPos>::ConstIterator it = wdaypos.begin(); it != wdaypos.end(); ++it) { int daybit = (*it).day() - 1; int weeknum = (*it).pos(); bool found = false; - for (QValueList<MonthPos>::Iterator mit = mposns.begin(); mit != mposns.end(); ++mit) + for (TQValueList<MonthPos>::Iterator mit = mposns.begin(); mit != mposns.end(); ++mit) { if ((*mit).weeknum == weeknum) { @@ -2519,7 +2519,7 @@ QValueList<KAEvent::MonthPos> KAEvent::convRecurPos(const QValueList<KCal::Recur * Find the alarm template with the specified name. * Reply = invalid event if not found. */ -KAEvent KAEvent::findTemplateName(AlarmCalendar& calendar, const QString& name) +KAEvent KAEvent::findTemplateName(AlarmCalendar& calendar, const TQString& name) { KAEvent event; Event::List events = calendar.events(); @@ -2546,19 +2546,19 @@ KAEvent KAEvent::findTemplateName(AlarmCalendar& calendar, const QString& name) bool KAEvent::adjustStartOfDay(const Event::List& events) { bool changed = false; - QTime startOfDay = Preferences::startOfDay(); + TQTime startOfDay = Preferences::startOfDay(); for (Event::List::ConstIterator evit = events.begin(); evit != events.end(); ++evit) { Event* event = *evit; - const QStringList cats = event->categories(); + const TQStringList cats = event->categories(); if (cats.find(DATE_ONLY_CATEGORY) != cats.end()) { // It's an untimed event, so fix it - QTime oldTime = event->dtStart().time(); + TQTime oldTime = event->dtStart().time(); int adjustment = oldTime.secsTo(startOfDay); if (adjustment) { - event->setDtStart(QDateTime(event->dtStart().date(), startOfDay)); + event->setDtStart(TQDateTime(event->dtStart().date(), startOfDay)); Alarm::List alarms = event->alarms(); int deferralOffset = 0; for (Alarm::List::ConstIterator alit = alarms.begin(); alit != alarms.end(); ++alit) @@ -2589,7 +2589,7 @@ bool KAEvent::adjustStartOfDay(const Event::List& events) int deferralOffset = 0; int newDeferralOffset = 0; DateTime start; - QDateTime nextMainDateTime = readDateTime(*event, false, start).rawDateTime(); + TQDateTime nextMainDateTime = readDateTime(*event, false, start).rawDateTime(); AlarmMap alarmMap; readAlarms(*event, &alarmMap); for (AlarmMap::Iterator it = alarmMap.begin(); it != alarmMap.end(); ++it) @@ -2601,7 +2601,7 @@ bool KAEvent::adjustStartOfDay(const Event::List& events) && !(data.type & KAAlarm::TIMED_DEFERRAL_FLAG)) { // Date-only deferral alarm, so adjust its time - QDateTime altime = nextMainDateTime.addSecs(data.alarm->startOffset().asSeconds()); + TQDateTime altime = nextMainDateTime.addSecs(data.alarm->startOffset().asSeconds()); altime.setTime(startOfDay); deferralOffset = data.alarm->startOffset().asSeconds(); newDeferralOffset = event->dtStart().secsTo(altime); @@ -2629,28 +2629,28 @@ bool KAEvent::adjustStartOfDay(const Event::List& events) void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adjustSummerTime) { // KAlarm pre-0.9 codes held in the alarm's DESCRIPTION property - static const QChar SEPARATOR = ';'; - static const QChar LATE_CANCEL_CODE = 'C'; - static const QChar AT_LOGIN_CODE = 'L'; // subsidiary alarm at every login - static const QChar DEFERRAL_CODE = 'D'; // extra deferred alarm - static const QString TEXT_PREFIX = QString::fromLatin1("TEXT:"); - static const QString FILE_PREFIX = QString::fromLatin1("FILE:"); - static const QString COMMAND_PREFIX = QString::fromLatin1("CMD:"); + static const TQChar SEPARATOR = ';'; + static const TQChar LATE_CANCEL_CODE = 'C'; + static const TQChar AT_LOGIN_CODE = 'L'; // subsidiary alarm at every login + static const TQChar DEFERRAL_CODE = 'D'; // extra deferred alarm + static const TQString TEXT_PREFIX = TQString::fromLatin1("TEXT:"); + static const TQString FILE_PREFIX = TQString::fromLatin1("FILE:"); + static const TQString COMMAND_PREFIX = TQString::fromLatin1("CMD:"); // KAlarm pre-0.9.2 codes held in the event's CATEGORY property - static const QString BEEP_CATEGORY = QString::fromLatin1("BEEP"); + static const TQString BEEP_CATEGORY = TQString::fromLatin1("BEEP"); // KAlarm pre-1.1.1 LATECANCEL category with no parameter - static const QString LATE_CANCEL_CAT = QString::fromLatin1("LATECANCEL"); + static const TQString LATE_CANCEL_CAT = TQString::fromLatin1("LATECANCEL"); // KAlarm pre-1.3.0 TMPLDEFTIME category with no parameter - static const QString TEMPL_DEF_TIME_CAT = QString::fromLatin1("TMPLDEFTIME"); + static const TQString TEMPL_DEF_TIME_CAT = TQString::fromLatin1("TMPLDEFTIME"); // KAlarm pre-1.3.1 XTERM category - static const QString EXEC_IN_XTERM_CAT = QString::fromLatin1("XTERM"); + static const TQString EXEC_IN_XTERM_CAT = TQString::fromLatin1("XTERM"); // KAlarm pre-1.4.22 properties - static const QCString KMAIL_ID_PROPERTY("KMAILID"); // X-KDE-KALARM-KMAILID property + static const TQCString KMAIL_ID_PROPERTY("KMAILID"); // X-KDE-KALARM-KMAILID property if (version >= calVersion()) return; @@ -2667,8 +2667,8 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju bool pre_1_5_0 = (version < KAlarm::Version(1,5,0)); Q_ASSERT(calVersion() == KAlarm::Version(1,5,0)); - QDateTime dt0(QDate(1970,1,1), QTime(0,0,0)); - QTime startOfDay = Preferences::startOfDay(); + TQDateTime dt0(TQDate(1970,1,1), TQTime(0,0,0)); + TQTime startOfDay = Preferences::startOfDay(); Event::List events = calendar.rawEvents(); for (Event::List::ConstIterator evit = events.begin(); evit != events.end(); ++evit) @@ -2677,7 +2677,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju Alarm::List alarms = event->alarms(); if (alarms.isEmpty()) continue; // KAlarm isn't interested in events without alarms - QStringList cats = event->categories(); + TQStringList cats = event->categories(); bool addLateCancel = false; if (pre_0_7 && event->doesFloat()) @@ -2708,7 +2708,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju bool deferral = false; bool lateCancel = false; KAAlarmEventBase::Type action = T_MESSAGE; - QString txt = alarm->text(); + TQString txt = alarm->text(); int length = txt.length(); int i = 0; if (txt[0].isDigit()) @@ -2718,7 +2718,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju { while (i < length) { - QChar ch = txt[i++]; + TQChar ch = txt[i++]; if (ch == SEPARATOR) break; if (ch == LATE_CANCEL_CODE) @@ -2748,7 +2748,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju i = 0; txt = txt.mid(i); - QStringList types; + TQStringList types; switch (action) { case T_FILE: @@ -2794,7 +2794,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju { // The calendar file was written by the KDE 3.0.0 version of KAlarm 0.5.7. // Summer time was ignored when converting to UTC. - QDateTime dt = alarm->time(); + TQDateTime dt = alarm->time(); time_t t = dt0.secsTo(dt); struct tm* dtm = localtime(&t); if (dtm->tm_isdst) @@ -2820,7 +2820,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju */ if (uidStatus(event->uid()) == EXPIRED) event->setCreated(event->dtEnd()); - QDateTime start = event->dtStart(); + TQDateTime start = event->dtStart(); if (event->doesFloat()) { event->setFloats(false); @@ -2833,7 +2833,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju for (alit = alarms.begin(); alit != alarms.end(); ++alit) { Alarm* alarm = *alit; - QDateTime dt = alarm->time(); + TQDateTime dt = alarm->time(); alarm->setStartOffset(start.secsTo(dt)); } @@ -2844,12 +2844,12 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju Alarm* alarm = *alit; if (alarm->type() == Alarm::Display) alarm->setCustomProperty(APPNAME, FONT_COLOUR_PROPERTY, - QString::fromLatin1("%1;;").arg(cats[0])); + TQString::fromLatin1("%1;;").arg(cats[0])); } cats.remove(cats.begin()); } - for (QStringList::Iterator it = cats.begin(); it != cats.end(); ++it) + for (TQStringList::Iterator it = cats.begin(); it != cats.end(); ++it) { if (*it == BEEP_CATEGORY) { @@ -2858,7 +2858,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju Alarm* alarm = event->newAlarm(); alarm->setEnabled(true); alarm->setAudioAlarm(); - QDateTime dt = event->dtStart(); // default + TQDateTime dt = event->dtStart(); // default // Parse and order the alarms to know which one's date/time to use AlarmMap alarmMap; @@ -2881,7 +2881,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju * It's a KAlarm pre-1.1.1 calendar file. * Convert simple LATECANCEL category to LATECANCEL:n where n = minutes late. */ - QStringList::Iterator it; + TQStringList::Iterator it; while ((it = cats.find(LATE_CANCEL_CAT)) != cats.end()) { cats.remove(it); @@ -2900,8 +2900,8 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju Alarm* alarm = *alit; if (alarm->type() == Alarm::Display) { - QString oldtext = alarm->text(); - QString newtext = AlarmText::toCalendarText(oldtext); + TQString oldtext = alarm->text(); + TQString newtext = AlarmText::toCalendarText(oldtext); if (oldtext != newtext) alarm->setDisplayAlarm(newtext); } @@ -2914,11 +2914,11 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju * It's a KAlarm pre-1.3.0 calendar file. * Convert simple TMPLDEFTIME category to TMPLAFTTIME:n where n = minutes after. */ - QStringList::Iterator it; + TQStringList::Iterator it; while ((it = cats.find(TEMPL_DEF_TIME_CAT)) != cats.end()) { cats.remove(it); - cats.append(QString("%1%2").arg(TEMPL_AFTER_TIME_CATEGORY).arg(0)); + cats.append(TQString("%1%2").arg(TEMPL_AFTER_TIME_CATEGORY).arg(0)); } } @@ -2928,7 +2928,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju * It's a KAlarm pre-1.3.1 calendar file. * Convert simple XTERM category to LOG:xterm: */ - QStringList::Iterator it; + TQStringList::Iterator it; while ((it = cats.find(EXEC_IN_XTERM_CAT)) != cats.end()) { cats.remove(it); @@ -2937,7 +2937,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju } if (addLateCancel) - cats.append(QString("%1%2").arg(LATE_CANCEL_CATEGORY).arg(1)); + cats.append(TQString("%1%2").arg(LATE_CANCEL_CATEGORY).arg(1)); event->setCategories(cats); @@ -2964,11 +2964,11 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju if (!alarm->hasStartOffset()) continue; bool mainAlarm = true; - QString property = alarm->customProperty(APPNAME, TYPE_PROPERTY); - QStringList types = QStringList::split(QChar(','), property); + TQString property = alarm->customProperty(APPNAME, TYPE_PROPERTY); + TQStringList types = TQStringList::split(TQChar(','), property); for (unsigned int i = 0; i < types.count(); ++i) { - QString type = types[i]; + TQString type = types[i]; if (type == AT_LOGIN_TYPE || type == TIME_DEFERRAL_TYPE || type == DATE_DEFERRAL_TYPE @@ -2986,7 +2986,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju nextMainDateTime.setDateOnly(dateOnly); if (nextMainDateTime != startDateTime) { - QDateTime dt = nextMainDateTime.dateTime(); + TQDateTime dt = nextMainDateTime.dateTime(); event->setCustomProperty(APPNAME, NEXT_RECUR_PROPERTY, dt.toString(dateOnly ? "yyyyMMdd" : "yyyyMMddThhmmss")); } @@ -3013,11 +3013,11 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju Alarm* alarm = *alit; if (!alarm->hasStartOffset()) continue; - QString property = alarm->customProperty(APPNAME, TYPE_PROPERTY); - QStringList types = QStringList::split(QChar(','), property); + TQString property = alarm->customProperty(APPNAME, TYPE_PROPERTY); + TQStringList types = TQStringList::split(TQChar(','), property); for (unsigned int i = 0; i < types.count(); ++i) { - QString type = types[i]; + TQString type = types[i]; if (type == TIME_DEFERRAL_TYPE || type == DATE_DEFERRAL_TYPE) { @@ -3039,12 +3039,12 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju for (Alarm::List::ConstIterator alit = alarms.begin(); alit != alarms.end(); ++alit) { Alarm* alarm = *alit; - QString name = alarm->customProperty(APPNAME, KMAIL_ID_PROPERTY); + TQString name = alarm->customProperty(APPNAME, KMAIL_ID_PROPERTY); if (name.isEmpty()) continue; uint id = KAMail::identityUoid(name); if (id) - alarm->setCustomProperty(APPNAME, EMAIL_ID_PROPERTY, QString::number(id)); + alarm->setCustomProperty(APPNAME, EMAIL_ID_PROPERTY, TQString::number(id)); alarm->removeCustomProperty(APPNAME, KMAIL_ID_PROPERTY); } convertRepetition(event); @@ -3299,7 +3299,7 @@ int KAAlarmEventBase::flags() const | (mCommandScript ? KAEvent::SCRIPT : 0); } -const QFont& KAAlarmEventBase::font() const +const TQFont& KAAlarmEventBase::font() const { return mDefaultFont ? Preferences::messageFont() : mFont; } @@ -3365,10 +3365,10 @@ void KAAlarmEventBase::dumpDebug() const * Sets the list of email addresses, removing any empty addresses. * Reply = false if empty addresses were found. */ -EmailAddressList& EmailAddressList::operator=(const QValueList<Person>& addresses) +EmailAddressList& EmailAddressList::operator=(const TQValueList<Person>& addresses) { clear(); - for (QValueList<Person>::ConstIterator it = addresses.begin(); it != addresses.end(); ++it) + for (TQValueList<Person>::ConstIterator it = addresses.begin(); it != addresses.end(); ++it) { if (!(*it).email().isEmpty()) append(*it); @@ -3380,11 +3380,11 @@ EmailAddressList& EmailAddressList::operator=(const QValueList<Person>& addresse * Return the email address list as a string, each address being delimited by * the specified separator string. */ -QString EmailAddressList::join(const QString& separator) const +TQString EmailAddressList::join(const TQString& separator) const { - QString result; + TQString result; bool first = true; - for (QValueList<Person>::ConstIterator it = begin(); it != end(); ++it) + for (TQValueList<Person>::ConstIterator it = begin(); it != end(); ++it) { if (first) first = false; @@ -3392,14 +3392,14 @@ QString EmailAddressList::join(const QString& separator) const result += separator; bool quote = false; - QString name = (*it).name(); + TQString name = (*it).name(); if (!name.isEmpty()) { // Need to enclose the name in quotes if it has any special characters int len = name.length(); for (int i = 0; i < len; ++i) { - QChar ch = name[i]; + TQChar ch = name[i]; if (!ch.isLetterOrNumber()) { quote = true; @@ -3429,17 +3429,17 @@ QString EmailAddressList::join(const QString& separator) const * The command line is first split into its program file and arguments before * initialising the alarm. */ -static void setProcedureAlarm(Alarm* alarm, const QString& commandLine) +static void setProcedureAlarm(Alarm* alarm, const TQString& commandLine) { - QString command = QString::null; - QString arguments = QString::null; - QChar quoteChar; + TQString command = TQString::null; + TQString arguments = TQString::null; + TQChar quoteChar; bool quoted = false; uint posMax = commandLine.length(); uint pos; for (pos = 0; pos < posMax; ++pos) { - QChar ch = commandLine[pos]; + TQChar ch = commandLine[pos]; if (quoted) { if (ch == quoteChar) |