diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-13 17:54:08 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-17 16:44:01 +0000 |
commit | 131c8027daa028e7daf6c525c8371fe590af668d (patch) | |
tree | 5dd55adf6ca0f8576d0a50955c13832deb8056ea /src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp | |
parent | 9f857880a714e63dd5bd53c4abd9444dc8d81d1e (diff) | |
download | qt-creator-131c8027daa028e7daf6c525c8371fe590af668d.tar.gz |
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: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp index f4ac22cded..d064f16b5b 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp @@ -101,16 +101,24 @@ void QmlProfilerTraceTime::setTime(qint64 startTime, qint64 endTime) void QmlProfilerTraceTime::decreaseStartTime(qint64 time) { - if (m_startTime > time) { + if (m_startTime > time || m_startTime == -1) { 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); } } void QmlProfilerTraceTime::increaseEndTime(qint64 time) { - if (m_endTime < time) { + if (m_endTime < time || m_endTime == -1) { 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); } } |