aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-04-16 12:29:42 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-04-16 12:33:27 +0200
commit9c8edb91f2c6c7de8228e018dbd1ae7a656b3097 (patch)
tree717b1df74793af50bd6daaa6775b923a74b05063 /tools
parent5870667929ac5f45805b1e1e656fec81b9b22337 (diff)
parent2b3c2339616680537145a9cc2e7567575add1abb (diff)
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts: tests/auto/qml/debugger/qv4profilerservice/qv4profilerservice.pro tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler.pro Change-Id: I76d87e3df97ebdba902ca3d7488c1582eca2a83c
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlprofiler/qpacketprotocol.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/tools/qmlprofiler/qpacketprotocol.cpp b/tools/qmlprofiler/qpacketprotocol.cpp
index b6543013d9..096bc142c5 100644
--- a/tools/qmlprofiler/qpacketprotocol.cpp
+++ b/tools/qmlprofiler/qpacketprotocol.cpp
@@ -35,6 +35,7 @@
#include <QtCore/QBuffer>
#include <QtCore/QElapsedTimer>
+#include <private/qiodevice_p.h> // for qt_subtract_from_timeout
static const unsigned int MAX_PACKET_SIZE = 0x7FFFFFFF;
@@ -316,19 +317,6 @@ QPacket QPacketProtocol::read()
return rv;
}
-/*
- Returns the difference between msecs and elapsed. If msecs is -1,
- however, -1 is returned.
-*/
-static int qt_timeout_value(int msecs, int elapsed)
-{
- if (msecs == -1)
- return -1;
-
- int timeout = msecs - elapsed;
- return timeout < 0 ? 0 : timeout;
-}
-
/*!
This function locks until a new packet is available for reading and the
\l{QIODevice::}{readyRead()} signal has been emitted. The function
@@ -354,7 +342,7 @@ bool QPacketProtocol::waitForReadyRead(int msecs)
return false;
if (!d->waitingForPacket)
return true;
- msecs = qt_timeout_value(msecs, stopWatch.elapsed());
+ msecs = qt_subtract_from_timeout(msecs, stopWatch.elapsed());
} while (true);
}