Commit 314b49b2 authored by pvuorela's avatar pvuorela

Merge branch 'fix_event_query_crash' into 'master'

[nemo-qml-plugin-calendar] Fix invalid pointer reference on event query. Fixes JB#52691

See merge request !74
parents dc9e9962 1002b506
......@@ -46,13 +46,11 @@ CalendarEventQuery::CalendarEventQuery()
connect(CalendarManager::instance(), SIGNAL(eventUidChanged(QString,QString)),
this, SLOT(eventUidChanged(QString,QString)));
CalendarManager::instance()->registerEventQuery(this);
}
CalendarEventQuery::~CalendarEventQuery()
{
CalendarManager::instance()->unRegisterEventQuery(this);
CalendarManager::instance()->cancelEventQueryRefresh(this);
}
// The uid of the matched event
......
......@@ -256,16 +256,6 @@ void CalendarManager::scheduleAgendaRefresh(CalendarAgendaModel *model)
mTimer->start();
}
void CalendarManager::registerEventQuery(CalendarEventQuery *query)
{
mQueryList.append(query);
}
void CalendarManager::unRegisterEventQuery(CalendarEventQuery *query)
{
mQueryList.removeOne(query);
}
void CalendarManager::scheduleEventQueryRefresh(CalendarEventQuery *query)
{
if (mQueryRefreshList.contains(query))
......@@ -277,6 +267,11 @@ void CalendarManager::scheduleEventQueryRefresh(CalendarEventQuery *query)
mTimer->start();
}
void CalendarManager::cancelEventQueryRefresh(CalendarEventQuery *query)
{
mQueryRefreshList.removeOne(query);
}
static QDate agenda_endDate(const CalendarAgendaModel *model)
{
QDate endDate = model->endDate();
......
......@@ -96,9 +96,8 @@ public:
void scheduleAgendaRefresh(CalendarAgendaModel *model);
// EventQuery
void registerEventQuery(CalendarEventQuery *query);
void unRegisterEventQuery(CalendarEventQuery *query);
void scheduleEventQueryRefresh(CalendarEventQuery *query);
void cancelEventQueryRefresh(CalendarEventQuery *query);
// Invitation event search
void scheduleInvitationQuery(CalendarInvitationQuery *query, const QString &invitationFile);
......@@ -158,7 +157,6 @@ private:
QHash<QDate, QStringList> mEventOccurrenceForDates;
QList<CalendarAgendaModel *> mAgendaRefreshList;
QList<CalendarEventQuery *> mQueryRefreshList;
QList<CalendarEventQuery *> mQueryList; // List of all CalendarEventQuery instances
QHash<CalendarInvitationQuery *, QString> mInvitationQueryHash; // value is the invitationFile.
QStringList mExcludedNotebooks;
QHash<QString, CalendarData::Notebook> mNotebooks;
......
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