-rw-r--r-- | libkcal/icalformatimpl.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index 32a1337..964ffe3 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -1389,13 +1389,13 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre interv = 12; } } if ( r.freq == ICAL_YEARLY_RECURRENCE ) { if ( r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX && r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX ) { frequ = ICAL_MONTHLY_RECURRENCE; - interv = 12; + interv = 12* r.interval; } } switch (frequ) { case ICAL_MINUTELY_RECURRENCE: if (!icaltime_is_null_time(r.until)) { @@ -1496,12 +1496,13 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre recur->addMonthlyDay(day); } } break; case ICAL_YEARLY_RECURRENCE: if (r.by_year_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { + qDebug(" YEARLY DAY OF YEAR"); if (!icaltime_is_null_time(r.until)) { recur->setYearly(Recurrence::rYearlyDay,interv, readICalDate(r.until)); } else { if (r.count == 0) recur->setYearly(Recurrence::rYearlyDay,interv,-1); @@ -1510,12 +1511,13 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre } while((day = r.by_year_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { recur->addYearlyNum(day); } } else if ( true /*r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX*/) { if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { + qDebug("YEARLY POS NOT SUPPORTED BY GUI"); if (!icaltime_is_null_time(r.until)) { recur->setYearly(Recurrence::rYearlyPos,interv, readICalDate(r.until)); } else { if (r.count == 0) recur->setYearly(Recurrence::rYearlyPos,interv,-1); @@ -1540,30 +1542,32 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre if (useSetPos) { if (r.by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX) { recur->addYearlyMonthPos(r.by_set_pos[0],qba); } } } else { + qDebug("YEARLY MONTH "); if (!icaltime_is_null_time(r.until)) { recur->setYearly(Recurrence::rYearlyMonth,interv, readICalDate(r.until)); } else { if (r.count == 0) recur->setYearly(Recurrence::rYearlyMonth,interv,-1); else recur->setYearly(Recurrence::rYearlyMonth,interv,r.count); } - } - 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()); } + } break; default: ; break; } |