From 3ab2fe907f9519a9a90e072576ba6cfbbd52857d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 26 Jul 2019 23:16:35 +0800 Subject: [PATCH] Remove Windows XP remnants --- src/base/private/profile_p.cpp | 5 ----- src/gui/mainwindow.cpp | 26 ++++++-------------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/base/private/profile_p.cpp b/src/base/private/profile_p.cpp index e5a211cc85..ef5c79824b 100644 --- a/src/base/private/profile_p.cpp +++ b/src/base/private/profile_p.cpp @@ -84,11 +84,6 @@ QString Private::DefaultProfile::dataLocation() const QString Private::DefaultProfile::downloadLocation() const { -#if defined(Q_OS_WIN) - if (QSysInfo::windowsVersion() <= QSysInfo::WV_XP) // Windows XP - return QDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).absoluteFilePath( - QCoreApplication::translate("fsutils", "Downloads")); -#endif return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation); } diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 5840e2149b..44652c1c72 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -28,11 +28,6 @@ #include "mainwindow.h" -#if defined(Q_OS_WIN) -#include -#include // must follow after Windows.h -#endif - #include #include #include @@ -2007,9 +2002,7 @@ void MainWindow::installPython() { setCursor(QCursor(Qt::WaitCursor)); // Download python - const QString installerURL = (::IsWindowsVistaOrGreater() - ? "https://www.python.org/ftp/python/3.6.6/python-3.6.6.exe" - : "https://www.python.org/ftp/python/3.4.4/python-3.4.4.msi"); + const QString installerURL = "https://www.python.org/ftp/python/3.6.6/python-3.6.6.exe"; Net::DownloadManager::instance()->download( Net::DownloadRequest(installerURL).saveToFile(true) , this, &MainWindow::pythonDownloadFinished); @@ -2030,14 +2023,8 @@ void MainWindow::pythonDownloadFinished(const Net::DownloadResult &result) QProcess installer; qDebug("Launching Python installer in passive mode..."); - if (::IsWindowsVistaOrGreater()) { - QFile::rename(result.filePath, result.filePath + ".exe"); - installer.start('"' + Utils::Fs::toNativePath(result.filePath) + ".exe\" /passive"); - } - else { - QFile::rename(result.filePath, result.filePath + ".msi"); - installer.start(Utils::Misc::windowsSystemPath() + "\\msiexec.exe /passive /i \"" + Utils::Fs::toNativePath(result.filePath) + ".msi\""); - } + QFile::rename(result.filePath, result.filePath + ".exe"); + installer.start('"' + Utils::Fs::toNativePath(result.filePath) + ".exe\" /passive"); // Wait for setup to complete installer.waitForFinished(10 * 60 * 1000); @@ -2045,11 +2032,10 @@ void MainWindow::pythonDownloadFinished(const Net::DownloadResult &result) qDebug("Installer stdout: %s", installer.readAllStandardOutput().data()); qDebug("Installer stderr: %s", installer.readAllStandardError().data()); qDebug("Setup should be complete!"); + // Delete temp file - if (::IsWindowsVistaOrGreater()) - Utils::Fs::forceRemove(result.filePath + ".exe"); - else - Utils::Fs::forceRemove(result.filePath + ".msi"); + Utils::Fs::forceRemove(result.filePath + ".exe"); + // Reload search engine if (Utils::ForeignApps::pythonInfo().isSupportedVersion()) { m_ui->actionSearchWidget->setChecked(true);