/*! Returns true if the \a other recurrence detail is equal to this detail; otherwise, false. Since the data types stored in this detail are custom data types, the base class operator==() doesn't know how to perform the comparison without calling this function. However, it means that if (in the future) a backend were to extend the detail with more fields, this operator== would no longer work; it'd have to be updated to compare the other fields also. */ bool QOrganizerItemRecurrence::operator==(const QOrganizerItemRecurrence &other) const { return recurrenceRules() == other.recurrenceRules() && exceptionRules() == other.exceptionRules() && recurrenceDates() == other.recurrenceDates() && exceptionDates() == other.exceptionDates(); }
/*! Returns a recurrence rule which has been explicitly set for the event. Note: if more than one rule exists, the order of the rules is undefined, so any one could be returned. */ QOrganizerRecurrenceRule QOrganizerEvent::recurrenceRule() const { QSet<QOrganizerRecurrenceRule> rrules = recurrenceRules(); if (!rrules.isEmpty()) return *rrules.begin(); return QOrganizerRecurrenceRule(); }