summaryrefslogtreecommitdiffstats
path: root/examples/network/torrent
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-02-28 08:40:53 +0100
committerLars Knoll <lars.knoll@qt.io>2020-02-28 09:48:30 +0100
commita450cce6b670dbcac84fcc4a66fc632b31ce8414 (patch)
tree35b77fa22c4def97b619bd3a87f6d394e452bb2e /examples/network/torrent
parentf6f6eab89f57fb0db8f623f4a92a7b9c4ba6e9ea (diff)
parent4c86e667d220e27bb4b6e370675ffb2872e8521c (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'examples/network/torrent')
-rw-r--r--examples/network/torrent/peerwireclient.cpp4
-rw-r--r--examples/network/torrent/torrentclient.cpp4
-rw-r--r--examples/network/torrent/torrentserver.cpp2
-rw-r--r--examples/network/torrent/trackerclient.cpp4
4 files changed, 7 insertions, 7 deletions
diff --git a/examples/network/torrent/peerwireclient.cpp b/examples/network/torrent/peerwireclient.cpp
index cea4ef53fa..c30abd0e13 100644
--- a/examples/network/torrent/peerwireclient.cpp
+++ b/examples/network/torrent/peerwireclient.cpp
@@ -107,8 +107,8 @@ PeerWireClient::PeerWireClient(const QByteArray &peerId, QObject *parent)
this, &PeerWireClient::readyRead);
connect(&socket, &QTcpSocket::disconnected,
this, &PeerWireClient::disconnected);
- connect(&socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
- this, QOverload<QAbstractSocket::SocketError>::of(&PeerWireClient::error));
+ connect(&socket, &QTcpSocket::errorOccurred,
+ this, &PeerWireClient::errorOccurred);
connect(&socket, &QTcpSocket::bytesWritten,
this, &PeerWireClient::bytesWritten);
connect(&socket, &QTcpSocket::stateChanged,
diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp
index 00f46df892..2ba4476861 100644
--- a/examples/network/torrent/torrentclient.cpp
+++ b/examples/network/torrent/torrentclient.cpp
@@ -843,7 +843,7 @@ void TorrentClient::initializeConnection(PeerWireClient *client)
this, &TorrentClient::setupOutgoingConnection);
connect(client, &PeerWireClient::disconnected,
this, &TorrentClient::removeClient);
- connect(client, QOverload<QAbstractSocket::SocketError>::of(&PeerWireClient::error),
+ connect(client, &PeerWireClient::errorOccurred,
this, &TorrentClient::removeClient);
connect(client, &PeerWireClient::piecesAvailable,
this, &TorrentClient::peerPiecesAvailable);
@@ -867,7 +867,7 @@ void TorrentClient::removeClient()
// Remove the host from our list of known peers if the connection
// failed.
- if (client->peer() && client->socketError() == QAbstractSocket::ConnectionRefusedError)
+ if (client->peer() && client->error() == QAbstractSocket::ConnectionRefusedError)
d->peers.removeAll(client->peer());
// Remove the client from RateController and all structures.
diff --git a/examples/network/torrent/torrentserver.cpp b/examples/network/torrent/torrentserver.cpp
index 215498194b..7af958c27c 100644
--- a/examples/network/torrent/torrentserver.cpp
+++ b/examples/network/torrent/torrentserver.cpp
@@ -80,7 +80,7 @@ void TorrentServer::incomingConnection(qintptr socketDescriptor)
if (ConnectionManager::instance()->canAddConnection() && !clients.isEmpty()) {
connect(client, &PeerWireClient::infoHashReceived,
this, &TorrentServer::processInfoHash);
- connect(client, QOverload<QAbstractSocket::SocketError>::of(&PeerWireClient::error),
+ connect(client, &PeerWireClient::errorOccurred,
this, QOverload<>::of(&TorrentServer::removeClient));
RateController::instance()->addSocket(client);
ConnectionManager::instance()->addConnection(client);
diff --git a/examples/network/torrent/trackerclient.cpp b/examples/network/torrent/trackerclient.cpp
index a50a49fd64..264a6cc04c 100644
--- a/examples/network/torrent/trackerclient.cpp
+++ b/examples/network/torrent/trackerclient.cpp
@@ -165,8 +165,8 @@ void TrackerClient::httpRequestDone(QNetworkReply *reply)
return;
}
- if (reply->networkError() != QNetworkReply::NoError) {
- emit connectionError(reply->networkError());
+ if (reply->error() != QNetworkReply::NoError) {
+ emit connectionError(reply->error());
return;
}