Skip to content

Commit

Permalink
Q{Calendar,Contact}Permission: invert default state of isReadOnly
Browse files Browse the repository at this point in the history
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ø <[email protected]>
  • Loading branch information
marcmutz committed Jan 11, 2023
1 parent afb4e24 commit fae8528
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/corelib/kernel/qpermissions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit fae8528

Please sign in to comment.