From 35396e12eb73c5d7d45e903a1d617e76ad0aca3f Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Sat, 8 May 2021 13:50:49 +1000 Subject: fix build for no feature future This amends afd7460affa17b5f8aac9034b1b9c3b13dd115f7 Add new app permissions API under QCoreApplication Which added QFuture use without protection for platforms with no real future. Change-Id: Iac50a71c9821255621d7582481270b2023610405 Reviewed-by: Sona Kurazyan --- src/corelib/global/qconfig-bootstrapped.h | 1 + src/corelib/kernel/qcoreapplication.cpp | 8 ++++---- src/corelib/kernel/qcoreapplication.h | 7 +++++-- src/corelib/kernel/qcoreapplication_p.h | 5 +++-- 4 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index 9019bfd089..42d38d0d04 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -98,6 +98,7 @@ #define QT_FEATURE_journald -1 #define QT_FEATURE_futimens -1 #define QT_FEATURE_futimes -1 +#define QT_FEATURE_future -1 #define QT_FEATURE_itemmodel -1 #define QT_FEATURE_library -1 #ifdef __linux__ diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 676614f6d6..5500d14d18 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -60,7 +60,9 @@ #ifndef QT_NO_QOBJECT #include #include +#if QT_CONFIG(future) #include +#endif #include #if QT_CONFIG(thread) #include @@ -995,7 +997,6 @@ bool QCoreApplication::testAttribute(Qt::ApplicationAttribute attribute) return QCoreApplicationPrivate::testAttribute(attribute); } - #ifndef QT_NO_QOBJECT /*! @@ -3076,8 +3077,7 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc \sa Q_OBJECT, QObject::tr() */ - -#ifndef QT_NO_QOBJECT +#if QT_CONFIG(future) && !defined(QT_NO_QOBJECT) #if !defined(Q_OS_ANDROID) QFuture defaultPermissionFuture() @@ -3225,7 +3225,7 @@ QCoreApplication::checkPermission(const QString &permission) { return QCoreApplicationPrivate::checkPermission(permission); } -#endif +#endif // future && QT_NO_QOBJECT QT_END_NAMESPACE diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 1bb0612100..dd4336ea30 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -45,9 +45,11 @@ #ifndef QT_NO_QOBJECT #include #include +#if QT_CONFIG(future) #include -#include #include +#endif +#include #else #include #endif @@ -158,6 +160,7 @@ public: int n = -1); #ifndef QT_NO_QOBJECT +#if QT_CONFIG(future) static QFuture requestPermission( QPermission::PermisionType permission); static QFuture requestPermission(const QString &permission); @@ -165,7 +168,7 @@ public: static QFuture checkPermission( QPermission::PermisionType permission); static QFuture checkPermission(const QString &permission); - +#endif void installNativeEventFilter(QAbstractNativeEventFilter *filterObj); void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj); diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index 54e2ac4151..dd310f9cea 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -62,9 +62,11 @@ #ifndef QT_NO_QOBJECT #include "private/qobject_p.h" #include "private/qlocking_p.h" +#if QT_CONFIG(future) #include #include #endif +#endif #ifdef Q_OS_MACOS #include "private/qcore_mac_p.h" @@ -201,8 +203,7 @@ public: void processCommandLineArguments(); QString qmljs_debug_arguments; // a string containing arguments for js/qml debugging. inline QString qmljsDebugArgumentsString() const { return qmljs_debug_arguments; } - -#ifndef QT_NO_QOBJECT +#if QT_CONFIG(future) && !defined QT_NO_QOBJECT static QFuture requestPermission( QPermission::PermisionType permission); static QFuture requestPermission(const QString &permission); -- cgit v1.2.3