diff options
author | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2021-11-10 16:52:07 +0100 |
---|---|---|
committer | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2021-11-26 03:39:33 +0100 |
commit | 174af05400f6344a11f4aa2228244c954cbbca97 (patch) | |
tree | df5edd252f5d0bd4b865c3ace2473fbbfb80d087 /src/corelib/io/qfilesystemengine_p.h | |
parent | 8c9875893bbd7b1355e36d9501d8cb1f84cb6b4d (diff) |
QDir: Add support for setting directory permissions to mkdir()
This patch adds an overload of the QDir::mkdir() method that
accepts permissions. This allows setting of the directory
permissions at the time of its creation.
[ChangeLog][QtCore][QDir] Added QDir::mdkir() overload that
accepts permissions argument.
Task-number: QTBUG-79750
Change-Id: Ic9db723b94ff0d2da6e0b819ac2e5d1f9a4e2049
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/io/qfilesystemengine_p.h')
-rw-r--r-- | src/corelib/io/qfilesystemengine_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h index 0b6f0fbd84..6fac1ae4be 100644 --- a/src/corelib/io/qfilesystemengine_p.h +++ b/src/corelib/io/qfilesystemengine_p.h @@ -56,6 +56,8 @@ #include "qfilesystemmetadata_p.h" #include <QtCore/private/qsystemerror_p.h> +#include <optional> + QT_BEGIN_NAMESPACE #define Q_RETURN_ON_INVALID_FILENAME(message, result) \ @@ -151,7 +153,8 @@ public: static QString rootPath(); static QString tempPath(); - static bool createDirectory(const QFileSystemEntry &entry, bool createParents); + static bool createDirectory(const QFileSystemEntry &entry, bool createParents, + std::optional<QFile::Permissions> permissions = std::nullopt); static bool removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents); static bool createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error); |