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 --- kalarm/karecurrence.cpp | 100 ++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'kalarm/karecurrence.cpp') diff --git a/kalarm/karecurrence.cpp b/kalarm/karecurrence.cpp index 9461d71e..8b7e9068 100644 --- a/kalarm/karecurrence.cpp +++ b/kalarm/karecurrence.cpp @@ -20,7 +20,7 @@ #include "kalarm.h" -#include +#include #include #include @@ -57,7 +57,7 @@ KARecurrence::Feb29Type KARecurrence::mDefaultFeb29 = KARecurrence::FEB29_FEB29; * Only a restricted subset of recurrence types is allowed. * Reply = true if successful. */ -bool KARecurrence::set(Type recurType, int freq, int count, int f29, const DateTime& start, const QDateTime& end) +bool KARecurrence::set(Type recurType, int freq, int count, int f29, const DateTime& start, const TQDateTime& end) { mCachedType = -1; RecurrenceRule::PeriodType rrtype; @@ -78,7 +78,7 @@ bool KARecurrence::set(Type recurType, int freq, int count, int f29, const DateT { case WEEKLY: { - QBitArray days(7); + TQBitArray days(7); days.setBit(start.date().dayOfWeek() - 1); addWeeklyDays(days); break; @@ -101,7 +101,7 @@ bool KARecurrence::set(Type recurType, int freq, int count, int f29, const DateT * Reply = true if successful. */ bool KARecurrence::init(RecurrenceRule::PeriodType recurType, int freq, int count, int f29, const DateTime& start, - const QDateTime& end) + const TQDateTime& end) { mCachedType = -1; Feb29Type feb29Type = (f29 == -1) ? mDefaultFeb29 : static_cast(f29); @@ -133,12 +133,12 @@ bool KARecurrence::init(RecurrenceRule::PeriodType recurType, int freq, int coun setEndDate(end.date()); else setEndDateTime(end); - QDateTime startdt = start.dateTime(); + TQDateTime startdt = start.dateTime(); if (recurType == RecurrenceRule::rYearly && feb29Type == FEB29_FEB28 || feb29Type == FEB29_MAR1) { int year = startdt.date().year(); - if (!QDate::leapYear(year) + if (!TQDate::leapYear(year) && startdt.date().dayOfYear() == (feb29Type == FEB29_MAR1 ? 60 : 59)) { /* The event start date is February 28th or March 1st, but it @@ -148,8 +148,8 @@ bool KARecurrence::init(RecurrenceRule::PeriodType recurType, int freq, int coun * This is necessary because KARecurrence represents all types * of 29th February recurrences by a simple 29th February. */ - while (!QDate::leapYear(--year)) ; - startdt.setDate(QDate(year, 2, 29)); + while (!TQDate::leapYear(--year)) ; + startdt.setDate(TQDate(year, 2, 29)); } mFeb29Type = feb29Type; } @@ -163,9 +163,9 @@ bool KARecurrence::init(RecurrenceRule::PeriodType recurType, int freq, int coun /****************************************************************************** * Initialise the recurrence from an iCalendar RRULE string. */ -bool KARecurrence::set(const QString& icalRRULE) +bool KARecurrence::set(const TQString& icalRRULE) { - static QString RRULE = QString::fromLatin1("RRULE:"); + static TQString RRULE = TQString::fromLatin1("RRULE:"); mCachedType = -1; clear(); if (icalRRULE.isEmpty()) @@ -237,7 +237,7 @@ void KARecurrence::fix() || rrule->startDt() != rrules[0]->startDt()) break; } - QValueList ds = rrule->byYearDays(); + TQValueList ds = rrule->byYearDays(); if (!ds.isEmpty() && ds.first() == 60) { ++convert; // this rule needs to be converted @@ -249,7 +249,7 @@ void KARecurrence::fix() } case rYearlyMonth: { - QValueList ds = rrule->byMonthDays(); + TQValueList ds = rrule->byMonthDays(); if (!ds.isEmpty()) { int day = ds.first(); @@ -271,7 +271,7 @@ void KARecurrence::fix() if (day == -1) { // Last day of the month - only combine if it's February - QValueList months = rrule->byMonths(); + TQValueList months = rrule->byMonths(); if (months.count() != 1 || months.first() != 2) day = 0; } @@ -301,9 +301,9 @@ void KARecurrence::fix() delete *rr; } - QDate end; + TQDate end; int count; - QValueList months; + TQValueList months; if (convert == 2) { // There are two yearly recurrence rules to combine into a February 29th recurrence. @@ -344,7 +344,7 @@ void KARecurrence::fix() RecurrenceRule* rrule = defaultRRule(); months.append(2); rrule->setByMonths(months); - QValueList ds; + TQValueList ds; ds.append(29); rrule->setByMonthDays(ds); if (count) @@ -356,7 +356,7 @@ void KARecurrence::fix() /****************************************************************************** * Get the next time the recurrence occurs, strictly after a specified time. */ -QDateTime KARecurrence::getNextDateTime(const QDateTime& preDateTime) const +TQDateTime KARecurrence::getNextDateTime(const TQDateTime& preDateTime) const { switch (type()) { @@ -375,7 +375,7 @@ QDateTime KARecurrence::getNextDateTime(const QDateTime& preDateTime) const /****************************************************************************** * Get the previous time the recurrence occurred, strictly before a specified time. */ -QDateTime KARecurrence::getPreviousDateTime(const QDateTime& afterDateTime) const +TQDateTime KARecurrence::getPreviousDateTime(const TQDateTime& afterDateTime) const { switch (type()) { @@ -430,8 +430,8 @@ void KARecurrence::writeRecurrence(KCal::Recurrence& recur) const break; case ANNUAL_DATE: { - QValueList months = rrule->byMonths(); - QValueList days = monthDays(); + TQValueList months = rrule->byMonths(); + TQValueList days = monthDays(); bool special = (mFeb29Type != FEB29_FEB29 && !days.isEmpty() && days.first() == 29 && months.remove(2)); RecurrenceRule* rrule1 = recur.defaultRRule(); @@ -451,16 +451,16 @@ void KARecurrence::writeRecurrence(KCal::Recurrence& recur) const rrule2->setEndDt(endDateTime()); if (mFeb29Type == FEB29_MAR1) { - QValueList ds; + TQValueList ds; ds.append(60); rrule2->setByYearDays(ds); } else { - QValueList ds; + TQValueList ds; ds.append(-1); rrule2->setByMonthDays(ds); - QValueList ms; + TQValueList ms; ms.append(2); rrule2->setByMonths(ms); } @@ -492,7 +492,7 @@ void KARecurrence::writeRecurrence(KCal::Recurrence& recur) const * all. In that case, retain it so that the February 29th characteristic * is not lost should the user later change the recurrence count. */ - QDateTime end = endDateTime(); + TQDateTime end = endDateTime(); kdDebug()<<"29th recurrence: count="<