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:
Chocobo1 2018-09-06 15:31:14 +08:00
parent 60ecc4fe8f
commit 7d808cfc99
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
4 changed files with 45 additions and 75 deletions

View file

@ -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;