aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/main.cpp
diff options
context:
space:
mode:
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 74d1ccec9e6..d1cfc7136a8 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";