diff options
author | Topi Reinio <topi.reinio@digia.com> | 2013-04-03 11:21:18 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-04 08:37:04 +0200 |
commit | 87f890295bdd857571e5289687ffb5ff61d88ed9 (patch) | |
tree | 0fb25f49b57fc855d3443a6ae207036b88b3f963 /examples/network/torrent/peerwireclient.cpp | |
parent | 05b0565e97f011cd26651654c29e295183344c30 (diff) |
Doc: Fix network/torrent example to work on Qt 5
This change fixes two issues in the torrent example:
- Correctly use a query constructed from the announce url to fetch
the list of peers (using QUrlQuery).
- Reimplement QAbstractSocket's connectToHost() and
disconnectFromHost() which are virtual in Qt 5, instead of
of using the protected connectToHostImplementation() /
disconnectFromHostImplementation() slots.
Also removes a warning about deprecation of QHttp class as it's no
longer used in this example.
Task-number: QTBUG-30329
Change-Id: I9230cd2204bfc1a66f2ea3e98940b09681df250e
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Diffstat (limited to 'examples/network/torrent/peerwireclient.cpp')
-rw-r--r-- | examples/network/torrent/peerwireclient.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/network/torrent/peerwireclient.cpp b/examples/network/torrent/peerwireclient.cpp index ade465ab47..0f77ba10d3 100644 --- a/examples/network/torrent/peerwireclient.cpp +++ b/examples/network/torrent/peerwireclient.cpp @@ -386,15 +386,15 @@ bool PeerWireClient::canTransferMore() const || !outgoingBuffer.isEmpty() || !pendingBlocks.isEmpty(); } -void PeerWireClient::connectToHostImplementation(const QString &hostName, - quint16 port, OpenMode openMode) +void PeerWireClient::connectToHost(const QHostAddress &address, + quint16 port, OpenMode openMode) { setOpenMode(openMode); - socket.connectToHost(hostName, port, openMode); + socket.connectToHost(address, port, openMode); } -void PeerWireClient::diconnectFromHostImplementation() +void PeerWireClient::diconnectFromHost() { socket.disconnectFromHost(); } |