diff options
author | Doris Verria <doris.verria@qt.io> | 2020-10-13 11:30:32 +0200 |
---|---|---|
committer | Doris Verria <doris.verria@qt.io> | 2020-10-14 21:43:49 +0200 |
commit | 61dee37d667e083fd2979ecc166efbc1bfcaf0e7 (patch) | |
tree | 6f2c2ef5ad845c4a63f959205341a3088b03e434 | |
parent | b84852670da604d32fe7cf222f0a82c28fd29c53 (diff) |
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>
-rw-r--r-- | src/gui/itemmodels/qfilesystemmodel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/itemmodels/qfilesystemmodel.cpp b/src/gui/itemmodels/qfilesystemmodel.cpp index 481f11162a..bb9a5a1d43 100644 --- a/src/gui/itemmodels/qfilesystemmodel.cpp +++ b/src/gui/itemmodels/qfilesystemmodel.cpp @@ -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); } |