diff options
Diffstat (limited to 'src/imports/folderlistmodel/qquickfolderlistmodel.cpp')
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp index 85b59e9c73..4dbbcf359d 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp @@ -55,7 +55,8 @@ class QQuickFolderListModelPrivate public: QQuickFolderListModelPrivate(QQuickFolderListModel *q) : q_ptr(q), - sortField(QQuickFolderListModel::Name), sortReversed(false), showDirs(true), showDirsFirst(false), showDotAndDotDot(false), showOnlyReadable(false) + sortField(QQuickFolderListModel::Name), sortReversed(false), showFiles(true), + showDirs(true), showDirsFirst(false), showDotAndDotDot(false), showOnlyReadable(false) { nameFilters << QLatin1String("*"); } @@ -70,6 +71,7 @@ public: QQuickFolderListModel::SortField sortField; QStringList nameFilters; bool sortReversed; + bool showFiles; bool showDirs; bool showDirsFirst; bool showDotAndDotDot; @@ -619,6 +621,30 @@ bool QQuickFolderListModel::isFolder(int index) const } /*! + \qmlproperty bool FolderListModel::showFiles + + If true, files are included in the model; otherwise only directories + are included. + + By default, this property is true. + + \sa showDirs +*/ +bool QQuickFolderListModel::showFiles() const +{ + Q_D(const QQuickFolderListModel); + return d->showFiles; +} + +void QQuickFolderListModel::setShowFiles(bool on) +{ + Q_D(QQuickFolderListModel); + + d->fileInfoThread.setShowFiles(on); + d->showFiles = on; +} + +/*! \qmlproperty bool FolderListModel::showDirs If true, directories are included in the model; otherwise only files |