Commit 2ecc0809 authored by David Jarvie's avatar David Jarvie
Browse files

Add alternative adjustStartOfDay() signature

parent 5df287c4
Pipeline #27706 passed with stage
in 9 minutes and 39 seconds
......@@ -2440,8 +2440,16 @@ void KAEvent::setStartOfDay(const QTime &startOfDay)
*/
void KAEvent::adjustStartOfDay(const KAEvent::List &events)
{
for (KAEvent *event : events) {
KAEventPrivate *const p = event->d;
QVector<KAEvent> list;
for (KAEvent* event : events)
list += *event;
return adjustStartOfDay(list);
}
void KAEvent::adjustStartOfDay(QVector<KAEvent> &events)
{
for (auto it = events.begin(); it != events.end(); ++it) {
KAEventPrivate *const p = (*it).d;
if (p->mStartDateTime.isDateOnly() && p->checkRecur() != KARecurrence::NO_RECUR) {
p->mRecurrence->setStartDateTime(p->mStartDateTime.effectiveKDateTime(), true);
}
......
......@@ -923,6 +923,14 @@ public:
*/
static void adjustStartOfDay(const KAEvent::List &events);
/** Call when the user changes the start-of-day time, to adjust the data
* for each date-only event in a list.
* @param events list of events. Any date-time events in the list are ignored.
* @see setStartOfDay()
* @since 20.08
*/
static void adjustStartOfDay(QVector<KAEvent> &events);
/** Return the next time the alarm will trigger.
* @param type specifies whether to ignore reminders, working time
* restrictions, etc.
......
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