summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/kernel/qcore_mac_objc.mm23
-rw-r--r--src/corelib/kernel/qcore_mac_p.h1
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp3
3 files changed, 15 insertions, 12 deletions
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm
index 2e303607df..4ca9c2e996 100644
--- a/src/corelib/kernel/qcore_mac_objc.mm
+++ b/src/corelib/kernel/qcore_mac_objc.mm
@@ -448,16 +448,23 @@ void qt_apple_check_os_version()
version / 10000, version / 100 % 100, version % 100};
const NSOperatingSystemVersion current = NSProcessInfo.processInfo.operatingSystemVersion;
if (![NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:required]) {
- fprintf(stderr, "You can't use this version of %s with this version of %s. "
- "You have %s %ld.%ld.%ld. Qt requires %s %ld.%ld.%ld or later.\n",
- (reinterpret_cast<const NSString *>(
- NSBundle.mainBundle.infoDictionary[@"CFBundleName"]).UTF8String),
- os,
- os, long(current.majorVersion), long(current.minorVersion), long(current.patchVersion),
- os, long(required.majorVersion), long(required.minorVersion), long(required.patchVersion));
- abort();
+ NSDictionary *plist = NSBundle.mainBundle.infoDictionary;
+ NSString *applicationName = plist[@"CFBundleDisplayName"];
+ if (!applicationName)
+ applicationName = plist[@"CFBundleName"];
+ if (!applicationName)
+ applicationName = NSProcessInfo.processInfo.processName;
+
+ fprintf(stderr, "Sorry, \"%s\" can not be run on this version of %s. "
+ "Qt requires %s %ld.%ld.%ld or later, you have %s %ld.%ld.%ld.\n",
+ applicationName.UTF8String, os,
+ os, long(required.majorVersion), long(required.minorVersion), long(required.patchVersion),
+ os, long(current.majorVersion), long(current.minorVersion), long(current.patchVersion));
+
+ exit(1);
}
}
+Q_CONSTRUCTOR_FUNCTION(qt_apple_check_os_version);
// -------------------------------------------------------------------------
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index bf540c2e35..19dddbc2ae 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -190,7 +190,6 @@ Q_CORE_EXPORT bool qt_mac_applicationIsInDarkMode();
QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool);
#endif
-Q_CORE_EXPORT void qt_apple_check_os_version();
Q_CORE_EXPORT bool qt_apple_isApplicationExtension();
#if defined(Q_OS_MACOS) && !defined(QT_BOOTSTRAPPED)
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 04da52a960..0303916c11 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -456,9 +456,6 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
, q_ptr(0)
#endif
{
-#if defined(Q_OS_DARWIN)
- qt_apple_check_os_version();
-#endif
app_compile_version = flags & 0xffffff;
static const char *const empty = "";
if (argc == 0 || argv == 0) {