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

@ -15,7 +15,7 @@ Please make this descriptive enough to identify your specific package, for examp
- `Nixpkgs` - `Nixpkgs`
- `Fedora COPR (errornointernet/quickshell)` - `Fedora COPR (errornointernet/quickshell)`
Please leave at least symbol names attached to the binary for debugging purposes. If you are forking quickshell, please change `CRASHREPORT_URL` to your own issue tracker.
### QML Module dir ### QML Module dir
Currently all QML modules are statically linked to quickshell, but this is where Currently all QML modules are statically linked to quickshell, but this is where

View file

@ -9,6 +9,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(QS_BUILD_OPTIONS "") set(QS_BUILD_OPTIONS "")
# should be changed for forks
set(CRASHREPORT_URL "https://github.com/outfoxxed/quickshell/issues/new?template=crash2.yml" CACHE STRING "Bugreport URL")
function(boption VAR NAME DEFAULT) function(boption VAR NAME DEFAULT)
cmake_parse_arguments(PARSE_ARGV 3 arg "" "REQUIRES" "") cmake_parse_arguments(PARSE_ARGV 3 arg "" "REQUIRES" "")

View file

@ -36,6 +36,7 @@ set shell id.
- Reloads are prevented if no file content has changed. - Reloads are prevented if no file content has changed.
- Added `QS_DISABLE_FILE_WATCHER` environment variable to disable file watching. - Added `QS_DISABLE_FILE_WATCHER` environment variable to disable file watching.
- Added `QS_DISABLE_CRASH_HANDLER` environment variable to disable crash handling. - Added `QS_DISABLE_CRASH_HANDLER` environment variable to disable crash handling.
- Added `QS_CRASHREPORT_URL` environment variable to allow overriding the crash reporter link.
## Bug Fixes ## Bug Fixes

View file

@ -13,4 +13,5 @@
#define COMPILER "@CMAKE_CXX_COMPILER_ID@ (@CMAKE_CXX_COMPILER_VERSION@)" #define COMPILER "@CMAKE_CXX_COMPILER_ID@ (@CMAKE_CXX_COMPILER_VERSION@)"
#define COMPILE_FLAGS "@CMAKE_CXX_FLAGS@" #define COMPILE_FLAGS "@CMAKE_CXX_FLAGS@"
#define BUILD_CONFIGURATION "@QS_BUILD_OPTIONS@" #define BUILD_CONFIGURATION "@QS_BUILD_OPTIONS@"
#define CRASHREPORT_URL "@CRASHREPORT_URL@"
// NOLINTEND // NOLINTEND

View file

@ -5,6 +5,7 @@
#include <qapplication.h> #include <qapplication.h>
#include <qboxlayout.h> #include <qboxlayout.h>
#include <qconfig.h> #include <qconfig.h>
#include <qcontainerfwd.h>
#include <qdesktopservices.h> #include <qdesktopservices.h>
#include <qfont.h> #include <qfont.h>
#include <qfontinfo.h> #include <qfontinfo.h>
@ -12,11 +13,22 @@
#include <qnamespace.h> #include <qnamespace.h>
#include <qobject.h> #include <qobject.h>
#include <qpushbutton.h> #include <qpushbutton.h>
#include <qtenvironmentvariables.h>
#include <qtversion.h> #include <qtversion.h>
#include <qwidget.h> #include <qwidget.h>
#include "build.hpp" #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 { class ReportLabel: public QWidget {
public: public:
ReportLabel(const QString& label, const QString& content, QWidget* parent): QWidget(parent) { ReportLabel(const QString& label, const QString& content, QWidget* parent): QWidget(parent) {
@ -67,22 +79,16 @@ CrashReporterGui::CrashReporterGui(QString reportFolder, int pid)
if (qtVersionMatches) { if (qtVersionMatches) {
mainLayout->addWidget( 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 { } else {
mainLayout->addWidget(new QLabel( mainLayout->addWidget(new QLabel(
"Please rebuild Quickshell against the current Qt version.\n" "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( mainLayout->addWidget(new ReportLabel("Tracker:", crashreportUrl(), this));
"Github:",
"https://github.com/quickshell-mirror/quickshell/issues/new?template=crash2.yml",
this
));
mainLayout->addWidget(new ReportLabel("Email:", "quickshell-bugs@outfoxxed.me", this));
auto* buttons = new QWidget(this); auto* buttons = new QWidget(this);
buttons->setMinimumWidth(900); buttons->setMinimumWidth(900);
@ -112,10 +118,5 @@ void CrashReporterGui::openFolder() {
QDesktopServices::openUrl(QUrl::fromLocalFile(this->reportFolder)); QDesktopServices::openUrl(QUrl::fromLocalFile(this->reportFolder));
} }
void CrashReporterGui::openReportUrl() { void CrashReporterGui::openReportUrl() { QDesktopServices::openUrl(QUrl(crashreportUrl())); }
QDesktopServices::openUrl(
QUrl("https://github.com/outfoxxed/quickshell/issues/new?template=crash2.yml")
);
}
void CrashReporterGui::cancel() { QApplication::quit(); } void CrashReporterGui::cancel() { QApplication::quit(); }