Commit 68a022fd authored by David Faure's avatar David Faure
Browse files

korgac: on first run, show alarms from the last 10 days.

This was already the intent, but it was broken, nothing showed up.
"from" was an invalid date, and it was passed as remindAtDate,
so the removed if() was always false.

I don't see what sense it makes to pass the "previous check date" as
remindAtDate anyway, so now I'm passing "now" as date. But that seems
redundant with item->mTrigger....

Anyhow for me this fixes the main bug: reminders show up for a fresh
user (with existing calendars).

Test Plan:
killall korgac; remove the CalendarsLastChecked entry from ~/.config/korgacrc
and restart korgac, the last 10 days of reminders should show up.

Reviewers: winterz

Reviewed By: winterz

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision:
parent 56893b55
......@@ -78,7 +78,7 @@ KOAlarmClient::KOAlarmClient(QObject *parent)
KConfigGroup alarmGroup(KSharedConfig::openConfig(), "Alarms");
const int interval = alarmGroup.readEntry("Interval", 60);
qCDebug(KOALARMCLIENT_LOG) << "KOAlarmClient check interval:" << interval << "seconds.";
mLastChecked = alarmGroup.readEntry("CalendarsLastChecked", QDateTime());
mLastChecked = alarmGroup.readEntry("CalendarsLastChecked", QDateTime::currentDateTime().addDays(-9));
mCheckTimer.start(1000 * interval); // interval in seconds
connect(qApp, &QApplication::commitDataRequest, this, &KOAlarmClient::slotCommitData);
......@@ -225,7 +225,7 @@ void KOAlarmClient::checkAlarms()
const Akonadi::Item::Id id = mCalendar->item(uid).id();
const Akonadi::Item item = mCalendar->item(id);
createReminder(item, from, alarm->text());
createReminder(item, mLastChecked, alarm->text());
......@@ -235,11 +235,6 @@ void KOAlarmClient::createReminder(const Akonadi::Item &aitem, const QDateTime &
if (remindAtDate.addDays(10) < mLastChecked) {
// ignore reminders more than 10 days old
mDialog->addIncidence(aitem, remindAtDate, displayText);
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