Skip to content
Snippets Groups Projects
Commit 1777a1b5 authored by Loren Burkholder's avatar Loren Burkholder
Browse files

Reset model instead of doing weird convoluted updates

parent 5d38b96b
No related branches found
No related tags found
No related merge requests found
......@@ -76,9 +76,7 @@ void
ReadReceiptsModel::addUsers(
const std::multimap<uint64_t, std::string, std::greater<uint64_t>> &users)
{
auto oldLen = readReceipts_.length();
beginInsertRows(QModelIndex{}, oldLen, users.size() - 1);
beginResetModel();
readReceipts_.clear();
for (const auto &user : users) {
......@@ -92,9 +90,7 @@ ReadReceiptsModel::addUsers(
return a.second > b.second;
});
endInsertRows();
emit dataChanged(index(0), index(oldLen - 1));
endResetModel();
}
QString
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment