summaryrefslogtreecommitdiffstats
path: root/examples/network
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-09-13 20:46:54 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-14 13:12:40 +0200
commit384ca58e33eb1406243b7fece57ff01bd9675779 (patch)
treedc0336b9f12a98117055fcec0e727c7cd379a068 /examples/network
parent3a8b8edd0180594b84a97b974c188b39f17c9f49 (diff)
Remove qSort usages from qtbase examples
QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I68dec0cb6efa1f164ba9f1671b55332ee4ad2e23 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/torrent/torrentclient.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp
index b5969e552e..f0f47fe884 100644
--- a/examples/network/torrent/torrentclient.cpp
+++ b/examples/network/torrent/torrentclient.cpp
@@ -50,6 +50,8 @@
#include <QtCore>
#include <QNetworkInterface>
+#include <algorithm>
+
// These constants could also be configurable by the user.
static const int ServerMinPort = 6881;
static const int ServerMaxPort = /* 6889 */ 7000;
@@ -747,7 +749,7 @@ QList<TorrentPeer *> TorrentClient::weighedFreePeers() const
}
points << QPair<int, TorrentPeer *>(tmp, peer);
}
- qSort(points);
+ std::sort(points.begin(), points.end());
// Minimize the list so the point difference is never more than 1.
typedef QPair<int,TorrentPeer*> PointPair;