summaryrefslogtreecommitdiffstats
path: root/examples/network/torrent/torrentserver.cpp
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-01-22 13:47:08 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2020-01-24 13:17:33 +0100
commit502d3d6744913899da87acfda5ebdab42c40329e (patch)
tree16658a328503bfd5a62b4fd5d69ffb66e9854b18 /examples/network/torrent/torrentserver.cpp
parentd1be8b9ceb2c7b20bbe53a07154c79699540ea3d (diff)
parent06bb315beb6c2c398223cfe52cbc7f66e14a8557 (diff)
Merge remote-tracking branch 'origin/dev' into merge-dev
Diffstat (limited to 'examples/network/torrent/torrentserver.cpp')
-rw-r--r--examples/network/torrent/torrentserver.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/network/torrent/torrentserver.cpp b/examples/network/torrent/torrentserver.cpp
index c68f33249c..215498194b 100644
--- a/examples/network/torrent/torrentserver.cpp
+++ b/examples/network/torrent/torrentserver.cpp
@@ -78,10 +78,10 @@ void TorrentServer::incomingConnection(qintptr socketDescriptor)
if (client->setSocketDescriptor(socketDescriptor)) {
if (ConnectionManager::instance()->canAddConnection() && !clients.isEmpty()) {
- connect(client, SIGNAL(infoHashReceived(QByteArray)),
- this, SLOT(processInfoHash(QByteArray)));
- connect(client, SIGNAL(error(QAbstractSocket::SocketError)),
- this, SLOT(removeClient()));
+ connect(client, &PeerWireClient::infoHashReceived,
+ this, &TorrentServer::processInfoHash);
+ connect(client, QOverload<QAbstractSocket::SocketError>::of(&PeerWireClient::error),
+ this, QOverload<>::of(&TorrentServer::removeClient));
RateController::instance()->addSocket(client);
ConnectionManager::instance()->addConnection(client);
return;
@@ -104,7 +104,7 @@ void TorrentServer::processInfoHash(const QByteArray &infoHash)
PeerWireClient *peer = qobject_cast<PeerWireClient *>(sender());
for (TorrentClient *client : qAsConst(clients)) {
if (client->state() >= TorrentClient::Searching && client->infoHash() == infoHash) {
- peer->disconnect(peer, 0, this, 0);
+ peer->disconnect(peer, nullptr, this, nullptr);
client->setupIncomingConnection(peer);
return;
}