Drop python2 support.

This commit is contained in:
sledgehammer999 2017-06-22 18:52:13 +03:00
parent a77e1c9f36
commit 7d030b4cd9
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
11 changed files with 22 additions and 1231 deletions

View file

@ -1598,17 +1598,14 @@ void MainWindow::on_actionSearchWidget_triggered()
bool res = false;
if ((pythonVersion == 2) || (pythonVersion == 3)) {
// Check Python minimum requirement: 2.7.9 / 3.3.0
if (pythonVersion == 3) {
// Check Python minimum requirement: 3.3.0
QString version = Utils::Misc::pythonVersionComplete();
QStringList splitted = version.split('.');
if (splitted.size() > 2) {
if (splitted.size() > 1) {
int middleVer = splitted.at(1).toInt();
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));
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));
m_ui->actionSearchWidget->setChecked(false);
Preferences::instance()->setSearchEnabled(false);
return;
@ -1624,6 +1621,12 @@ 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;