summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfile.h
diff options
context:
space:
mode:
authorMate Barany <mate.barany@qt.io>2023-01-19 13:53:21 +0100
committerMate Barany <mate.barany@qt.io>2023-02-14 13:23:19 +0100
commitfd70555b331a3d5c539eae7de866da1ef41eacd4 (patch)
tree0c38aae5b72d54fe3820485533113dcdd14408a0 /src/corelib/io/qfile.h
parent5999ff4fd638917c5027f673c0e123a1221f5e23 (diff)
Deprecate usage of qt_ntfs_permission_lookup
With the introduction of a new atomic variable the users should use the class QNtfsPermissionCheckGuard or the helper functions - qEnableNtfsPermissionChecks() - qDisableNtfsPermissionChecks() - qAreNtfsPermissionChecksEnabled() to enable/disable permission checks instead of manually managing the variable qt_ntfs_permission_lookup (which is a non-atomic variable and as such prone to data races). Also moved the variable qt_ntfs_permission_lookup to qfile.h to make it clash with the user-side declarations the documentation suggested to use (and it is probably also a better fit thematically anyway). [ChangeLog][QtCore][Deprecation Notice] Deprecated the variable qt_ntfs_permission_lookup to avoid race conditions while enabling or disabling permission checks. It can be replaced by the RAII class QNtfsPermissionCheckGuard or with the functions qEnableNtfsPermissionChecks(), qDisableNtfsPermissionChecks() and qAreNtfsPermissionChecksEnabled(). Fixes: QTBUG-105804 Change-Id: I93a563864ffb3f9945551c34004d8ca393603b25 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/io/qfile.h')
-rw-r--r--src/corelib/io/qfile.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h
index f608ca48f5..cb06665a9f 100644
--- a/src/corelib/io/qfile.h
+++ b/src/corelib/io/qfile.h
@@ -27,6 +27,12 @@ namespace std {
QT_BEGIN_NAMESPACE
#ifdef Q_OS_WIN
+
+#if QT_DEPRECATED_SINCE(6,6)
+QT_DEPRECATED_VERSION_X_6_6("Use QNtfsPermissionCheckGuard RAII class instead.")
+Q_CORE_EXPORT extern int qt_ntfs_permission_lookup; // defined in qfilesystemengine_win.cpp
+#endif
+
Q_CORE_EXPORT bool qEnableNtfsPermissionChecks() noexcept;
Q_CORE_EXPORT bool qDisableNtfsPermissionChecks() noexcept;
Q_CORE_EXPORT bool qAreNtfsPermissionChecksEnabled() noexcept;