From b406d669b344d2332d3d47d3d43c652894a30510 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 22 May 2023 12:37:02 +0800 Subject: [PATCH] Bump python version minimum requirement PR #18996. --- INSTALL | 2 +- src/base/utils/foreignapps.cpp | 2 +- src/gui/mainwindow.cpp | 15 +++++++++++++-- src/gui/programupdater.cpp | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/INSTALL b/INSTALL index b42888d76..b9ee6bea6 100644 --- a/INSTALL +++ b/INSTALL @@ -18,7 +18,7 @@ qBittorrent - A BitTorrent client in C++ / Qt - pkg-config * * Compile-time only on *nix systems - - Python >= 3.5.0 + - Python >= 3.7.0 * Optional, run-time only * Used by the bundled search engine diff --git a/src/base/utils/foreignapps.cpp b/src/base/utils/foreignapps.cpp index cecbd4591..87a38c9b1 100644 --- a/src/base/utils/foreignapps.cpp +++ b/src/base/utils/foreignapps.cpp @@ -248,7 +248,7 @@ bool Utils::ForeignApps::PythonInfo::isValid() const bool Utils::ForeignApps::PythonInfo::isSupportedVersion() const { - return (version >= Version {3, 5, 0}); + return (version >= Version {3, 7, 0}); } PythonInfo Utils::ForeignApps::pythonInfo() diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 126216f7b..1ddc56e7e 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -29,9 +29,16 @@ #include "mainwindow.h" +#include + #include #include +#if defined(Q_OS_WIN) +#include +#include // must follow after Windows.h +#endif + #include #include #include @@ -1962,9 +1969,13 @@ void MainWindow::installPython() setCursor(QCursor(Qt::WaitCursor)); // Download python #ifdef QBT_APP_64BIT - const auto installerURL = u"https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe"_qs; + const auto installerURL = ::IsWindows8OrGreater() + ? u"https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe"_qs + : u"https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe"_qs; #else - const auto installerURL = u"https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe"_qs; + const auto installerURL = ::IsWindows8OrGreater() + ? u"https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe"_qs + : u"https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe"_qs; #endif Net::DownloadManager::instance()->download( Net::DownloadRequest(installerURL).saveToFile(true) diff --git a/src/gui/programupdater.cpp b/src/gui/programupdater.cpp index 7d6de7807..f10c9638c 100644 --- a/src/gui/programupdater.cpp +++ b/src/gui/programupdater.cpp @@ -29,6 +29,8 @@ #include "programupdater.h" +#include + #if defined(Q_OS_WIN) #include #include // must follow after Windows.h