From d0374dd4250dab8ee6e1712047bba4fb71a3e985 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 14 Sep 2014 21:58:20 +0300 Subject: [PATCH] WINDOWS: Search first in PATH for python. Closes #956. Conflicts: src/mainwindow.cpp --- src/mainwindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1e91f49ce..a23212bb6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -458,6 +458,7 @@ void MainWindow::displayRSSTab(bool enable) { } void MainWindow::displaySearchTab(bool enable) { + Preferences().setSearchEnabled(enable); if (enable) { // RSS tab if (!searchEngine) { @@ -1339,7 +1340,14 @@ void MainWindow::on_actionRSS_Reader_triggered() { void MainWindow::on_actionSearch_engine_triggered() { #ifdef Q_OS_WIN if (!has_python && actionSearch_engine->isChecked()) { - bool res = addPythonPathToEnv(); + bool res = false; + + // Check if python is already in PATH + if (misc::pythonVersion()) + res = true; + else + res = addPythonPathToEnv(); + if (res) has_python = true; else if (QMessageBox::question(this, tr("Missing Python Interpreter"), @@ -1556,7 +1564,6 @@ void MainWindow::pythonDownloadSuccess(QString url, QString file_path) { has_python = addPythonPathToEnv(); if (has_python) { actionSearch_engine->setChecked(true); - Preferences().setSearchEnabled(true); displaySearchTab(true); } sender()->deleteLater();