aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/main.cpp
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2023-03-03 18:13:30 +0100
committerTim Jenssen <tim.jenssen@qt.io>2023-03-06 04:46:03 +0000
commitb619f24396ab5d446f39d2d53904829254c19a80 (patch)
tree0451ca1653cf62cef601f3322aea4006e8375ea0 /src/app/main.cpp
parent6445db8ca2c687190588d4d6be76ee559f248cec (diff)
crashpad: change chrashpad dumps location to user directory on macOS
This is necessary to not pollute the signed and notarized .app bundle. Task-number: QDS-9113 Change-Id: I74e0bced5679faac94b27d2a31ea10a7949fb21f Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/app/main.cpp')
-rw-r--r--src/app/main.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 74d1ccec9e..d1cfc7136a 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -425,13 +425,26 @@ QStringList lastSessionArgument()
return hasProjectExplorer ? QStringList({"-lastsession"}) : QStringList();
}
+// should be in sync with src/plugins/coreplugin/icore.cpp -> FilePath ICore::crashReportsPath()
+// and src\tools\qml2puppet\qml2puppet\qmlpuppet.cpp -> QString crashReportsPath()
+QString crashReportsPath()
+{
+ std::unique_ptr<QSettings> settings(createUserSettings());
+ QFileInfo(settings->fileName()).path() + "/crashpad_reports";
+ if (Utils::HostOsInfo::isMacHost())
+ return QFileInfo(createUserSettings()->fileName()).path() + "/crashpad_reports";
+ else
+ return QCoreApplication::applicationDirPath()
+ + '/' + RELATIVE_LIBEXEC_PATH + "crashpad_reports";
+}
+
#ifdef ENABLE_CRASHPAD
bool startCrashpad(const QString &libexecPath, bool crashReportingEnabled)
{
using namespace crashpad;
// Cache directory that will store crashpad information and minidumps
- QString databasePath = QDir::cleanPath(libexecPath + "/crashpad_reports");
+ QString databasePath = QDir::cleanPath(crashReportsPath());
QString handlerPath = QDir::cleanPath(libexecPath + "/crashpad_handler");
#ifdef Q_OS_WIN
handlerPath += ".exe";