diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-10-19 14:20:33 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-10-19 12:35:44 +0000 |
commit | 6734ee9a6ddb6a3870556514a70d904836258559 (patch) | |
tree | a4b5f7a8e880cd6b6f7aa1dfea81521a3c4d1e86 /src/imports/folderlistmodel/qquickfolderlistmodel.cpp | |
parent | 4d8cdc7d69594602246807097b92f72b42f4f6e9 (diff) |
FolderListModel: use header initialization; fix pedantic warningsv5.12.0-beta3
That is, initialize variables in the private class where they are
defined, and move the padding warning out of that section (now it
says the whole class is padded to the alignment boundary, but there's
not much we can do about that).
Change-Id: I63101b6a837c69265c73b4c6001f1901fcaa8572
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/imports/folderlistmodel/qquickfolderlistmodel.cpp')
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.cpp | 38 |
1 files changed, 13 insertions, 25 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(); |