From 45662ac4e2a79bece6ef26b12eaad548b192eed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Mon, 21 Sep 2026 11:34:52 +0200 Subject: [PATCH] ReleaseChannel: only query the OS version on updater platforms The in-client updater only ships assets for macOS and Windows, but the host system version was still being resolved on every platform, including Linux where it is never used. Compute it only under the Q_OS_MACOS / Q_OS_WIN guards. --- .../client/network/update/client/release_channel.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/client/network/update/client/release_channel.cpp b/cockatrice/src/client/network/update/client/release_channel.cpp index 3087c298a..f401dfd00 100644 --- a/cockatrice/src/client/network/update/client/release_channel.cpp +++ b/cockatrice/src/client/network/update/client/release_channel.cpp @@ -30,6 +30,7 @@ namespace { +#if defined(Q_OS_MACOS) || defined(Q_OS_WIN) // QSysInfo::productVersion() is not guaranteed to start with a number, e.g. it returns // "Server 2022" on Windows Server. Use the first numeric token as the major host version. std::optional getProductVersionMajor() @@ -45,6 +46,7 @@ std::optional getProductVersionMajor() } return version; } +#endif } // namespace @@ -76,7 +78,13 @@ std::optional ReleaseChannel::getTargetVersionForCurrentOS(const QString &f const QRegularExpression *regex = nullptr; - static const std::optional systemVersion = getProductVersionMajor(); + // Only platforms shipping updater assets (macOS, Windows) need the host version + static const std::optional systemVersion = +#if defined(Q_OS_MACOS) || defined(Q_OS_WIN) + getProductVersionMajor(); +#else + std::nullopt; +#endif if (!systemVersion) { return std::nullopt;