~charlesk/indicator-datetime/rtm-14.09-lp-1410874-alarm-sounds-vs-calendar-sounds

« back to all changes in this revision

Viewing changes to src/engine-eds.cpp

Fix bug that misidentified repeating alarms as one-time alarms, causing them to be disabled after triggering. Fixes: #1411171
Approved by: Rodney Dawes

Show diffs side-by-side

added added

removed removed

Lines of Context:
534
534
        icalcomponent * icc = nullptr;
535
535
        if (e_cal_client_get_object_finish (E_CAL_CLIENT(client), result, &icc, nullptr))
536
536
        {
537
 
            struct icaltimetype itt = icalcomponent_get_recurrenceid(icc);
538
 
            if (icaltime_is_null_time(itt))
 
537
            auto rrule_property = icalcomponent_get_first_property (icc, ICAL_RRULE_PROPERTY); // transfer none
 
538
            auto rdate_property = icalcomponent_get_first_property (icc, ICAL_RDATE_PROPERTY); // transfer none
 
539
            const bool is_nonrepeating = (rrule_property == nullptr) && (rdate_property == nullptr);
 
540
 
 
541
            if (is_nonrepeating)
539
542
            {
540
543
                g_debug("'%s' appears to be a one-time alarm... adding 'disabled' tag.",
541
544
                        icalcomponent_as_ical_string(icc));