Compare commits

..

No commits in common. "66d81e6f14364e854b808045d9cdd81009dd4c07" and "42d001ee6ada86d9cf93c6c42f0e8b142c938d4c" have entirely different histories.

View file

@ -44,7 +44,7 @@ void ReleaseChannel::checkForUpdates()
connect(response, &QNetworkReply::finished, this, &ReleaseChannel::releaseListFinished);
}
// Find compatible assets for host platform (Linux is not supported by in-client updater)
// Different release channel checking functions for different operating systems
std::optional<int> ReleaseChannel::getTargetVersionForCurrentOS(const QString &fileName)
{
const QRegularExpression *regex = nullptr;
@ -60,14 +60,13 @@ std::optional<int> ReleaseChannel::getTargetVersionForCurrentOS(const QString &f
}
return false;
}();
static const QRegularExpression macIntelRegex(R"(-macOS(\d+)_Intel\.[^.]+$)",
static const QRegularExpression macIntelRegex(R"(macOS(\d+)_Intel\.[^.]+$)",
QRegularExpression::CaseInsensitiveOption);
static const QRegularExpression macArmRegex(R"(-macOS(\d+)\.[^.]+$)", QRegularExpression::CaseInsensitiveOption);
static const QRegularExpression macArmRegex(R"(macOS(\d+)\.[^.]+$)", QRegularExpression::CaseInsensitiveOption);
regex = isIntel ? &macIntelRegex : &macArmRegex;
#elif defined(Q_OS_WIN)
static const QRegularExpression winRegex(R"(-(?:Win|Windows)(\d+)\.[^.]+$)",
QRegularExpression::CaseInsensitiveOption);
static const QRegularExpression winRegex(R"(Win(?:dows)?(\d+)\.[^.]+$)", QRegularExpression::CaseInsensitiveOption);
regex = &winRegex;
#else // if the OS doesn't fit one of the above #defines, then it will never match
@ -75,7 +74,6 @@ std::optional<int> ReleaseChannel::getTargetVersionForCurrentOS(const QString &f
return std::nullopt;
#endif
// Any asset targeting an OS version smaller or equal to the current host works
const int systemVersion = QSysInfo::productVersion().split('.').first().toInt();
auto match = regex->match(fileName);
if (!match.hasMatch()) {
@ -88,7 +86,6 @@ std::optional<int> ReleaseChannel::getTargetVersionForCurrentOS(const QString &f
return targetVersion;
}
// Pick newest targeted version (highest number) amongst all compatible ones
QString ReleaseChannel::findBestDownloadUrl(const QVariantList &assets)
{
QString bestUrl;