1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Don't use list of versions for the Python fallback detection on Windows

Always pick the newest versions among those installed.
This commit is contained in:
Gabriele 2015-03-01 21:00:00 +01:00
parent f4c44ce128
commit 6609d3e89f

View File

@ -1763,11 +1763,12 @@ QString Preferences::getPythonPath()
return path; return path;
// Fallback: Detect python from default locations // Fallback: Detect python from default locations
QStringList supported_versions; const QStringList dirs = QDir("C:/").entryList(QStringList("Python*"), QDir::Dirs, QDir::Name | QDir::Reversed);
supported_versions << "34" << "33" << "32" << "31" << "30" << "27" << "26" << "25"; foreach (const QString &dir, dirs) {
foreach (const QString &v, supported_versions) const QString path("C:/" + dir + "/python.exe");
if (QFile::exists("C:/Python" + v + "/python.exe")) if (QFile::exists(path))
return "C:/Python" + v; return path;
}
return QString(); return QString();
} }