mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 00:06:16 -07:00
Fix asking to install Python
The dialog asking users to install python is borked since the last refactor, this commit fixes it.
This commit is contained in:
parent
60ecc4fe8f
commit
7d808cfc99
4 changed files with 45 additions and 75 deletions
|
@ -77,7 +77,8 @@ namespace
|
|||
return false;
|
||||
}
|
||||
|
||||
LogMsg(QCoreApplication::translate("Utils::ForeignApps", "Python detected, version: %1").arg(info.version), Log::INFO);
|
||||
LogMsg(QCoreApplication::translate("Utils::ForeignApps", "Python detected, executable name: '%1', version: %2")
|
||||
.arg(info.executableName, info.version), Log::INFO);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -236,6 +237,14 @@ bool Utils::ForeignApps::PythonInfo::isValid() const
|
|||
return (!executableName.isEmpty() && version.isValid());
|
||||
}
|
||||
|
||||
bool Utils::ForeignApps::PythonInfo::isSupportedVersion() const
|
||||
{
|
||||
const int majorVer = version.majorNumber();
|
||||
return ((majorVer > 3)
|
||||
|| ((majorVer == 3) && (version >= Version {3, 3, 0}))
|
||||
|| ((majorVer == 2) && (version >= Version {2, 7, 9})));
|
||||
}
|
||||
|
||||
PythonInfo Utils::ForeignApps::pythonInfo()
|
||||
{
|
||||
static PythonInfo pyInfo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue