mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 09:43:07 -07:00
Use DownloadHandler behind the scenes
This commit is contained in:
parent
6cb15706f5
commit
746916a963
17 changed files with 325 additions and 409 deletions
|
@ -33,7 +33,6 @@
|
|||
#include <QUrlQuery>
|
||||
|
||||
#include "base/logger.h"
|
||||
#include "base/net/downloadhandler.h"
|
||||
#include "base/net/downloadmanager.h"
|
||||
|
||||
using namespace Net;
|
||||
|
@ -74,9 +73,9 @@ void DNSUpdater::checkPublicIP()
|
|||
{
|
||||
Q_ASSERT(m_state == OK);
|
||||
|
||||
DownloadHandler *handler = DownloadManager::instance()->download(
|
||||
DownloadRequest("http://checkip.dyndns.org").userAgent("qBittorrent/" QBT_VERSION_2));
|
||||
connect(handler, &DownloadHandler::finished, this, &DNSUpdater::ipRequestFinished);
|
||||
DownloadManager::instance()->download(
|
||||
DownloadRequest("http://checkip.dyndns.org").userAgent("qBittorrent/" QBT_VERSION_2)
|
||||
, this, &DNSUpdater::ipRequestFinished);
|
||||
|
||||
m_lastIPCheckTime = QDateTime::currentDateTime();
|
||||
}
|
||||
|
@ -116,9 +115,9 @@ void DNSUpdater::updateDNSService()
|
|||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
m_lastIPCheckTime = QDateTime::currentDateTime();
|
||||
DownloadHandler *handler = DownloadManager::instance()->download(
|
||||
DownloadRequest(getUpdateUrl()).userAgent("qBittorrent/" QBT_VERSION_2));
|
||||
connect(handler, &DownloadHandler::finished, this, &DNSUpdater::ipUpdateFinished);
|
||||
DownloadManager::instance()->download(
|
||||
DownloadRequest(getUpdateUrl()).userAgent("qBittorrent/" QBT_VERSION_2)
|
||||
, this, &DNSUpdater::ipUpdateFinished);
|
||||
}
|
||||
|
||||
QString DNSUpdater::getUpdateUrl() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue