Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'fix_agendamodel_busyloop' into 'master'
Avoid 100% cpu with agendamodel without start date

See merge request mer-core/nemo-qml-plugin-calendar!25
  • Loading branch information
pvuorela committed Aug 9, 2018
2 parents 9933ea8 + f0cda01 commit f67d819
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 f67d819

Please sign in to comment.