Skip to content

Commit

Permalink
[nemo-qml-plugin-calendar] Avoid 100% cpu with agendamodel without st…
Browse files Browse the repository at this point in the history
…art date. Contributes to JB#42283
  • Loading branch information
pvuorela committed Aug 3, 2018
1 parent 9933ea8 commit f0cda01
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/calendarmanager.cpp
Expand Up @@ -417,6 +417,13 @@ void NemoCalendarManager::doAgendaAndQueryRefresh()
NemoCalendarData::Range range;
range.first = model->startDate();
range.second = agenda_endDate(model);

if (!range.first.isValid()) {
// need start date for fetching events, clear this model
model->doRefresh(QList<NemoCalendarEventOccurrence*>());
continue;
}

QList<NemoCalendarData::Range> newRanges;
if (isRangeLoaded(range, &newRanges))
updateAgendaModel(model);
Expand Down

0 comments on commit f0cda01

Please sign in to comment.