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-15 16:44:41 +0200 |
commit | 52a7f472b06916e4f4d4f00a9ed0aede9a3e6816 (patch) | |
tree | a239b86cf82ae650646d441f77ca55e162353872 | |
parent | 7a2b97fc4765ed17c494b39fe4fbc2297f0c602b (diff) |
Return false from canFetchMore for uninitialized QFileSystem models
Task-number: QTBUG-87273
Change-Id: I1787e3dd26ec10cf161d8fa4e329972b6dd4aa6c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 61dee37d667e083fd2979ecc166efbc1bfcaf0e7)
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 4644f0f04e..0db06e9b71 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -644,6 +644,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); } |