Use new DownloadManager interface

This commit is contained in:
Vladimir Golovnev (Glassez) 2018-06-25 20:31:32 +03:00
parent 8d438e159c
commit 112a9bcfa2
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
15 changed files with 47 additions and 57 deletions

View file

@ -61,11 +61,10 @@ ProgramUpdater::ProgramUpdater(QObject *parent, bool invokedByUser)
void ProgramUpdater::checkForUpdates()
{
Net::DownloadHandler *handler = Net::DownloadManager::instance()->downloadUrl(
RSS_URL, false, 0, false,
// Don't change this User-Agent. In case our updater goes haywire,
// the filehost can identify it and contact us.
"qBittorrent/" QBT_VERSION_2 " ProgramUpdater (www.qbittorrent.org)");
// 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, static_cast<void (Net::DownloadHandler::*)(const QString &, const QByteArray &)>(&Net::DownloadHandler::downloadFinished)
, this, &ProgramUpdater::rssDownloadFinished);
connect(handler, &Net::DownloadHandler::downloadFailed, this, &ProgramUpdater::rssDownloadFailed);