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 Apr 15, 2024
1 parent d9d4101 commit f036d10
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"pins" : [
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire",
"state" : {
"revision" : "723fa5a6c65812aec4a0d7cc432ee198883b6e00",
"version" : "5.9.0"
}
},
{
"identity" : "mocker",
"kind" : "remoteSourceControl",
"location" : "https://github.com/WeTransfer/Mocker.git",
"state" : {
"revision" : "5d86f27a8f80d4ba388bc1a379a3c2289a1f3d18",
"version" : "2.6.0"
}
},
{
"identity" : "nextcloudkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/nextcloud/NextcloudKit.git",
"state" : {
"branch" : "develop",
"revision" : "fa460bb123af087fd2f422aeeb76addc91cd903f"
}
},
{
"identity" : "realm-core",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-core.git",
"state" : {
"revision" : "b77443ca7fa25407869ca537bf3ae912b1427bff",
"version" : "12.13.0"
}
},
{
"identity" : "realm-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-swift.git",
"state" : {
"revision" : "b442ee3e9caa1abab26fd9b23f060f6f0815ff48",
"version" : "10.33.0"
}
},
{
"identity" : "swiftyjson",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftyJSON/SwiftyJSON",
"state" : {
"revision" : "b3dcd7dbd0d488e1a7077cb33b00f2083e382f07",
"version" : "5.0.1"
}
},
{
"identity" : "swiftyxmlparser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/yahoojapan/SwiftyXMLParser",
"state" : {
"revision" : "d7a1d23f04c86c1cd2e8f19247dd15d74e0ea8be",
"version" : "5.6.0"
}
}
],
"version" : 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"pins" : [
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire",
"state" : {
"revision" : "723fa5a6c65812aec4a0d7cc432ee198883b6e00",
"version" : "5.9.0"
}
},
{
"identity" : "mocker",
"kind" : "remoteSourceControl",
"location" : "https://github.com/WeTransfer/Mocker.git",
"state" : {
"revision" : "5d86f27a8f80d4ba388bc1a379a3c2289a1f3d18",
"version" : "2.6.0"
}
},
{
"identity" : "nextcloudkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/nextcloud/NextcloudKit.git",
"state" : {
"branch" : "develop",
"revision" : "fa460bb123af087fd2f422aeeb76addc91cd903f"
}
},
{
"identity" : "realm-core",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-core.git",
"state" : {
"revision" : "b77443ca7fa25407869ca537bf3ae912b1427bff",
"version" : "12.13.0"
}
},
{
"identity" : "realm-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-swift.git",
"state" : {
"revision" : "b442ee3e9caa1abab26fd9b23f060f6f0815ff48",
"version" : "10.33.0"
}
},
{
"identity" : "swiftyjson",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftyJSON/SwiftyJSON",
"state" : {
"revision" : "b3dcd7dbd0d488e1a7077cb33b00f2083e382f07",
"version" : "5.0.1"
}
},
{
"identity" : "swiftyxmlparser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/yahoojapan/SwiftyXMLParser",
"state" : {
"revision" : "d7a1d23f04c86c1cd2e8f19247dd15d74e0ea8be",
"version" : "5.6.0"
}
}
],
"version" : 2
}
4 changes: 4 additions & 0 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,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 f036d10

Please sign in to comment.