change the release channel based on version string

This commit is contained in:
ebbit1q 2025-12-25 01:07:33 +01:00
parent 70f9982c29
commit e5efcfabc1
2 changed files with 35 additions and 2 deletions

View file

@ -941,6 +941,24 @@ void MainWindow::startupConfigCheck()
qCInfo(WindowMainStartupShortcutsLog) << "[MainWindow] Migrating shortcuts after update detected.";
SettingsCache::instance().shortcuts().migrateShortcuts();
if (SettingsCache::instance().getCheckUpdatesOnStartup()) {
if (QString(VERSION_STRING).contains("custom", Qt::CaseInsensitive)) {
qCInfo(WindowMainStartupShortcutsLog)
<< "[MainWindow] Update has changed to custom version, disabling auto update";
SettingsCache::instance().setCheckUpdatesOnStartup(Qt::Unchecked);
} else {
int channel = 0;
if (QString(VERSION_STRING).contains("beta", Qt::CaseInsensitive)) {
channel = 1;
}
if (SettingsCache::instance().getUpdateReleaseChannelIndex() != channel) {
qCInfo(WindowMainStartupShortcutsLog)
<< "[MainWindow] Update has changed beta state, updating release channel.";
SettingsCache::instance().setUpdateReleaseChannelIndex(channel);
}
}
}
SettingsCache::instance().setClientVersion(VERSION_STRING);
} else {
// previous config from this version found