Remove checks for the update channel from the getter function.
authorCamila Ayres <hello@camilasan.com>
Thu, 17 Oct 2024 07:35:02 +0000 (09:35 +0200)
committerCamila Ayres <hello@camilasan.com>
Thu, 31 Oct 2024 12:06:02 +0000 (13:06 +0100)
It should only return the value.

Signed-off-by: Camila Ayres <hello@camilasan.com>
src/libsync/configfile.cpp

index 7e62925c79d2907d0ebdd1d0bb2f31e5713340f1..1f571de3c42cf420108f8ae16e68f8d3a8b138ea 100644 (file)
@@ -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)