diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-05-25 23:42:45 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-07-28 12:16:22 +0000 |
commit | 186bdec01a62dcc407e21873a6c6a0c484d5df62 (patch) | |
tree | 80ed8b5293ba2ec649c4109fccc2e81869e0b7ea /src/corelib/io/qdiriterator.cpp | |
parent | 80d7ba4c49a6e1c9651695719d84e3952898f1d5 (diff) |
Standardize on unique_ptr to hold QAbstractFileEngine
This will make it possible to return it from functions in an owner,
as exemplified in the QFileInfoPrivate ctor, unlike QScopedPointer,
which lacks move special member functions.
Change-Id: I179ffa4f656e1b83c23e0f67d1542834460ff382
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/io/qdiriterator.cpp')
-rw-r--r-- | src/corelib/io/qdiriterator.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index 303caf29a4..ce436b06e3 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -107,6 +107,8 @@ #include <QtCore/private/qfilesystemengine_p.h> #include <QtCore/private/qfileinfo_p.h> +#include <memory> + QT_BEGIN_NAMESPACE template <class Iterator> @@ -132,7 +134,7 @@ public: void checkAndPushDirectory(const QFileInfo &); bool matchesFilters(const QString &fileName, const QFileInfo &fi) const; - QScopedPointer<QAbstractFileEngine> engine; + std::unique_ptr<QAbstractFileEngine> engine; QFileSystemEntry dirEntry; const QStringList nameFilters; @@ -435,7 +437,7 @@ bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInf QDirIterator::QDirIterator(const QDir &dir, IteratorFlags flags) { const QDirPrivate *other = dir.d_ptr.constData(); - d.reset(new QDirIteratorPrivate(other->dirEntry, other->nameFilters, other->filters, flags, !other->fileEngine.isNull())); + d.reset(new QDirIteratorPrivate(other->dirEntry, other->nameFilters, other->filters, flags, bool(other->fileEngine))); } /*! |