diff --git a/src/calendar.cpp b/src/calendar.cpp index f81ba1783ca8a214c7f9733ee4554ecb45363a2c..c8702d8c7cece092b6c11b9e21d666aa54ac8919 100644 --- a/src/calendar.cpp +++ b/src/calendar.cpp @@ -1366,6 +1366,11 @@ bool Calendar::deletionTracking() const return d->mDeletionTracking; } +Alarm::List Calendar::alarmsTo(const QDateTime &to) const +{ + return alarms(QDateTime(QDate(1900, 1, 1), QTime(0, 0, 0)), to); +} + void Calendar::virtual_hook(int id, void *data) { Q_UNUSED(id); diff --git a/src/calendar.h b/src/calendar.h index 2c010d6fde0f11403f4d42d9800895c334076c9f..064d0d47cbe4e69ecda40ad9a65cdfa9a7770342 100644 --- a/src/calendar.h +++ b/src/calendar.h @@ -1197,6 +1197,16 @@ public: */ virtual Alarm::List alarms(const QDateTime &from, const QDateTime &to, bool excludeBlockedAlarms = false) const = 0; + /** + Return a list of Alarms that occur before the specified timestamp. + + @param to is the ending timestamp. + @return the list of Alarms occurring before the specified QDateTime. + @since 5.77 + */ + Q_REQUIRED_RESULT Alarm::List alarmsTo(const QDateTime &to) const; + + // Observer Specific Methods // /** diff --git a/src/memorycalendar.h b/src/memorycalendar.h index 539e25ea08b77b0128bd5734be4415bd5d457ad9..0fc128aac6782fceee874cf7e70dd1289fe678af 100644 --- a/src/memorycalendar.h +++ b/src/memorycalendar.h @@ -291,7 +291,7 @@ public: @param to is the ending timestamp. @return the list of Alarms occurring before the specified QDateTime. */ - Q_REQUIRED_RESULT Alarm::List alarmsTo(const QDateTime &to) const; + Q_REQUIRED_RESULT Alarm::List alarmsTo(const QDateTime &to) const; // TODO KF6 remove, already defined in Calendar /** @copydoc Calendar::incidenceUpdate(const QString &,const QDateTime &)