diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 17:17:13 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 17:17:51 +0200 |
commit | 4dac45c9ee59ff6586d90d423654da91523ab679 (patch) | |
tree | cd4a4adf2cbc9e77bf86d2d11e71ec66afdf3be4 /examples/network/torrent | |
parent | 078cd61751aeaa310d35a3d596a21a36004a1a0f (diff) | |
parent | f44850b5c3464cdda0ee9b1ee858d95f3ffaa3e2 (diff) |
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
Diffstat (limited to 'examples/network/torrent')
-rw-r--r-- | examples/network/torrent/ratecontroller.cpp | 4 | ||||
-rw-r--r-- | examples/network/torrent/ratecontroller.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/network/torrent/ratecontroller.cpp b/examples/network/torrent/ratecontroller.cpp index 87c65096b6..96474806f5 100644 --- a/examples/network/torrent/ratecontroller.cpp +++ b/examples/network/torrent/ratecontroller.cpp @@ -96,8 +96,8 @@ void RateController::transfer() if (sockets.isEmpty()) return; - int msecs = 1000; - if (!stopWatch.isNull()) + qint64 msecs = 1000; + if (stopWatch.isValid()) msecs = qMin(msecs, stopWatch.elapsed()); qint64 bytesToWrite = (upLimit * msecs) / 1000; diff --git a/examples/network/torrent/ratecontroller.h b/examples/network/torrent/ratecontroller.h index a4aa596ce1..f8bff0cc36 100644 --- a/examples/network/torrent/ratecontroller.h +++ b/examples/network/torrent/ratecontroller.h @@ -53,7 +53,7 @@ #include <QObject> #include <QSet> -#include <QTime> +#include <QElapsedTimer> class PeerWireClient; @@ -79,7 +79,7 @@ public slots: void scheduleTransfer(); private: - QTime stopWatch; + QElapsedTimer stopWatch; QSet<PeerWireClient *> sockets; int upLimit; int downLimit; |