Skip to content

Commit

Permalink
Apply common settings on crash reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Jul 7, 2023
1 parent 9b59179 commit 0905bf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/crashreporter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add_executable(${CRASHREPORTER_EXECUTABLE}
${crashreporter_UI_HEADERS}
${crashreporter_RC}
)
apply_common_target_settings(${CRASHREPORTER_EXECUTABLE})

# This is a GUI Application without its own bundle
set_target_properties(${CRASHREPORTER_EXECUTABLE}
Expand Down
17 changes: 8 additions & 9 deletions src/crashreporter/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
#ifdef Q_OS_WIN
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
#endif // !Q_OS_WIN
QApplication app(argc, argv);

#ifdef Q_OS_WIN
Expand All @@ -46,19 +42,22 @@ int main(int argc, char *argv[])
}

// TODO: install socorro ....
CrashReporter reporter(QUrl(CRASHREPORTER_SUBMIT_URL), app.arguments());
CrashReporter reporter(QUrl(QStringLiteral(CRASHREPORTER_SUBMIT_URL)), app.arguments());

#ifdef CRASHREPORTER_ICON
reporter.setLogo(QPixmap(CRASHREPORTER_ICON));
reporter.setLogo(QPixmap(QStringLiteral(CRASHREPORTER_ICON)));
#endif
reporter.setWindowTitle(CRASHREPORTER_PRODUCT_NAME);
reporter.setText("<html><head/><body><p><span style=\" font-weight:600;\">Sorry!</span> " 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.</p></body></html>");
reporter.setWindowTitle(QStringLiteral(CRASHREPORTER_PRODUCT_NAME));
reporter.setText(QStringLiteral("<html><head/><body><p><span style=\" font-weight:600;\">Sorry!</span> " 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.</p></body></html>"));

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.setComment(QString::fromUtf8(inFile.readAll()));
}
}

Expand Down

0 comments on commit 0905bf0

Please sign in to comment.