crash: allow overriding crash reporter url

This commit is contained in:
outfoxxed 2026-03-13 02:04:01 -07:00
parent e32b909354
commit 4b77936c80
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
5 changed files with 22 additions and 16 deletions

View file

@ -5,6 +5,7 @@
#include <qapplication.h>
#include <qboxlayout.h>
#include <qconfig.h>
#include <qcontainerfwd.h>
#include <qdesktopservices.h>
#include <qfont.h>
#include <qfontinfo.h>
@ -12,11 +13,22 @@
#include <qnamespace.h>
#include <qobject.h>
#include <qpushbutton.h>
#include <qtenvironmentvariables.h>
#include <qtversion.h>
#include <qwidget.h>
#include "build.hpp"
namespace {
QString crashreportUrl() {
if (auto url = qEnvironmentVariable("QS_CRASHREPORT_URL"); !url.isEmpty()) {
return url;
}
return CRASHREPORT_URL;
}
} // namespace
class ReportLabel: public QWidget {
public:
ReportLabel(const QString& label, const QString& content, QWidget* parent): QWidget(parent) {
@ -67,22 +79,16 @@ CrashReporterGui::CrashReporterGui(QString reportFolder, int pid)
if (qtVersionMatches) {
mainLayout->addWidget(
new QLabel("Please open a bug report for this issue via github or email.")
new QLabel("Please open a bug report for this issue on the issue tracker.")
);
} else {
mainLayout->addWidget(new QLabel(
"Please rebuild Quickshell against the current Qt version.\n"
"If this does not solve the problem, please open a bug report via github or email."
"If this does not solve the problem, please open a bug report on the issue tracker."
));
}
mainLayout->addWidget(new ReportLabel(
"Github:",
"https://github.com/quickshell-mirror/quickshell/issues/new?template=crash2.yml",
this
));
mainLayout->addWidget(new ReportLabel("Email:", "quickshell-bugs@outfoxxed.me", this));
mainLayout->addWidget(new ReportLabel("Tracker:", crashreportUrl(), this));
auto* buttons = new QWidget(this);
buttons->setMinimumWidth(900);
@ -112,10 +118,5 @@ void CrashReporterGui::openFolder() {
QDesktopServices::openUrl(QUrl::fromLocalFile(this->reportFolder));
}
void CrashReporterGui::openReportUrl() {
QDesktopServices::openUrl(
QUrl("https://github.com/outfoxxed/quickshell/issues/new?template=crash2.yml")
);
}
void CrashReporterGui::openReportUrl() { QDesktopServices::openUrl(QUrl(crashreportUrl())); }
void CrashReporterGui::cancel() { QApplication::quit(); }