mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-27 00:14:40 -07:00
improve/add comments
This commit is contained in:
parent
8c126cdf7e
commit
66d81e6f14
1 changed files with 3 additions and 1 deletions
|
|
@ -44,7 +44,7 @@ void ReleaseChannel::checkForUpdates()
|
||||||
connect(response, &QNetworkReply::finished, this, &ReleaseChannel::releaseListFinished);
|
connect(response, &QNetworkReply::finished, this, &ReleaseChannel::releaseListFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Different release channel checking functions for different operating systems
|
// Find compatible assets for host platform (Linux is not supported by in-client updater)
|
||||||
std::optional<int> ReleaseChannel::getTargetVersionForCurrentOS(const QString &fileName)
|
std::optional<int> ReleaseChannel::getTargetVersionForCurrentOS(const QString &fileName)
|
||||||
{
|
{
|
||||||
const QRegularExpression *regex = nullptr;
|
const QRegularExpression *regex = nullptr;
|
||||||
|
|
@ -75,6 +75,7 @@ std::optional<int> ReleaseChannel::getTargetVersionForCurrentOS(const QString &f
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Any asset targeting an OS version smaller or equal to the current host works
|
||||||
const int systemVersion = QSysInfo::productVersion().split('.').first().toInt();
|
const int systemVersion = QSysInfo::productVersion().split('.').first().toInt();
|
||||||
auto match = regex->match(fileName);
|
auto match = regex->match(fileName);
|
||||||
if (!match.hasMatch()) {
|
if (!match.hasMatch()) {
|
||||||
|
|
@ -87,6 +88,7 @@ std::optional<int> ReleaseChannel::getTargetVersionForCurrentOS(const QString &f
|
||||||
return targetVersion;
|
return targetVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pick newest targeted version (highest number) amongst all compatible ones
|
||||||
QString ReleaseChannel::findBestDownloadUrl(const QVariantList &assets)
|
QString ReleaseChannel::findBestDownloadUrl(const QVariantList &assets)
|
||||||
{
|
{
|
||||||
QString bestUrl;
|
QString bestUrl;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue