mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
Fix python detection from reigstry when multiple versions are installed. Update fallback mechanism for newer versions.
This commit is contained in:
parent
f3dd93a42c
commit
cc8419d344
1 changed files with 2 additions and 2 deletions
|
@ -1636,7 +1636,7 @@ namespace {
|
||||||
|
|
||||||
for (DWORD i = 0; i < cSubKeys; ++i) {
|
for (DWORD i = 0; i < cSubKeys; ++i) {
|
||||||
cName = cMaxSubKeyLen;
|
cName = cMaxSubKeyLen;
|
||||||
res = ::RegEnumKeyExW(handle, 0, lpName, &cName, NULL, NULL, NULL, NULL);
|
res = ::RegEnumKeyExW(handle, i, lpName, &cName, NULL, NULL, NULL, NULL);
|
||||||
if (res == ERROR_SUCCESS)
|
if (res == ERROR_SUCCESS)
|
||||||
keys.push_back(QString::fromWCharArray(lpName));
|
keys.push_back(QString::fromWCharArray(lpName));
|
||||||
}
|
}
|
||||||
|
@ -1751,7 +1751,7 @@ QString Preferences::getPythonPath()
|
||||||
|
|
||||||
// Fallback: Detect python from default locations
|
// Fallback: Detect python from default locations
|
||||||
QStringList supported_versions;
|
QStringList supported_versions;
|
||||||
supported_versions << "32" << "31" << "30" << "27" << "26" << "25";
|
supported_versions << "34" << "33" << "32" << "31" << "30" << "27" << "26" << "25";
|
||||||
foreach (const QString &v, supported_versions)
|
foreach (const QString &v, supported_versions)
|
||||||
if (QFile::exists("C:/Python" + v + "/python.exe"))
|
if (QFile::exists("C:/Python" + v + "/python.exe"))
|
||||||
return "C:/Python" + v;
|
return "C:/Python" + v;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue