Q{Calendar,Contact}Permission: invert default state of isReadOnly

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().

Change-Id: I9359c82051b1a6735feca8b2f06b9891acef650f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fae85282ba81a3f294b990f9e416a46680bfbe88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-01-11 15:55:42 +01:00 committed by Qt Cherry-pick Bot
parent 706ed459ff
commit 636fe7beb6

View File

@ -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)