Navigation Menu

Skip to content

Commit

Permalink
[qmf] Initialize messagelistmodel before processing add/remove/update…
Browse files Browse the repository at this point in the history
… 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/
  • Loading branch information
Raine Makelainen authored and rainemak committed Dec 29, 2017
1 parent 8680704 commit e6e1287
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions qmf/src/libraries/qmfclient/qmailmessagelistmodel.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit e6e1287

Please sign in to comment.