mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-14 16:57:55 +00:00
Remove Windows XP remnants
This commit is contained in:
parent
cdb0db02f9
commit
3ab2fe907f
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
{
|
||||
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\"");
|
||||
}
|
||||
|
||||
// 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");
|
||||
|
||||
// Reload search engine
|
||||
if (Utils::ForeignApps::pythonInfo().isSupportedVersion()) {
|
||||
m_ui->actionSearchWidget->setChecked(true);
|
||||
|
Loading…
Reference in New Issue
Block a user