Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.6.2
-
None
-
bd786961b0d65bdd1adb31eca0a050a4b9a1f39a
Description
In filelistmodel.cpp line 96, the fetchMore function works out how many "itemsToFetch" and sets the newly inserted rows to have first index "fileCount" and last index "fileCount+itemsToFetch".
If I understand QAbstractItemModel::beginInsertRows correctly, the last index will be "fileCount+itemsToFetch - 1"
void FileListModel::fetchMore(const QModelIndex & /* index */)
{
int remainder = fileList.size() - fileCount;
int itemsToFetch = qMin(100, remainder);
beginInsertRows(QModelIndex(), fileCount, fileCount+itemsToFetch); /// ERROR HERE
fileCount += itemsToFetch;
endInsertRows();
emit numberPopulated(itemsToFetch);
}