diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-04-30 15:36:22 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-05-30 09:16:07 +0000 |
commit | 6ada504475fc8ec3f7fe4d05f8af1ba3735208e9 (patch) | |
tree | 84d0889f306b58628dbdbaf70dfd44d93780f09e | |
parent | ffc377a5291d8c53b62de11cc4187026e0f7a6bf (diff) |
Add function to check whether or not we're part of an extension on Apple OSes
Change-Id: I308147c752ec9c869db87aa94ccf6c88e0999524
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
-rw-r--r-- | src/corelib/kernel/qcore_mac_objc.mm | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qcore_mac_p.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index 5ecd86a30e..d1a736c9bb 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -161,6 +161,12 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool) } #endif // !QT_NO_DEBUG_STREAM +bool qt_apple_isApplicationExtension() +{ + static bool isExtension = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSExtension"]; + return isExtension; +} + #ifdef Q_OS_MACOS /* Ensure that Objective-C objects auto-released in main(), directly or indirectly, diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h index 9c6cef68b2..d0fab8254b 100644 --- a/src/corelib/kernel/qcore_mac_p.h +++ b/src/corelib/kernel/qcore_mac_p.h @@ -158,6 +158,7 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool); #endif Q_CORE_EXPORT void qt_apple_check_os_version(); +Q_CORE_EXPORT bool qt_apple_isApplicationExtension(); // -------------------------------------------------------------------------- |