diff --git a/BUILD.md b/BUILD.md index aa04bbd..04421c0 100644 --- a/BUILD.md +++ b/BUILD.md @@ -15,7 +15,7 @@ Please make this descriptive enough to identify your specific package, for examp - `Nixpkgs` - `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 Currently all QML modules are statically linked to quickshell, but this is where diff --git a/CMakeLists.txt b/CMakeLists.txt index d57e322..1226342 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) 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) cmake_parse_arguments(PARSE_ARGV 3 arg "" "REQUIRES" "") diff --git a/changelog/next.md b/changelog/next.md index fa6d845..587e667 100644 --- a/changelog/next.md +++ b/changelog/next.md @@ -36,6 +36,7 @@ set shell id. - Reloads are prevented if no file content has changed. - Added `QS_DISABLE_FILE_WATCHER` environment variable to disable file watching. - 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 diff --git a/src/build/build.hpp.in b/src/build/build.hpp.in index 2ab2db2..acc3c58 100644 --- a/src/build/build.hpp.in +++ b/src/build/build.hpp.in @@ -13,4 +13,5 @@ #define COMPILER "@CMAKE_CXX_COMPILER_ID@ (@CMAKE_CXX_COMPILER_VERSION@)" #define COMPILE_FLAGS "@CMAKE_CXX_FLAGS@" #define BUILD_CONFIGURATION "@QS_BUILD_OPTIONS@" +#define CRASHREPORT_URL "@CRASHREPORT_URL@" // NOLINTEND diff --git a/src/crash/interface.cpp b/src/crash/interface.cpp index a3422d3..6a370ce 100644 --- a/src/crash/interface.cpp +++ b/src/crash/interface.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -12,11 +13,22 @@ #include #include #include +#include #include #include #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(); }