diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-11-01 13:21:32 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-11-06 10:57:23 +0100 |
commit | e85de7d787498624020884ef2e269c15faf76b50 (patch) | |
tree | 30044fb755fdf0c3015b21a14a1fa871526632a9 /examples/network/torrent/trackerclient.cpp | |
parent | 66b6e28c0158b8c4e96ddf08908a538d865ce63a (diff) |
Cleanup network examples
Cleanup network examples:
- use nullptr
- use member-init
- adjust includes
- use new-style connects
Change-Id: I80aa230168e5aec88a1bc93bbf49a471bfc30e7b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'examples/network/torrent/trackerclient.cpp')
-rw-r--r-- | examples/network/torrent/trackerclient.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/examples/network/torrent/trackerclient.cpp b/examples/network/torrent/trackerclient.cpp index e883317b12..00810a98af 100644 --- a/examples/network/torrent/trackerclient.cpp +++ b/examples/network/torrent/trackerclient.cpp @@ -60,14 +60,8 @@ TrackerClient::TrackerClient(TorrentClient *downloader, QObject *parent) : QObject(parent), torrentDownloader(downloader) { - length = 0; - requestInterval = 5 * 60; - requestIntervalTimer = -1; - firstTrackerRequest = true; - lastTrackerRequest = false; - firstSeeding = true; - - connect(&http, SIGNAL(finished(QNetworkReply*)), this, SLOT(httpRequestDone(QNetworkReply*))); + connect(&http, &QNetworkAccessManager::finished, + this, &TrackerClient::httpRequestDone); } void TrackerClient::start(const MetaInfo &info) @@ -157,8 +151,8 @@ void TrackerClient::fetchPeerList() if (!url.userName().isEmpty()) { uname = url.userName(); pwd = url.password(); - connect(&http, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), - this, SLOT(provideAuthentication(QNetworkReply*,QAuthenticator*))); + connect(&http, &QNetworkAccessManager::authenticationRequired, + this, &TrackerClient::provideAuthentication); } http.get(req); } |