Skip to content

Commit

Permalink
Remove checks for the update channel from the getter function.
Browse files Browse the repository at this point in the history
It should only return the value.

Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Oct 17, 2024
1 parent 9753921 commit 18a071a
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,32 +707,25 @@ QString ConfigFile::defaultUpdateChannel() const
if (serverHasValidSubscription() && !isBranded) {
if (const auto serverChannel = desktopEnterpriseChannel();
validUpdateChannels().contains(serverChannel)) {
qCWarning(lcConfigFile()) << "Enforcing update channel" << serverChannel << "because that is the desktop enterprise channel returned by the server.";
qCWarning(lcConfigFile()) << "Default update channel is" << serverChannel << "because that is the desktop enterprise channel returned by the server.";
return serverChannel;
}
}

if (const auto currentVersionSuffix = Theme::instance()->versionSuffix();
validUpdateChannels().contains(currentVersionSuffix) && !isBranded) {
qCWarning(lcConfigFile()) << "Enforcing update channel" << currentVersionSuffix << "because of the version suffix of the current client.";
qCWarning(lcConfigFile()) << "Default update channel is" << currentVersionSuffix << "because of the version suffix of the current client.";
return currentVersionSuffix;
}

qCWarning(lcConfigFile()) << "Enforcing default update channel" << defaultUpdateChannelName;
qCWarning(lcConfigFile()) << "Default update channel is" << defaultUpdateChannelName;
return defaultUpdateChannelName;
}

QString ConfigFile::currentUpdateChannel() const
{
auto updateChannel = defaultUpdateChannel();
QSettings settings(configFile(), QSettings::IniFormat);
if (const auto configUpdateChannel = settings.value(QLatin1String(updateChannelC), updateChannel).toString();
validUpdateChannels().contains(configUpdateChannel)) {
qCWarning(lcConfigFile()) << "Config file has a valid update channel:" << configUpdateChannel;
updateChannel = configUpdateChannel;
}

return updateChannel;
return settings.value(QLatin1String(updateChannelC), defaultUpdateChannel()).toString();
}

void ConfigFile::setUpdateChannel(const QString &channel)
Expand Down

0 comments on commit 18a071a

Please sign in to comment.