From b515553a29914989d473d7b3f5603bcc58f9809a Mon Sep 17 00:00:00 2001 From: nerix Date: Sun, 16 Mar 2025 13:40:18 +0100 Subject: [PATCH] fix: don't add tests to autostart (#6084) --- CHANGELOG.md | 1 + src/util/WindowsHelper.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc0f6fd3..cbeef191 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,7 @@ - Dev: Mini feature refactor of BaseWindow. (#6074) - Dev: Removed dead code and some MSVC warnings. (#6024) - Dev: Added check if WEBP is supported. (#6073) +- Dev: Tests won't add themselves to the autostart on Windows anymore. (#6084) ## 2.5.2 diff --git a/src/util/WindowsHelper.cpp b/src/util/WindowsHelper.cpp index 6584604d..14dfcafe 100644 --- a/src/util/WindowsHelper.cpp +++ b/src/util/WindowsHelper.cpp @@ -1,5 +1,6 @@ #include "util/WindowsHelper.hpp" +#include "Application.hpp" #include "common/Literals.hpp" #include @@ -64,6 +65,12 @@ bool isRegisteredForStartup() void setRegisteredForStartup(bool isRegistered) { + auto *app = tryGetApp(); + if (app && app->isTest()) + { + return; + } + QSettings settings(RUN_KEY, QSettings::NativeFormat); if (isRegistered)