From 819d19dddcba8f389bc266c2f39b2a173dd2bd6b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 31 Dec 2022 18:15:47 -0800 Subject: [PATCH] Qt: Redo stable branch detection heuristic --- CHANGES | 2 +- src/platform/qt/ApplicationUpdater.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 703038081..8fe044973 100644 --- a/CHANGES +++ b/CHANGES @@ -18,11 +18,11 @@ Other fixes: - GBA: Fix forceskip BIOS logic for multiboot ROMs (fixes mgba.io/i/2753) - GBA Cheats: Fix issues detecting unencrypted cheats (fixes mgba.io/i/2724) - Qt: Manually split filename to avoid overzealous splitting (fixes mgba.io/i/2681) - - Qt: Expand criteria for tag branch names (fixes mgba.io/i/2679) - Qt: Fix scanning specific e-Reader dotcodes (fixes mgba.io/i/2693) - Qt: Don't re-enable sync if GBA link modes aren't the same (fixes mgba.io/i/2044) - Qt: Improve handling of multiplayer syncing (fixes mgba.io/i/2720) - Qt: Fix initializing update revision info + - Qt: Redo stable branch detection heuristic (fixes mgba.io/i/2679) - Res: Fix species name location in Ruby/Sapphire revs 1/2 (fixes mgba.io/i/2685) - VFS: Fix minizip write returning 0 on success instead of size Misc: diff --git a/src/platform/qt/ApplicationUpdater.cpp b/src/platform/qt/ApplicationUpdater.cpp index e2d1e5e4c..21def050c 100644 --- a/src/platform/qt/ApplicationUpdater.cpp +++ b/src/platform/qt/ApplicationUpdater.cpp @@ -7,6 +7,7 @@ #include #include +#include #include "ApplicationUpdatePrompt.h" #include "ConfigController.h" @@ -71,9 +72,10 @@ QStringList ApplicationUpdater::listChannels() { } QString ApplicationUpdater::currentChannel() { - QLatin1String version(projectVersion); - QLatin1String branch(gitBranch); - if (branch == QLatin1String("heads/") + version || branch == version) { + QString version(projectVersion); + QString branch(gitBranch); + QRegularExpression stable("^(?:(?:refs/)?(?:tags|heads)/)?[0-9]+\\.[0-9]+\\.[0-9]+$"); + if (branch.contains(stable) || (branch == "(unknown)" && version.contains(stable))) { return QLatin1String("stable"); } else { return QLatin1String("dev");