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

@ -35,7 +35,6 @@
#include <QSysInfo>
#include <QXmlStreamReader>
#include "base/net/downloadhandler.h"
#include "base/net/downloadmanager.h"
#include "base/utils/fs.h"
@ -56,9 +55,9 @@ void ProgramUpdater::checkForUpdates()
{
// Don't change this User-Agent. In case our updater goes haywire,
// the filehost can identify it and contact us.
Net::DownloadHandler *handler = Net::DownloadManager::instance()->download(
Net::DownloadRequest(RSS_URL).userAgent("qBittorrent/" QBT_VERSION_2 " ProgramUpdater (www.qbittorrent.org)"));
connect(handler, &Net::DownloadHandler::finished, this, &ProgramUpdater::rssDownloadFinished);
Net::DownloadManager::instance()->download(
Net::DownloadRequest(RSS_URL).userAgent("qBittorrent/" QBT_VERSION_2 " ProgramUpdater (www.qbittorrent.org)")
, this, &ProgramUpdater::rssDownloadFinished);
}
void ProgramUpdater::rssDownloadFinished(const Net::DownloadResult &result)