Qt: Redo stable branch detection heuristic

This commit is contained in:
Vicki Pfau 2022-12-31 18:15:47 -08:00
parent 9f8679ffa6
commit 819d19dddc
2 changed files with 6 additions and 4 deletions

View File

@ -18,11 +18,11 @@ Other fixes:
- GBA: Fix forceskip BIOS logic for multiboot ROMs (fixes mgba.io/i/2753) - 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) - 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: 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: 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: 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: Improve handling of multiplayer syncing (fixes mgba.io/i/2720)
- Qt: Fix initializing update revision info - 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) - 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 - VFS: Fix minizip write returning 0 on success instead of size
Misc: Misc:

View File

@ -7,6 +7,7 @@
#include <QDir> #include <QDir>
#include <QFileInfo> #include <QFileInfo>
#include <QRegularExpression>
#include "ApplicationUpdatePrompt.h" #include "ApplicationUpdatePrompt.h"
#include "ConfigController.h" #include "ConfigController.h"
@ -71,9 +72,10 @@ QStringList ApplicationUpdater::listChannels() {
} }
QString ApplicationUpdater::currentChannel() { QString ApplicationUpdater::currentChannel() {
QLatin1String version(projectVersion); QString version(projectVersion);
QLatin1String branch(gitBranch); QString branch(gitBranch);
if (branch == QLatin1String("heads/") + version || branch == version) { QRegularExpression stable("^(?:(?:refs/)?(?:tags|heads)/)?[0-9]+\\.[0-9]+\\.[0-9]+$");
if (branch.contains(stable) || (branch == "(unknown)" && version.contains(stable))) {
return QLatin1String("stable"); return QLatin1String("stable");
} else { } else {
return QLatin1String("dev"); return QLatin1String("dev");