Commit 131c8027 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Fix traceTime updates

If the trace time hasn't been set yet, decreaseStartTime and
increaseEndTime should still do something.

Change-Id: I626c0df66a5d7327708ada77c78546ad4aafc52b
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 9f857880
...@@ -101,16 +101,24 @@ void QmlProfilerTraceTime::setTime(qint64 startTime, qint64 endTime) ...@@ -101,16 +101,24 @@ void QmlProfilerTraceTime::setTime(qint64 startTime, qint64 endTime)
void QmlProfilerTraceTime::decreaseStartTime(qint64 time) void QmlProfilerTraceTime::decreaseStartTime(qint64 time)
{ {
if (m_startTime > time) { if (m_startTime > time || m_startTime == -1) {
m_startTime = time; m_startTime = time;
if (m_endTime == -1)
m_endTime = m_startTime;
else
QTC_ASSERT(m_endTime >= m_startTime, m_endTime = m_startTime);
emit timeChanged(time, m_endTime); emit timeChanged(time, m_endTime);
} }
} }
void QmlProfilerTraceTime::increaseEndTime(qint64 time) void QmlProfilerTraceTime::increaseEndTime(qint64 time)
{ {
if (m_endTime < time) { if (m_endTime < time || m_endTime == -1) {
m_endTime = time; m_endTime = time;
if (m_startTime == -1)
m_startTime = m_endTime;
else
QTC_ASSERT(m_endTime >= m_startTime, m_startTime = m_endTime);
emit timeChanged(m_startTime, time); emit timeChanged(m_startTime, time);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment