forked from qt-creator/qt-creator
QmlProfiler: Process remaining events if connection drops
When the connection drops while receiving a trace we can easily process the buffered events. The trace client test case has some traces with trailing open ranges that can be recovered this way. Change-Id: I8b2ecc135b0cabff18923fbc8f3f14b5cb3a96ee Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -60,12 +60,14 @@ void QmlProfilerTraceClientTest::testMessageReceived()
|
||||
QByteArray trace;
|
||||
inStream >> trace;
|
||||
|
||||
traceClient.stateChanged(QmlDebug::QmlDebugClient::Enabled);
|
||||
QmlDebug::QPacket packet(QDataStream::Qt_4_7, trace);
|
||||
while (!packet.atEnd()) {
|
||||
QByteArray content;
|
||||
packet >> content;
|
||||
traceClient.messageReceived(content);
|
||||
}
|
||||
traceClient.stateChanged(QmlDebug::QmlDebugClient::NotConnected);
|
||||
|
||||
modelManager.replayEvents(-1, -1, [&](const QmlEvent &event, const QmlEventType &type) {
|
||||
qint64 timestamp;
|
||||
|
||||
Reference in New Issue
Block a user