From fae85282ba81a3f294b990f9e416a46680bfbe88 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 11 Jan 2023 15:55:42 +0100 Subject: [PATCH] Q{Calendar,Contact}Permission: invert default state of isReadOnly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The QLocationPermission properties default to the least-intrusive capabilities: Availability::WhenInUse (not: Always) and Accuracy::Approximate (not: Precise). Logically, QCalendar- and ContactPermission's readOnly property should then default to read-only access, not read-write. Orthogonally to this change of default value, it might make sense to invert the name of the property, too: isReadWrite() or hasWriteAccess(). Pick-to: 6.5 Change-Id: I9359c82051b1a6735feca8b2f06b9891acef650f Reviewed-by: Tor Arne Vestbø --- src/corelib/kernel/qpermissions.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/corelib/kernel/qpermissions.cpp b/src/corelib/kernel/qpermissions.cpp index 6b1523a7c5b..c9cbb7fed58 100644 --- a/src/corelib/kernel/qpermissions.cpp +++ b/src/corelib/kernel/qpermissions.cpp @@ -432,8 +432,8 @@ QLocationPermission::Availability QLocationPermission::availability() const \class QContactsPermission \brief Access the user's contacts. - By default the request is for both read and write access. - Use setReadOnly() to override the default. + By default the request is for read-only access. + Use setReadOnly(false) to override the default. \section1 Requirements @@ -454,7 +454,7 @@ QLocationPermission::Availability QLocationPermission::availability() const class QContactsPermissionPrivate : public QSharedData { public: - bool isReadOnly = false; + bool isReadOnly = true; }; QT_DEFINE_PERMISSION_SPECIAL_FUNCTIONS(QContactsPermission) @@ -480,8 +480,8 @@ bool QContactsPermission::isReadOnly() const \class QCalendarPermission \brief Access the user's calendar. - By default the request is for both read and write access. - Use setReadOnly() to override the default. + By default the request is for read-only access. + Use setReadOnly(false) to override the default. \section1 Requirements @@ -502,7 +502,7 @@ bool QContactsPermission::isReadOnly() const class QCalendarPermissionPrivate : public QSharedData { public: - bool isReadOnly = false; + bool isReadOnly = true; }; QT_DEFINE_PERMISSION_SPECIAL_FUNCTIONS(QCalendarPermission)