Commit 1b5dc8b4 authored by Nicolas Fella's avatar Nicolas Fella

Add alarmsTo convenience method to Calendar

It exists only in MemoryCalendar but is generic enough to be in Calendar
instead. We cannot move it because of binary compatibility, but we can
copy it and remove the old one in KF6.
parent 42b7dfd1
...@@ -1366,6 +1366,11 @@ bool Calendar::deletionTracking() const ...@@ -1366,6 +1366,11 @@ bool Calendar::deletionTracking() const
return d->mDeletionTracking; 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) void Calendar::virtual_hook(int id, void *data)
{ {
Q_UNUSED(id); Q_UNUSED(id);
......
...@@ -1197,6 +1197,16 @@ public: ...@@ -1197,6 +1197,16 @@ public:
*/ */
virtual Alarm::List alarms(const QDateTime &from, const QDateTime &to, bool excludeBlockedAlarms = false) const = 0; 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 // // Observer Specific Methods //
/** /**
......
...@@ -291,7 +291,7 @@ public: ...@@ -291,7 +291,7 @@ public:
@param to is the ending timestamp. @param to is the ending timestamp.
@return the list of Alarms occurring before the specified QDateTime. @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 &) @copydoc Calendar::incidenceUpdate(const QString &,const QDateTime &)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment