summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <[email protected]>2020-01-31 18:19:14 +0100
committerTor Arne Vestbø <[email protected]>2020-02-06 23:42:55 +0100
commit1a58e78db0e41da0423a50ffa900a6d90e83a0d5 (patch)
tree4cf89d6ec5b5df275b70fafcaf55ef1974f76803 /src/testlib/qtestcase.cpp
parent19510abbffc433c2d6435e558047e55aa5800531 (diff)
testlib: Be more selective in choosing to show stacktraces on macOS
The built in crash reporter on macOS will by default not show the dialog if the application is not one that will run in the foreground. Change-Id: I0020520ae2f14a0e2f84fdca1d80ec6fe1247ffd Reviewed-by: Simon Hausmann <[email protected]> Reviewed-by: Timur Pocheptsov <[email protected]>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 6805d17b6ee..20c370dc38c 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -180,20 +180,7 @@ static bool debuggerPresent()
static bool hasSystemCrashReporter()
{
#if defined(Q_OS_MACOS)
- CFStringRef crashReporterType = static_cast<CFStringRef>(
- CFPreferencesCopyAppValue(CFSTR("DialogType"), CFSTR("com.apple.CrashReporter")));
- if (crashReporterType == nullptr)
- return true;
-
- auto equals = [](CFStringRef str1, CFStringRef str2) -> bool {
- return CFStringCompare(str1, str2, kCFCompareCaseInsensitive) == kCFCompareEqualTo;
- };
-
- const bool createsStackTrace =
- !equals(crashReporterType, CFSTR("server")) &&
- !equals(crashReporterType, CFSTR("none"));
- CFRelease(crashReporterType);
- return createsStackTrace;
+ return QTestPrivate::macCrashReporterWillShowDialog();
#else
return false;
#endif