-rw-r--r-- | libkcal/icalformatimpl.cpp | 20 | ||||
-rw-r--r-- | libkcal/recurrence.cpp | 17 | ||||
-rw-r--r-- | libkcal/recurrence.h | 6 |
3 files changed, 30 insertions, 13 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index 32a1337..964ffe3 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -1394,3 +1394,3 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre frequ = ICAL_MONTHLY_RECURRENCE; - interv = 12; + interv = 12* r.interval; } @@ -1501,2 +1501,3 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre if (r.by_year_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { + qDebug(" YEARLY DAY OF YEAR"); if (!icaltime_is_null_time(r.until)) { @@ -1515,2 +1516,3 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { + qDebug("YEARLY POS NOT SUPPORTED BY GUI"); if (!icaltime_is_null_time(r.until)) { @@ -1545,2 +1547,3 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre } else { + qDebug("YEARLY MONTH "); if (!icaltime_is_null_time(r.until)) { @@ -1554,11 +1557,12 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre } - } - if ( r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX ) { - index = 0; - while((day = r.by_month[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { - recur->addYearlyNum(day); + if ( r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX ) { + index = 0; + while((day = r.by_month[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { + recur->addYearlyNum(day); + } + } else { + recur->addYearlyNum(incidence->dtStart().date().month()); } - } else { - recur->addYearlyNum(incidence->dtStart().date().month()); } + } diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp index 5fc5d1f..dd74e10 100644 --- a/libkcal/recurrence.cpp +++ b/libkcal/recurrence.cpp @@ -656,3 +656,3 @@ void Recurrence::addMonthlyDay(short _rDay) { - if (mRecurReadOnly || recurs != rMonthlyDay + if (mRecurReadOnly || (recurs != rMonthlyDay && recurs != rYearlyMonth) || _rDay == 0 || _rDay > 31 || _rDay < -31) // invalid day number @@ -727,3 +727,16 @@ const QPtrList<int> &Recurrence::yearNums() const } - +void Recurrence::addYearlyMonth(short _rPos ) +{ + if (mRecurReadOnly || recurs != rYearlyMonth) // invalid day/month number + return; + rMonthPos *tmpPos = new rMonthPos; + if ( _rPos > 0) { + tmpPos->rPos = _rPos; + tmpPos->negative = false; + } else { + tmpPos->rPos = -_rPos; // take abs() + tmpPos->negative = true; + } + rMonthPositions.append(tmpPos); +} void Recurrence::addYearlyNum(short _rNum) diff --git a/libkcal/recurrence.h b/libkcal/recurrence.h index a0f6d84..b13d14f 100644 --- a/libkcal/recurrence.h +++ b/libkcal/recurrence.h @@ -290,3 +290,3 @@ class Recurrence static Feb29Type setFeb29YearlyTypeDefault() { return mFeb29YearlyDefaultType; } - + void addYearlyMonth(short _rPos ); // added LR /** @@ -296,2 +296,4 @@ class Recurrence QString recurrenceText() const; + bool getYearlyMonthMonths(int day, QValueList<int>&, + QValueList<int> &leaplist) const; @@ -348,4 +350,2 @@ class Recurrence bool getMonthlyDayDays(QValueList<int>&, int daysInMonth) const; - bool getYearlyMonthMonths(int day, QValueList<int>&, - QValueList<int> &leaplist) const; |