Commit 64ed63fc authored by Glen Ditchfield's avatar Glen Ditchfield 🐛

Revert merge request 14

MR 14 seems to have a side effect that causes dissociated occurrences to
be displayed twice when KOrganizer starts up in the Agenda view.
parent e24f5e61
Pipeline #46702 passed with stage
in 8 minutes and 4 seconds
......@@ -409,18 +409,14 @@ void AgendaView::Private::calendarIncidenceAdded(const KCalendarCore::Incidence:
return;
}
if (incidence->hasRecurrenceId()) {
if (incidence->hasRecurrenceId() && mViewCalendar->isValid(incidence)) {
// Reevaluate the main event instead, if it was inserted before this one
auto mainIncidence = q->calendar2(incidence)->incidence(incidence->uid());
KCalendarCore::Incidence::Ptr mainIncidence
= q->calendar2(incidence)->incidence(incidence->uid());
if (mainIncidence) {
reevaluateIncidence(mainIncidence);
return;
}
qCCritical(CALENDARVIEW_LOG) << "Failed to find main incidence of recurring incidence with uid=" << incidence->uid() << "trying to display this recurrence instead";
}
if (q->displayIncidence(incidence, false)) {
} else if (q->displayIncidence(incidence, false)) {
mAgenda->checkScrollBoundaries();
q->scheduleUpdateEventIndicators();
}
......@@ -1762,9 +1758,6 @@ void AgendaView::fillAgenda()
for (const KCalendarCore::Incidence::Ptr &incidence : incidences) {
Q_ASSERT(incidence);
if (incidence->hasRecurrenceId())
continue;
const bool wasSelected = (incidence->uid() == selectedAgendaId)
|| (incidence->uid() == selectedAllDayAgendaId);
......@@ -1797,7 +1790,7 @@ void AgendaView::fillAgenda()
bool AgendaView::displayIncidence(const KCalendarCore::Incidence::Ptr &incidence, bool createSelected)
{
if (!incidence) {
if (!incidence || incidence->hasRecurrenceId()) {
return false;
}
......
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