Commit e6e12874 authored by Raine Makelainen's avatar Raine Makelainen Committed by Raine Makelainen

[qmf] Initialize messagelistmodel before processing add/remove/update of...

[qmf] Initialize messagelistmodel before processing add/remove/update of messages. Contributes to JB#40471

This also removes duplicate guards of init(). The init() method
guards itself.

Upstream change is here:
https://codereview.qt-project.org/#/c/84555/
parent 8680704f
......@@ -306,10 +306,8 @@ bool QMailMessageListModelPrivate::processMessagesAdded(const QMailMessageIdList
return true;
}
if (!_initialised) {
init();
}
init();
// Find if and where these messages should be added
if (!addMessages(ids)) {
return false;
......@@ -393,14 +391,12 @@ bool QMailMessageListModelPrivate::processMessagesUpdated(const QMailMessageIdLi
return true;
}
init();
// Find if and where these messages should be added/removed/updated
if (!updateMessages(ids)) {
return false;
}
if (!_initialised) {
init();
}
return true;
}
......@@ -519,9 +515,7 @@ bool QMailMessageListModelPrivate::processMessagesRemoved(const QMailMessageIdLi
return true;
}
if (!_initialised) {
init();
}
init();
// Find if and where these messages should be removed from
if (!removeMessages(ids)) {
......
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