mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-29 18:13:55 -07:00
Fix MacOS Finding releases (#5589)
This commit is contained in:
parent
86161185d9
commit
eb2c71d381
1 changed files with 2 additions and 4 deletions
|
|
@ -42,7 +42,7 @@ void ReleaseChannel::checkForUpdates()
|
||||||
#if defined(Q_OS_MACOS)
|
#if defined(Q_OS_MACOS)
|
||||||
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
||||||
{
|
{
|
||||||
static QRegularExpression version_regex("macOS-(\\d+)\\.(\\d+)");
|
static QRegularExpression version_regex("macOS(\\d+)");
|
||||||
auto match = version_regex.match(fileName);
|
auto match = version_regex.match(fileName);
|
||||||
if (!match.hasMatch()) {
|
if (!match.hasMatch()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -50,10 +50,8 @@ bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
||||||
|
|
||||||
// older(smaller) releases are compatible with a newer or the same system version
|
// older(smaller) releases are compatible with a newer or the same system version
|
||||||
int sys_maj = QSysInfo::productVersion().split(".")[0].toInt();
|
int sys_maj = QSysInfo::productVersion().split(".")[0].toInt();
|
||||||
int sys_min = QSysInfo::productVersion().split(".")[1].toInt();
|
|
||||||
int rel_maj = match.captured(1).toInt();
|
int rel_maj = match.captured(1).toInt();
|
||||||
int rel_min = match.captured(2).toInt();
|
return rel_maj == sys_maj;
|
||||||
return rel_maj < sys_maj || (rel_maj == sys_maj && rel_min <= sys_min);
|
|
||||||
}
|
}
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue