Commit 1f2234ec authored by Volker Krause's avatar Volker Krause
Browse files

Fix statistics proxy model unit test with Qt6

Qt6 automatically registers comparison operators for meta types, so
QStandardItemModel's value change check in setData() now also works for
Akonadi::Collection. The comparison operator of that however only checks
if two instances refer to the same collection, not whether they are also
identical in all their content.

Work around that by setting a different collection first.
parent 8016f51a
Pipeline #199417 passed with stage
in 11 minutes and 3 seconds
......@@ -223,6 +223,10 @@ void StatisticsProxyModelTest::shouldHandleDataChangedInExtraColumn()
Akonadi::Collection c1(1);
c1.setStatistics(makeStats(3, 5, 8)); // changed: unread, count, size in bytes
// trick QStandardItemModel into noticing something changed here
m_model.item(0, 0)->setData(QVariant::fromValue(Akonadi::Collection()), Akonadi::EntityTreeModel::CollectionRole);
m_model.item(0, 0)->setData(QVariant::fromValue(c1), Akonadi::EntityTreeModel::CollectionRole);
// Then the change should be available and notified
Supports Markdown
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