summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.cpp
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2021-07-29 12:10:34 +0300
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2021-07-30 14:46:55 +0300
commit72e5b36e2e4c79dc7995f0203968503266b4f2f5 (patch)
treef979859294d19d481abfce9f7cd29c8fd0ccafa4 /src/corelib/kernel/qcoreapplication.cpp
parentb72fa182b4f08d0787ccdb62864cf4ae8a641205 (diff)
Remove app permission API from QCoreApplication
From the API review session, a potential deadlock behavior might occur when using QFuture's synchronous APIs on the UI thread. Also the fact that this api currently have an implementation only for Android. For those reasons we thought this API could be postponed until Qt 6.3, when the QFuture concern is addressed and other platforms other than Android are implemented as well. Pick-to: 6.2 Change-Id: I1aef025488c24791da85d15fb57367d3e5e681be Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp160
1 files changed, 0 insertions, 160 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 10dbe2f684..812b4afcc4 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -3083,166 +3083,6 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
\sa Q_OBJECT, QObject::tr()
*/
-#if QT_CONFIG(future) && !defined(QT_NO_QOBJECT)
-
- QFuture<QApplicationPermission::PermissionResult> defaultPermissionFuture()
- {
- QPromise<QApplicationPermission::PermissionResult> promise;
- QFuture<QApplicationPermission::PermissionResult> future = promise.future();
- promise.start();
-#if defined(QT_DEBUG)
- qWarning() << "This platform doesn't have an implementation"
- << "for the application permissions API.";
-#endif
- promise.addResult(QApplicationPermission::Authorized);
- promise.finish();
- return future;
- }
-
- QFuture<QApplicationPermission::PermissionResult>
- QCoreApplicationPrivate::requestPermission(QApplicationPermission::PermissionType permission)
- {
- Q_UNUSED(permission)
- return defaultPermissionFuture();
- }
-
- QFuture<QApplicationPermission::PermissionResult>
- QCoreApplicationPrivate::requestPermission(const QString &permission)
- {
- Q_UNUSED(permission)
- return defaultPermissionFuture();
- }
-
- QFuture<QApplicationPermission::PermissionResult>
- QCoreApplicationPrivate::checkPermission(QApplicationPermission::PermissionType permission)
- {
- Q_UNUSED(permission)
- return defaultPermissionFuture();
- }
-
- QFuture<QApplicationPermission::PermissionResult>
- QCoreApplicationPrivate::checkPermission(const QString &permission)
- {
- Q_UNUSED(permission)
- return defaultPermissionFuture();
- }
-
-/*!
- Requests the \a permission and returns a QFuture representing the
- result of the request.
-
- Applications can request a permission in a cross-platform fashion. For example
- you can request permission to use the camera asynchronously as follows:
-
- \snippet permissions/permissions.cpp Request camera permission
-
- \note A function passed to \l {QFuture::then()} will be called once the request
- is processed. It can take some suitable action in response to the
- granting or refusal of the permission. It must not access objects that
- might be deleted before it is called.
-
- To do the same request synchronously:
-
- \snippet permissions/permissions.cpp Request camera permission sync
-
- \note Any platform that doesn't have an implementation for this API,
- returns QApplicationPermission::Authorized by default. Currently, only Android
- has an implemtation for this API.
-
- \since 6.2
- \sa checkPermission()
-*/
-QFuture<QApplicationPermission::PermissionResult>
-QCoreApplication::requestPermission(QApplicationPermission::PermissionType permission)
-{
- return QCoreApplicationPrivate::requestPermission(permission);
-}
-
-/*!
- Requests the \a permission and returns a QFuture representing the
- result of the request.
-
- All application permissions supported by a platform can be requested by their
- platform-specific names. For example you can request permission to use the
- camera asynchronously on Android as follows:
-
- \snippet permissions/permissions.cpp Request camera permission on Android
-
- \note A function passed to \l {QFuture::then()} will be called once the request
- is processed. It can take some suitable action in response to the
- granting or refusal of the permission. It must not access objects that
- might be deleted before it is called.
-
- To do the same request synchronously:
-
- \snippet permissions/permissions.cpp Request camera permission sync on Android
-
- \note Any platform that doesn't have an implementation for this API,
- returns QApplicationPermission::Authorized by default. Currently, only Android
- has an implemtation for this API.
-
- \since 6.2
- \sa checkPermission()
-*/
-QFuture<QApplicationPermission::PermissionResult>
-QCoreApplication::requestPermission(const QString &permission)
-{
- return QCoreApplicationPrivate::requestPermission(permission);
-}
-
-/*!
- Checks whether this process has the named \a permission and returns a QFuture
- representing the result of the check.
-
- Applications can check a permission in a cross-platform fashion. For example
- you can check the permission to use the camera asynchronously as follows:
-
- \snippet permissions/permissions.cpp Check camera permission
-
- To do the same request synchronously:
-
- \snippet permissions/permissions.cpp Check camera permission sync
-
- \note Any platform that doesn't have an implementation for this API,
- returns QApplicationPermission::Authorized by default. Currently, only Android
- has an implemtation for this API.
-
- \since 6.2
- \sa requestPermission()
-*/
-QFuture<QApplicationPermission::PermissionResult>
-QCoreApplication::checkPermission(QApplicationPermission::PermissionType permission)
-{
- return QCoreApplicationPrivate::checkPermission(permission);
-}
-
-/*!
- Checks whether this process has the named \a permission and returns a QFuture
- representing the result of the check.
-
- All application permissions supported by a platform can be checked by their
- platform-specific names. For example you can check the permission to use the
- camera asynchronously on Android as follows:
-
- \snippet permissions/permissions.cpp Check camera permission on Android
-
- To do the same request synchronously:
-
- \snippet permissions/permissions.cpp Check camera permission sync on Android
-
- \note Any platform that doesn't have an implementation for this API,
- returns QApplicationPermission::Authorized by default. Currently, only Android
- has an implemtation for this API.
-
- \since 6.2
- \sa requestPermission()
-*/
-QFuture<QApplicationPermission::PermissionResult>
-QCoreApplication::checkPermission(const QString &permission)
-{
- return QCoreApplicationPrivate::checkPermission(permission);
-}
-#endif // future && QT_NO_QOBJECT
void *QCoreApplication::resolveInterface(const char *name, int revision) const
{