From e2ae28741d5e4d5b4e87e92a5f788c9934ca4226 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 7 Jan 2024 21:58:11 +1000 Subject: [PATCH] Qt: Look for a file named DefaultUpdaterChannel.h Make manual releases create this file, and make it contain #define DEFAULT_UPDATER_CHANNEL "stable" So that the release defaults to the stable update channel. --- pcsx2-qt/AutoUpdaterDialog.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pcsx2-qt/AutoUpdaterDialog.cpp b/pcsx2-qt/AutoUpdaterDialog.cpp index 2328b450c1..c649b532c1 100644 --- a/pcsx2-qt/AutoUpdaterDialog.cpp +++ b/pcsx2-qt/AutoUpdaterDialog.cpp @@ -79,8 +79,13 @@ static constexpr u32 HTTP_POLL_INTERVAL = 10; // Available release channels. static const char* UPDATE_TAGS[] = {"stable", "nightly"}; -// Bit annoying, because PCSX2_isReleaseVersion is a bool, but whatever. -#define THIS_RELEASE_TAG (PCSX2_isReleaseVersion ? "stable" : "nightly") +// TODO: Make manual releases create this file, and make it contain `#define DEFAULT_UPDATER_CHANNEL "stable"`. +#if __has_include("DefaultUpdaterChannel.h") +#include "DefaultUpdaterChannel.h" +#endif +#ifndef DEFAULT_UPDATER_CHANNEL +#define DEFAULT_UPDATER_CHANNEL "nightly" +#endif #endif @@ -135,7 +140,7 @@ QStringList AutoUpdaterDialog::getTagList() std::string AutoUpdaterDialog::getDefaultTag() { #ifdef AUTO_UPDATER_SUPPORTED - return THIS_RELEASE_TAG; + return DEFAULT_UPDATER_CHANNEL; #else return {}; #endif @@ -154,7 +159,7 @@ QString AutoUpdaterDialog::getCurrentVersionDate() QString AutoUpdaterDialog::getCurrentUpdateTag() const { #ifdef AUTO_UPDATER_SUPPORTED - return QString::fromStdString(Host::GetBaseStringSettingValue("AutoUpdater", "UpdateTag", THIS_RELEASE_TAG)); + return QString::fromStdString(Host::GetBaseStringSettingValue("AutoUpdater", "UpdateTag", DEFAULT_UPDATER_CHANNEL)); #else return QString(); #endif