From 174af05400f6344a11f4aa2228244c954cbbca97 Mon Sep 17 00:00:00 2001 From: Ievgenii Meshcheriakov Date: Wed, 10 Nov 2021 16:52:07 +0100 Subject: QDir: Add support for setting directory permissions to mkdir() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: MÃ¥rten Nordheim --- src/corelib/io/qfilesystemengine_p.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qfilesystemengine_p.h') 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 +#include + 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 permissions = std::nullopt); static bool removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents); static bool createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error); -- cgit v1.2.3