Return false from canFetchMore for uninitialized QFileSystem models

Task-number: QTBUG-87273
Pick-to: 5.15
Change-Id: I1787e3dd26ec10cf161d8fa4e329972b6dd4aa6c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Doris Verria 2020-10-13 11:30:32 +02:00
parent b84852670d
commit 61dee37d66
1 changed files with 2 additions and 0 deletions

View File

@ -638,6 +638,8 @@ bool QFileSystemModel::hasChildren(const QModelIndex &parent) const
bool QFileSystemModel::canFetchMore(const QModelIndex &parent) const
{
Q_D(const QFileSystemModel);
if (!d->setRootPath)
return false;
const QFileSystemModelPrivate::QFileSystemNode *indexNode = d->node(parent);
return (!indexNode->populatedChildren);
}