Changeset View
Changeset View
Standalone View
Standalone View
src/recurrencerule.cpp
Show All 24 Lines | |||||
25 | #include "recurrencehelper_p.h" | 25 | #include "recurrencehelper_p.h" | ||
26 | 26 | | |||
27 | #include <QDataStream> | 27 | #include <QDataStream> | ||
28 | #include <QStringList> | 28 | #include <QStringList> | ||
29 | #include <QTime> | 29 | #include <QTime> | ||
30 | #include <QTimeZone> | 30 | #include <QTimeZone> | ||
31 | #include <QVector> | 31 | #include <QVector> | ||
32 | 32 | | |||
33 | using namespace KCalCore; | 33 | using namespace KCalendarCore; | ||
34 | 34 | | |||
35 | // Maximum number of intervals to process | 35 | // Maximum number of intervals to process | ||
36 | const int LOOP_LIMIT = 10000; | 36 | const int LOOP_LIMIT = 10000; | ||
37 | 37 | | |||
38 | #ifndef NDEBUG | 38 | #ifndef NDEBUG | ||
39 | static QString dumpTime(const QDateTime &dt, bool allDay); // for debugging | 39 | static QString dumpTime(const QDateTime &dt, bool allDay); // for debugging | ||
40 | #endif | 40 | #endif | ||
41 | 41 | | |||
▲ Show 20 Lines • Show All 654 Lines • ▼ Show 20 Line(s) | |||||
696 | } | 696 | } | ||
697 | //@endcond | 697 | //@endcond | ||
698 | 698 | | |||
699 | /************************************************************************** | 699 | /************************************************************************** | ||
700 | * RecurrenceRule::Private * | 700 | * RecurrenceRule::Private * | ||
701 | **************************************************************************/ | 701 | **************************************************************************/ | ||
702 | 702 | | |||
703 | //@cond PRIVATE | 703 | //@cond PRIVATE | ||
704 | class Q_DECL_HIDDEN KCalCore::RecurrenceRule::Private | 704 | class Q_DECL_HIDDEN KCalendarCore::RecurrenceRule::Private | ||
705 | { | 705 | { | ||
706 | public: | 706 | public: | ||
707 | Private(RecurrenceRule *parent) | 707 | Private(RecurrenceRule *parent) | ||
708 | : mParent(parent), | 708 | : mParent(parent), | ||
709 | mPeriod(rNone), | 709 | mPeriod(rNone), | ||
710 | mFrequency(0), | 710 | mFrequency(0), | ||
711 | mDuration(-1), | 711 | mDuration(-1), | ||
712 | mWeekStart(1), | 712 | mWeekStart(1), | ||
▲ Show 20 Lines • Show All 1559 Lines • ▼ Show 20 Line(s) | 2271 | { | |||
2272 | bool secondOccurrence; // no longer used | 2272 | bool secondOccurrence; // no longer used | ||
2273 | in >> c.year >> c.month >> c.day >> c.hour >> c.minute >> c.second | 2273 | in >> c.year >> c.month >> c.day >> c.hour >> c.minute >> c.second | ||
2274 | >> c.weekday >> c.weekdaynr >> c.weeknumber >> c.yearday >> c.weekstart; | 2274 | >> c.weekday >> c.weekdaynr >> c.weeknumber >> c.yearday >> c.weekstart; | ||
2275 | deserializeSpecAsQTimeZone(in, c.timeZone); | 2275 | deserializeSpecAsQTimeZone(in, c.timeZone); | ||
2276 | in >> secondOccurrence; | 2276 | in >> secondOccurrence; | ||
2277 | return in; | 2277 | return in; | ||
2278 | } | 2278 | } | ||
2279 | 2279 | | |||
2280 | KCALCORE_EXPORT QDataStream &KCalCore::operator<<(QDataStream &out, const KCalCore::RecurrenceRule::WDayPos &w) | 2280 | KCALCORE_EXPORT QDataStream &KCalendarCore::operator<<(QDataStream &out, const KCalendarCore::RecurrenceRule::WDayPos &w) | ||
2281 | { | 2281 | { | ||
2282 | out << w.mDay << w.mPos; | 2282 | out << w.mDay << w.mPos; | ||
2283 | return out; | 2283 | return out; | ||
2284 | } | 2284 | } | ||
2285 | 2285 | | |||
2286 | KCALCORE_EXPORT QDataStream &KCalCore::operator>>(QDataStream &in, KCalCore::RecurrenceRule::WDayPos &w) | 2286 | KCALCORE_EXPORT QDataStream &KCalendarCore::operator>>(QDataStream &in, KCalendarCore::RecurrenceRule::WDayPos &w) | ||
2287 | { | 2287 | { | ||
2288 | in >> w.mDay >> w.mPos; | 2288 | in >> w.mDay >> w.mPos; | ||
2289 | return in; | 2289 | return in; | ||
2290 | } | 2290 | } | ||
2291 | 2291 | | |||
2292 | KCALCORE_EXPORT QDataStream &KCalCore::operator<<(QDataStream &out, const KCalCore::RecurrenceRule *r) | 2292 | KCALCORE_EXPORT QDataStream &KCalendarCore::operator<<(QDataStream &out, const KCalendarCore::RecurrenceRule *r) | ||
2293 | { | 2293 | { | ||
2294 | if (!r) { | 2294 | if (!r) { | ||
2295 | return out; | 2295 | return out; | ||
2296 | } | 2296 | } | ||
2297 | 2297 | | |||
2298 | RecurrenceRule::Private *d = r->d; | 2298 | RecurrenceRule::Private *d = r->d; | ||
2299 | out << d->mRRule << static_cast<quint32>(d->mPeriod); | 2299 | out << d->mRRule << static_cast<quint32>(d->mPeriod); | ||
2300 | serializeQDateTimeAsKDateTime(out, d->mDateStart); | 2300 | serializeQDateTimeAsKDateTime(out, d->mDateStart); | ||
2301 | out << d->mFrequency << d->mDuration; | 2301 | out << d->mFrequency << d->mDuration; | ||
2302 | serializeQDateTimeAsKDateTime(out, d->mDateEnd); | 2302 | serializeQDateTimeAsKDateTime(out, d->mDateEnd); | ||
2303 | out << d->mBySeconds << d->mByMinutes << d->mByHours << d->mByDays << d->mByMonthDays | 2303 | out << d->mBySeconds << d->mByMinutes << d->mByHours << d->mByDays << d->mByMonthDays | ||
2304 | << d->mByYearDays << d->mByWeekNumbers << d->mByMonths << d->mBySetPos | 2304 | << d->mByYearDays << d->mByWeekNumbers << d->mByMonths << d->mBySetPos | ||
2305 | << d->mWeekStart << d->mConstraints << d->mAllDay << d->mNoByRules << d->mTimedRepetition | 2305 | << d->mWeekStart << d->mConstraints << d->mAllDay << d->mNoByRules << d->mTimedRepetition | ||
2306 | << d->mIsReadOnly; | 2306 | << d->mIsReadOnly; | ||
2307 | 2307 | | |||
2308 | return out; | 2308 | return out; | ||
2309 | } | 2309 | } | ||
2310 | 2310 | | |||
2311 | KCALCORE_EXPORT QDataStream &KCalCore::operator>>(QDataStream &in, const KCalCore::RecurrenceRule *r) | 2311 | KCALCORE_EXPORT QDataStream &KCalendarCore::operator>>(QDataStream &in, const KCalendarCore::RecurrenceRule *r) | ||
2312 | { | 2312 | { | ||
2313 | if (!r) { | 2313 | if (!r) { | ||
2314 | return in; | 2314 | return in; | ||
2315 | } | 2315 | } | ||
2316 | 2316 | | |||
2317 | RecurrenceRule::Private *d = r->d; | 2317 | RecurrenceRule::Private *d = r->d; | ||
2318 | quint32 period; | 2318 | quint32 period; | ||
2319 | in >> d->mRRule >> period; | 2319 | in >> d->mRRule >> period; | ||
Show All 12 Lines |