From d16b2bd369674897dc3b7c80b6fcaa70add5c873 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Thu, 4 Mar 2021 11:27:41 +0100 Subject: [PATCH] Send crash log as comment --- src/crashreporter/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/crashreporter/main.cpp b/src/crashreporter/main.cpp index 7d647426f..9d057e05a 100644 --- a/src/crashreporter/main.cpp +++ b/src/crashreporter/main.cpp @@ -18,7 +18,9 @@ #include #include +#include #include +#include int main(int argc, char *argv[]) { @@ -52,6 +54,14 @@ int main(int argc, char *argv[]) reporter.setWindowTitle(CRASHREPORTER_PRODUCT_NAME); reporter.setText("

Sorry! " CRASHREPORTER_PRODUCT_NAME " crashed. Please tell us about it! " CRASHREPORTER_PRODUCT_NAME " has created an error report for you that can help improve the stability in the future. You can now send this report directly to the " CRASHREPORTER_PRODUCT_NAME " developers.

"); + const QFileInfo crashLog(QDir::tempPath() + QStringLiteral("/" CRASHREPORTER_PRODUCT_NAME "-crash.log")); + if (crashLog.exists()) { + QFile inFile(crashLog.filePath()); + if (inFile.open(QFile::ReadOnly)) { + reporter.setComment(inFile.readAll()); + } + } + reporter.setReportData("BuildID", CRASHREPORTER_BUILD_ID); reporter.setReportData("ProductName", CRASHREPORTER_PRODUCT_NAME); reporter.setReportData("Version", CRASHREPORTER_VERSION_STRING); -- 2.30.2