Workaround for broken fetchMore() with reuseItems

This commit is contained in:
Nicolas Werner 2021-09-15 23:38:01 +02:00
parent 30aedd36a1
commit 5bff9df4ae
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -717,6 +717,10 @@ TimelineModel::data(const QModelIndex &index, int role) const
if (index.row() < 0 && index.row() >= rowCount())
return QVariant();
// HACK(Nico): fetchMore likes to break with dynamically sized delegates and reuseItems
if (index.row() + 1 == rowCount() && !m_paginationInProgress)
const_cast<TimelineModel *>(this)->fetchMore(index);
auto event = events.get(rowCount() - index.row() - 1);
if (!event)