diff options
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.cpp | 38 | ||||
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.h | 2 |
2 files changed, 14 insertions, 26 deletions
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp index 3c00a76cc5..affb1e9fe2 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp @@ -51,17 +51,7 @@ class QQuickFolderListModelPrivate Q_DECLARE_PUBLIC(QQuickFolderListModel) public: - QQuickFolderListModelPrivate(QQuickFolderListModel *q) - : q_ptr(q), - sortField(QQuickFolderListModel::Name), sortReversed(false), showFiles(true), - showDirs(true), showDirsFirst(false), showDotAndDotDot(false), showOnlyReadable(false), - showHidden(false), caseSensitive(true), sortCaseSensitive(true), - status(QQuickFolderListModel::Null) - - { - nameFilters << QLatin1String("*"); - } - + QQuickFolderListModelPrivate(QQuickFolderListModel *q) : q_ptr(q) { } QQuickFolderListModel *q_ptr; QUrl currentDir; @@ -69,18 +59,18 @@ public: FileInfoThread fileInfoThread; QList<FileProperty> data; QHash<int, QByteArray> roleNames; - QQuickFolderListModel::SortField sortField; - QStringList nameFilters; - bool sortReversed; - bool showFiles; - bool showDirs; - bool showDirsFirst; - bool showDotAndDotDot; - bool showOnlyReadable; - bool showHidden; - bool caseSensitive; - bool sortCaseSensitive; - QQuickFolderListModel::Status status; + QQuickFolderListModel::SortField sortField = QQuickFolderListModel::Name; + QStringList nameFilters = { QLatin1String("*") }; + QQuickFolderListModel::Status status = QQuickFolderListModel::Null; + bool sortReversed = false; + bool showFiles = true; + bool showDirs = true; + bool showDirsFirst = false; + bool showDotAndDotDot = false; + bool showOnlyReadable = false; + bool showHidden = false; + bool caseSensitive = true; + bool sortCaseSensitive = true; ~QQuickFolderListModelPrivate() {} void init(); @@ -135,8 +125,6 @@ void QQuickFolderListModelPrivate::updateSorting() case QQuickFolderListModel::Type: flags |= QDir::Type; break; - default: - break; } emit q->layoutAboutToBeChanged(); diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h index cc03ff441b..d93e7daf3f 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.h +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h @@ -81,7 +81,7 @@ class QQuickFolderListModel : public QAbstractListModel, public QQmlParserStatus //![abslistmodel] public: - QQuickFolderListModel(QObject *parent = 0); + QQuickFolderListModel(QObject *parent = nullptr); ~QQuickFolderListModel(); enum Roles { |