mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 13:41:26 -07:00
parent
54b50c3a8a
commit
33e6ca6778
9 changed files with 178 additions and 178 deletions
|
@ -52,25 +52,21 @@ namespace
|
|||
{
|
||||
bool isVersionMoreRecent(const QString &remoteVersion)
|
||||
{
|
||||
using Version = Utils::Version<int, 4, 3>;
|
||||
using Version = Utils::Version<4, 3>;
|
||||
|
||||
try
|
||||
{
|
||||
const Version newVersion {remoteVersion};
|
||||
const Version currentVersion {QBT_VERSION_MAJOR, QBT_VERSION_MINOR, QBT_VERSION_BUGFIX, QBT_VERSION_BUILD};
|
||||
if (newVersion == currentVersion)
|
||||
{
|
||||
const bool isDevVersion = QStringLiteral(QBT_VERSION_STATUS).contains(
|
||||
QRegularExpression(u"(alpha|beta|rc)"_qs));
|
||||
if (isDevVersion)
|
||||
return true;
|
||||
}
|
||||
return (newVersion > currentVersion);
|
||||
}
|
||||
catch (const RuntimeError &)
|
||||
{
|
||||
const auto newVersion = Version::fromString(remoteVersion);
|
||||
if (!newVersion.isValid())
|
||||
return false;
|
||||
|
||||
const Version currentVersion {QBT_VERSION_MAJOR, QBT_VERSION_MINOR, QBT_VERSION_BUGFIX, QBT_VERSION_BUILD};
|
||||
if (newVersion == currentVersion)
|
||||
{
|
||||
const bool isDevVersion = QStringLiteral(QBT_VERSION_STATUS).contains(
|
||||
QRegularExpression(u"(alpha|beta|rc)"_qs));
|
||||
if (isDevVersion)
|
||||
return true;
|
||||
}
|
||||
return (newVersion > currentVersion);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue