Skip to content

Commit

Permalink
Add new update channels.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Jun 3, 2024
1 parent e1b96c2 commit fca12f6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ void GeneralSettings::slotUpdateChannelChanged()
decodedTranslatedChannel = tr("stable");
} else if (channel == QStringLiteral("beta")) {
decodedTranslatedChannel = tr("beta");
} else if (channel == QStringLiteral("daily")) {
decodedTranslatedChannel = tr("daily");
} else if (channel == QStringLiteral("enterprise")) {
decodedTranslatedChannel = tr("enterprise");
}

return decodedTranslatedChannel;
Expand Down
12 changes: 10 additions & 2 deletions src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ static constexpr char forceLoginV2C[] = "forceLoginV2";
static constexpr char certPath[] = "http_certificatePath";
static constexpr char certPasswd[] = "http_certificatePasswd";

static const QSet validUpdateChannels { QStringLiteral("stable"), QStringLiteral("beta") };
static const QStringList validUpdateChannels { QStringLiteral("stable"),

Check warning on line 113 in src/libsync/configfile.cpp

View workflow job for this annotation

GitHub Actions / build

src/libsync/configfile.cpp:113:26 [readability-static-definition-in-anonymous-namespace]

'validUpdateChannels' is a static definition in anonymous namespace; static is redundant here
QStringLiteral("beta"),
QStringLiteral("daily"),
QStringLiteral("enterprise") };
}

namespace OCC {
Expand Down Expand Up @@ -688,7 +691,7 @@ int ConfigFile::updateSegment() const

QString ConfigFile::updateChannel() const
{
QString defaultUpdateChannel = QStringLiteral("stable");
QString defaultUpdateChannel = QStringLiteral("enterprise");
QString suffix = QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION_SUFFIX));
if (suffix.startsWith("daily")
|| suffix.startsWith("nightly")
Expand All @@ -711,6 +714,11 @@ QString ConfigFile::updateChannel() const
return channel;
}

QStringList ConfigFile::validUpdateChannel() const
{
return validUpdateChannels;
}

void ConfigFile::setUpdateChannel(const QString &channel)
{
if (!validUpdateChannels.contains(channel)) {
Expand Down
1 change: 1 addition & 0 deletions src/libsync/configfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ class OWNCLOUDSYNC_EXPORT ConfigFile
[[nodiscard]] int updateSegment() const;

[[nodiscard]] QString updateChannel() const;
[[nodiscard]] QStringList validUpdateChannel() const;
void setUpdateChannel(const QString &channel);

[[nodiscard]] QString overrideServerUrl() const;
Expand Down

0 comments on commit fca12f6

Please sign in to comment.