File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 66
77#include " config.h"
88
9+ #include " common/asserts.h"
10+ #include " common/utility.h"
911#include " configfile.h"
1012#include " theme.h"
11- #include " version.h"
12- #include " common/utility.h"
13- #include " common/asserts.h"
13+ #include " updatechannel.h"
1414#include " version.h"
1515
1616#include " creds/abstractcredentials.h"
@@ -1216,6 +1216,9 @@ void ConfigFile::setDesktopEnterpriseChannel(const QString &channel)
12161216{
12171217 QSettings settings (configFile (), QSettings::IniFormat);
12181218 settings.setValue (QLatin1String (desktopEnterpriseChannelName), channel);
1219+ const auto currentUpdateChannel = UpdateChannel::fromString (this ->currentUpdateChannel ());
1220+ const auto newEnterpriseUpdateChannel = UpdateChannel::fromString (channel);
1221+ setUpdateChannel (UpdateChannel::mostStable (currentUpdateChannel, newEnterpriseUpdateChannel).toString ());
12191222}
12201223
12211224QString ConfigFile::language () const
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ QString UpdateChannel::toString() const
2525
2626std::strong_ordering UpdateChannel::operator <=>(const UpdateChannel &rhs) const = default ;
2727
28+ UpdateChannel UpdateChannel::mostStable (const UpdateChannel &a, const UpdateChannel &b)
29+ {
30+ return std::max (a, b);
31+ }
32+
2833UpdateChannel UpdateChannel::fromString (const QString &channelName) // static
2934{
3035 using enum ChannelName;
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class UpdateChannel
2727 std::strong_ordering operator <=>(const UpdateChannel &rhs) const ;
2828
2929 static UpdateChannel fromString (const QString &channelName);
30+ static UpdateChannel mostStable (const UpdateChannel &a, const UpdateChannel &b);
3031
3132private:
3233 UpdateChannel ();
You can’t perform that action at this time.
0 commit comments