change the release channel based on version string (#6447)

* change the release channel based on version string

* Apply suggestions from code review

* format
This commit is contained in:
ebbit1q 2025-12-31 17:55:31 +01:00 committed by GitHub
parent b2dd8eed3f
commit 9f90de2242
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 3 deletions

View file

@ -938,9 +938,25 @@ void MainWindow::startupConfigCheck()
const auto reloadOk0 = QtConcurrent::run([] { CardDatabaseManager::getInstance()->loadCardDatabases(); });
}
qCInfo(WindowMainStartupShortcutsLog) << "[MainWindow] Migrating shortcuts after update detected.";
qCInfo(WindowMainStartupShortcutsLog) << "Migrating shortcuts after update detected.";
SettingsCache::instance().shortcuts().migrateShortcuts();
if (SettingsCache::instance().getCheckUpdatesOnStartup()) {
if (QString(VERSION_STRING).contains("custom", Qt::CaseInsensitive)) {
qCInfo(WindowMainStartupShortcutsLog) << "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) << "Update has changed beta state, updating release channel.";
SettingsCache::instance().setUpdateReleaseChannelIndex(channel);
}
}
}
SettingsCache::instance().setClientVersion(VERSION_STRING);
} else {
// previous config from this version found