Skip to content

Commit adb7f90

Browse files
committed
fix: Do not overwrite the update channel with enterprise
but override it. Signed-off-by: Tamás Bari <[email protected]>
1 parent 15aee4a commit adb7f90

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/libsync/configfile.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,9 @@ QString ConfigFile::defaultUpdateChannel() const
720720
QString ConfigFile::currentUpdateChannel() const
721721
{
722722
QSettings settings(configFile(), QSettings::IniFormat);
723-
return settings.value(QLatin1String(updateChannelC), defaultUpdateChannel()).toString();
723+
const auto currentChannel = UpdateChannel::fromString(settings.value(QLatin1String(updateChannelC), defaultUpdateChannel()).toString());
724+
const auto enterpriseChannel = UpdateChannel::fromString(desktopEnterpriseChannel());
725+
return UpdateChannel::mostStable(currentChannel, enterpriseChannel).toString();
724726
}
725727

726728
void ConfigFile::setUpdateChannel(const QString &channel)
@@ -1215,10 +1217,9 @@ QString ConfigFile::desktopEnterpriseChannel() const
12151217
void ConfigFile::setDesktopEnterpriseChannel(const QString &channel)
12161218
{
12171219
QSettings settings(configFile(), QSettings::IniFormat);
1218-
settings.setValue(QLatin1String(desktopEnterpriseChannelName), channel);
1219-
const auto currentUpdateChannel = UpdateChannel::fromString(this->currentUpdateChannel());
1220+
const auto currentEnterpriseChannel = UpdateChannel::fromString(desktopEnterpriseChannel());
12201221
const auto newEnterpriseUpdateChannel = UpdateChannel::fromString(channel);
1221-
setUpdateChannel(UpdateChannel::mostStable(currentUpdateChannel, newEnterpriseUpdateChannel).toString());
1222+
settings.setValue(QLatin1String(desktopEnterpriseChannelName), UpdateChannel::mostStable(currentEnterpriseChannel, newEnterpriseUpdateChannel).toString());
12221223
}
12231224

12241225
QString ConfigFile::language() const

0 commit comments

Comments
 (0)