Commit 9f7b18af authored by Allen Winter's avatar Allen Winter

summaryeventinfo.cpp - fix regression from KDateTime removal

events in the past were being shown, as well as not handling
multiday event startdates properly.
parent 60f6b96f
...@@ -121,7 +121,7 @@ SummaryEventInfo::SummaryEventInfo() ...@@ -121,7 +121,7 @@ SummaryEventInfo::SummaryEventInfo()
SummaryEventInfo::List SummaryEventInfo::eventsForRange(const QDate &start, const QDate &end, SummaryEventInfo::List SummaryEventInfo::eventsForRange(const QDate &start, const QDate &end,
KCalCore::Calendar *calendar) KCalCore::Calendar *calendar)
{ {
KCalCore::Event::List allEvents = calendar->events(); // calendar->rawEvents() isn't exactly what we want, doesn't handle recurrence right KCalCore::Event::List allEvents = calendar->events();
KCalCore::Event::List events; KCalCore::Event::List events;
const auto currentDateTime = QDateTime::currentDateTime(); const auto currentDateTime = QDateTime::currentDateTime();
const QDate currentDate = currentDateTime.date(); const QDate currentDate = currentDateTime.date();
...@@ -146,7 +146,7 @@ SummaryEventInfo::List SummaryEventInfo::eventsForRange(const QDate &start, cons ...@@ -146,7 +146,7 @@ SummaryEventInfo::List SummaryEventInfo::eventsForRange(const QDate &start, cons
if ((end >= eventStart.date() && start <= eventEnd.date()) || if ((end >= eventStart.date() && start <= eventEnd.date()) ||
(start >= eventStart.date() && end <= eventEnd.date())) { (start >= eventStart.date() && end <= eventEnd.date())) {
events << event; events << event;
if (eventStart.date() > start) { if (eventStart.date() < start) {
sDateTimeByUid()->insert(event->instanceIdentifier(), QDateTime(start)); sDateTimeByUid()->insert(event->instanceIdentifier(), QDateTime(start));
} else { } else {
sDateTimeByUid()->insert(event->instanceIdentifier(), eventStart); sDateTimeByUid()->insert(event->instanceIdentifier(), eventStart);
......
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