diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2024-02-10 03:10:44 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2024-03-21 19:05:02 +0200 |
commit | 3c50ad828861bee82e53469deab28b4e286cbeda (patch) | |
tree | 36ab6a8c7f88fc7c729bdc1b958c81970b63e95c /src/corelib/io/qfilesystemengine_p.h | |
parent | 0737fca6b2f4b29b7e4eda221147187cf72f96f3 (diff) |
QFileSystemEngine: make factory functions return unique_ptr<QABFE>
This makes the ownership of the returned pointer clearer. It also
matches reality, some call sites were already storing the pointer in a
unique_ptr.
Also shorten the function name to "createLegacyEngine", you have to read
its docs anyway to figure out what it does.
Drive-by changes: less magic numbers; use sliced(); return nullptr
instead of `0`.
Change-Id: I637759b4160b28b15adf5f6548de336887338dab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/corelib/io/qfilesystemengine_p.h')
-rw-r--r-- | src/corelib/io/qfilesystemengine_p.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h index c1dddb2e1e..78b8337f35 100644 --- a/src/corelib/io/qfilesystemengine_p.h +++ b/src/corelib/io/qfilesystemengine_p.h @@ -20,6 +20,7 @@ #include "qfilesystemmetadata_p.h" #include <QtCore/private/qsystemerror_p.h> +#include <memory> #include <optional> QT_BEGIN_NAMESPACE @@ -141,8 +142,9 @@ public: static bool setCurrentPath(const QFileSystemEntry &entry); static QFileSystemEntry currentPath(); - static QAbstractFileEngine *resolveEntryAndCreateLegacyEngine(QFileSystemEntry &entry, - QFileSystemMetaData &data); + static std::unique_ptr<QAbstractFileEngine> + createLegacyEngine(QFileSystemEntry &entry, QFileSystemMetaData &data); + private: static QString slowCanonicalized(const QString &path); #if defined(Q_OS_WIN) |