Browse Source

Remove Windows XP remnants

adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
3ab2fe907f
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 5
      src/base/private/profile_p.cpp
  2. 26
      src/gui/mainwindow.cpp

5
src/base/private/profile_p.cpp

@ -84,11 +84,6 @@ QString Private::DefaultProfile::dataLocation() const @@ -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);
}

26
src/gui/mainwindow.cpp

@ -28,11 +28,6 @@ @@ -28,11 +28,6 @@
#include "mainwindow.h"
#if defined(Q_OS_WIN)
#include <Windows.h>
#include <versionhelpers.h> // must follow after Windows.h
#endif
#include <QCloseEvent>
#include <QDebug>
#include <QDesktopServices>
@ -2007,9 +2002,7 @@ void MainWindow::installPython() @@ -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) @@ -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) @@ -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);

Loading…
Cancel
Save