Comment 3 for bug 1371341

Revision history for this message
Charles Kerr (charlesk) wrote : Re: after a while recurring alarms stop to work

I think the COUNT=-1 might be introduced in QOrganizerEDSEngine::parseRecurrence() when it populates a struct icalrecurrencetype from a QOrganizerItem.

            if (qRule.limitDate().isValid()) {
                rule->until = icaltime_from_timet(QDateTime(qRule.limitDate()).toTime_t(), TRUE);
                rule->count = ICAL_RECURRENCE_ARRAY_MAX;
            } else {
                rule->count = qRule.limitCount();
            }

Note that last line, where rule->count gets assigned directly from qRule.limitCount().

EDS's e_cal_recur_obtain_enddate() states "If neither COUNT or UNTIL is set, the event recurs forever.", so an icalrecurrencetype.count of 0 implies an unbounded alarm.

QOrganizer's semantics differ: qRule.limitCount() returns ''the count condition specified by the recurrence rule. The default count is -1 (ie. * unlimited)''

So qtorganizer5-eds needs to translate QOrganizer's magic-unlimited-number (-1) to EDS's magic-unlimited-number (0).

NB: the reverse bug also happens in QOrganizerEDSEngine::parseRecurrence():

            if (icaltime_is_date(rule->until)) {
                QDate dt = QDate::fromString(icaltime_as_ical_string(rule->until), "yyyyMMdd");
                if (dt.isValid()) {
                    qRule.setLimit(dt);
                }
            } else {
                qRule.setLimit(rule->count);
            }