From f508a4d1bb1729a5743b24ddc55674436baa6604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sun, 18 Oct 2026 23:25:48 +0200 Subject: [PATCH] [CrashReporting] Match the dump scan to the writer's temp fallback Review nit: when the handler's SHGetKnownFolderPath lookup fails it writes to /../.., but the startup scan looked in QDir::tempPath(), so a dump produced through the fallback would never be found and its crash would never offer to be reported. Walk up the same two levels in the scan. The path is Windows-only (#ifdef Q_OS_WIN); the statements were compiled and run standalone against Qt 6 to confirm the API use. --- cockatrice/src/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index c211ed6a8..081711e89 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -467,11 +467,15 @@ int main(int argc, char *argv[]) { QString crashDumpDir; #ifdef Q_OS_WIN - // Mirrors the writer's location: %LOCALAPPDATA%/CrashDumps/Cockatrice, with the same - // temp-path fallback the writer uses when the known-folder lookup fails. + // Mirrors the writer's location: %LOCALAPPDATA%/CrashDumps/Cockatrice. When the handler's + // known-folder lookup fails it falls back to /../.., so the scan has to walk up the + // same two levels; plain QDir::tempPath() would look in a directory nothing ever writes to. crashDumpDir = QString::fromLocal8Bit(qgetenv("LOCALAPPDATA")) + "/CrashDumps/Cockatrice"; if (qgetenv("LOCALAPPDATA").isEmpty()) { - crashDumpDir = QDir::tempPath(); + QDir fallback(QDir::tempPath()); + fallback.cdUp(); + fallback.cdUp(); + crashDumpDir = fallback.absolutePath(); } #else crashDumpDir = QDir::tempPath();