[CrashReporting] Mock dialog, sentry skeleton and CI prerequisites

Mock: DlgCrashReport preview dialog (no account needed, redacted log
preview), CrashReportingMode Ask/Always/Never setting in DebugSettings,
--simulate-crash flag and Help-menu preview entry. Send writes a local
mock JSON only.

Vendor sentry-native 0.17.3 via FetchContent behind
WITH_CRASH_REPORTING (breakpad everywhere, backend none under
sanitizers) plus a CrashReporter facade with early init and post-loop
shutdown. DSN is a placeholder: empty CMake default with
COCKATRICE_SENTRY_DSN env override, so SDK init is skipped and mock
behavior is unchanged until a real DSN is configured.

CI prerequisites riding here so every layer below builds green:
libcurl dev plus CA bundles in the Linux images and CodeQL env, sentry
Qt integration off (its own find_package cannot see the macOS thin Qt
layout), and the StrFunc Using construction makensis requires.

Tests: ctest green, format clean, code plus UI gates PASS.
This commit is contained in:
Lukas Brübach 2026-10-14 08:53:41 +02:00 • committed by GitHub
parent ea6af0048c
commit 6411abfb57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 962 additions and 5 deletions

View file

@ -34,4 +34,4 @@ int DebugSettings::getLocalGamePlayerCount() const
QString DebugSettings::getDeckPathForPlayer(const QString &playerName) const
{
return getValue(playerName, "localgame", "deck").toString();
}
}

View file

@ -18,7 +18,10 @@ class DebugSettings : public SettingsManager
Q_OBJECT
friend class SettingsCache;
public:
explicit DebugSettings(const QString &settingPath, QObject *parent = nullptr);
private:
DebugSettings(const DebugSettings & /*other*/);
public:

View file

@ -51,3 +51,24 @@ void PersonalSettings::setSeenTips(const QList<int> &_seenTips)
}
setValue(QVariant::fromValue(storedTipList), "seenTips", "tipOfDay");
}
PersonalSettings::CrashReportingMode PersonalSettings::getCrashReportingMode() const
{
const int raw = getValue("crashReportingMode", QString(), QString(), 0).toInt();
switch (raw) {
case 1:
return CrashReportingMode::AlwaysSend;
case 2:
return CrashReportingMode::NeverSend;
case 0:
default:
// Clamp corrupt ini values back to Ask; the QSettings key string is unchanged (no migration).
return CrashReportingMode::Ask;
}
}
void PersonalSettings::setCrashReportingMode(CrashReportingMode _crashReportingMode)
{
setValue(static_cast<int>(_crashReportingMode), "crashReportingMode");
emit crashReportingModeChanged(_crashReportingMode);
}

View file

@ -24,8 +24,19 @@ public:
void setShowTipsOnStartup(bool _showTipsOnStartup);
void setSeenTips(const QList<int> &_seenTips);
enum class CrashReportingMode
{
Ask = 0,
AlwaysSend = 1,
NeverSend = 2
};
[[nodiscard]] CrashReportingMode getCrashReportingMode() const;
void setCrashReportingMode(CrashReportingMode _crashReportingMode);
signals:
void langChanged();
void crashReportingModeChanged(CrashReportingMode mode);
public:
explicit PersonalSettings(const QString &settingPath, QObject *parent = nullptr);