mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Revert "Drop python2 support.". Closes #7005.
This reverts commit 7d030b4cd9
.
This commit is contained in:
parent
247d07edb9
commit
7a478424cc
11 changed files with 1231 additions and 22 deletions
|
@ -1598,14 +1598,17 @@ void MainWindow::on_actionSearchWidget_triggered()
|
|||
|
||||
bool res = false;
|
||||
|
||||
if (pythonVersion == 3) {
|
||||
// Check Python minimum requirement: 3.3.0
|
||||
if ((pythonVersion == 2) || (pythonVersion == 3)) {
|
||||
// Check Python minimum requirement: 2.7.9 / 3.3.0
|
||||
QString version = Utils::Misc::pythonVersionComplete();
|
||||
QStringList splitted = version.split('.');
|
||||
if (splitted.size() > 1) {
|
||||
if (splitted.size() > 2) {
|
||||
int middleVer = splitted.at(1).toInt();
|
||||
if ((pythonVersion == 3) && (middleVer < 3)) {
|
||||
QMessageBox::information(this, tr("Old Python Interpreter"), tr("Your Python version (%1) is outdated. Please upgrade to latest version for search engines to work.\nMinimum requirement: 3.3.0.").arg(version));
|
||||
int lowerVer = splitted.at(2).toInt();
|
||||
if (((pythonVersion == 2) && (middleVer < 7))
|
||||
|| ((pythonVersion == 2) && (middleVer == 7) && (lowerVer < 9))
|
||||
|| ((pythonVersion == 3) && (middleVer < 3))) {
|
||||
QMessageBox::information(this, tr("Old Python Interpreter"), tr("Your Python version (%1) is outdated. Please upgrade to latest version for search engines to work.\nMinimum requirement: 2.7.9 / 3.3.0.").arg(version));
|
||||
m_ui->actionSearchWidget->setChecked(false);
|
||||
Preferences::instance()->setSearchEnabled(false);
|
||||
return;
|
||||
|
@ -1621,12 +1624,6 @@ void MainWindow::on_actionSearchWidget_triggered()
|
|||
return;
|
||||
}
|
||||
}
|
||||
else if (pythonVersion != -1) {
|
||||
QMessageBox::information(this, tr("Incompatible Python version"), tr("Your Python version (%1) is incompatible. Please use Python 3 for search engines to work.\nMinimum requirement: 3.3.0.").arg(Utils::Misc::pythonVersionComplete()));
|
||||
m_ui->actionSearchWidget->setChecked(false);
|
||||
Preferences::instance()->setSearchEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (res) {
|
||||
m_hasPython = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue