summaryrefslogtreecommitdiffstats
path: root/examples/network/torrent/peerwireclient.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Torrent example: update usage of integer typesMårten Nordheim2023-04-111-12/+12
| | | | | | | | | | | | Some of the 'int's are purposefully 32-bit because that's what the protocol is, but others aren't. So, be more explicit. Task-number: QTBUG-110622 Pick-to: 6.5 Change-Id: I338abca1f13b0c95f49a6f52933712f43f147590 Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Torrent example: Fix some stack overflow issuesMårten Nordheim2023-02-211-2/+2
| | | | | | | | | | | | | | Because of the .size() used as part of the expression it ends up copying sizeof(qsizetype) bytes to the array, instead of the (rationally) expected 4 bytes. Amends 69c31f6f68a1399c1fc1e545e318eaa40966fe85 Pick-to: 6.5 Task-number: QTBUG-110622 Change-Id: I732e3f4bb5934ff3860087baa91f9bebbf044a7f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
* Torrent example: Convert some timeouts from int to chronoMårten Nordheim2023-02-141-5/+7
| | | | | | | | | | | | Using seconds because then they all have the same type, even if all-but-one could use minutes. Delete one unused interval value. Task-number: QTBUG-110622 Pick-to: 6.5 Change-Id: I66b456de8a4b867859e9e2b13ce72e8ec691c79a Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Torrent example: Remove manual little-big endian conversionMårten Nordheim2023-02-141-43/+24
| | | | | | | | | | | | ... and use QtEndian instead. The conversion would be done even on a big-endian system, so the example would not work correctly on such machines. Task-number: QTBUG-110622 Pick-to: 6.5 Change-Id: I6a660ff68fa5a8d9b4c1faf9e264d937c605c47e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Examples: Fix CMake Unity (Jumbo) buildsFriedemann Kleint2023-02-011-2/+2
| | | | | | | | | | Disambiguate variables and add some exclusions. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Ie72b3caab9fd571c3fb6f7d8606584885bc09e66 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-49/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QAbstractSocket: Resolve remaining Qt6 TODOsMårten Nordheim2020-08-241-4/+3
| | | | | Change-Id: Id257f0721c1cd5fcbafa9297bae0251a2d68e366 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' insteadAlexander Akulich2020-02-271-2/+2
| | | | | | | [ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred() Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Cleanup network examplesChristian Ehrlicher2019-11-061-16/+18
| | | | | | | | | | | 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>
* Unify license header usage.Jani Heikkinen2016-03-291-3/+13
| | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated BSD licensed file headersJani Heikkinen2015-02-151-3/+3
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-5/+5
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-1/+1
| | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* examples: remove unused static const variablesMarc Mutz2013-09-141-1/+0
| | | | | | | They cause warnings on Clang. Change-Id: If599303f4a00c2a24f0a7c369299f3ea6fe7fc91 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Doc: Fix network/torrent example to work on Qt 5Topi Reinio2013-04-041-4/+4
| | | | | | | | | | | | | | | | | | 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>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-6/+6
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Reimplement QAbstractSocket::setReadBufferSize() properlyBradley T. Hughes2012-02-021-1/+1
| | | | | | | | | | | | | | | | | This function takes a qint64 argument, not an int argument. peerwireclient.h:119:10: warning: 'PeerWireClient::setReadBufferSize' hides overloaded virtual function [-Woverloaded-virtual] void setReadBufferSize(int size); ^ src/network/socket/qabstractsocket.h:162:18: note: hidden overloaded virtual function 'QAbstractSocket::setReadBufferSize' declared here virtual void setReadBufferSize(qint64 size); ^ Change-Id: I29b67b216147771ff2d662d309d2c31d977e9d3f Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+664
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12