From 88626b26d2961a165ff20ab4a95e308ef2c9beb1 Mon Sep 17 00:00:00 2001 From: ngosang Date: Wed, 1 Jun 2016 11:56:18 +0200 Subject: [PATCH] Update Python version requirements --- src/gui/mainwindow.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 25c22b1b7..d83d3c4df 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1494,13 +1494,16 @@ void MainWindow::on_actionSearchWidget_triggered() bool res = false; if ((pythonVersion == 2) || (pythonVersion == 3)) { - // Check python minimum requirement: 2.7.0/3.3.0 + // 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 == 2) && (middleVer < 7)) || ((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. Minimum requirement: 2.7.0/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;