Use DownloadHandler behind the scenes

This commit is contained in:
Vladimir Golovnev (Glassez) 2019-03-03 12:43:42 +03:00
parent 6cb15706f5
commit 746916a963
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
17 changed files with 325 additions and 409 deletions

View file

@ -97,7 +97,6 @@
#include "utils.h"
#ifdef Q_OS_WIN
#include "base/net/downloadhandler.h"
#include "base/net/downloadmanager.h"
#endif
#ifdef Q_OS_MAC
@ -2018,9 +2017,9 @@ void MainWindow::installPython()
const QString installerURL = ((QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
? "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");
Net::DownloadHandler *handler = Net::DownloadManager::instance()->download(
Net::DownloadRequest(installerURL).saveToFile(true));
connect(handler, &Net::DownloadHandler::finished, this, &MainWindow::pythonDownloadFinished);
Net::DownloadManager::instance()->download(
Net::DownloadRequest(installerURL).saveToFile(true)
, this, &MainWindow::pythonDownloadFinished);
}
void MainWindow::pythonDownloadFinished(const Net::DownloadResult &result)