aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2016-12-28 18:40:01 +0100
committerUlf Hermann <[email protected]>2017-01-04 16:38:55 +0000
commit5dd4b7d8fe72e5580f5248cb22dd4849ed6ea48e (patch)
tree70b2fa36145c35d63f7efc49e10085f64d592271 /src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
parentba46ebc0f2203ecb3c662fa12f4ab802430aae1e (diff)
QmlProfiler: Simplify stack handling in statistics model
There is no need to keep empty events at the bottom. Change-Id: I072b50329a9f277005cbfa45350c060abd7e7a36 Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
index 0e30f644f80..862b8bb60d2 100644
--- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
@@ -67,8 +67,6 @@ QmlProfilerStatisticsModel::QmlProfilerStatisticsModel(QmlProfilerModelManager *
QObject(parent), d(new QmlProfilerStatisticsModelPrivate)
{
d->modelManager = modelManager;
- d->callStack.push(QmlEvent());
- d->compileStack.push(QmlEvent());
connect(modelManager, &QmlProfilerModelManager::stateChanged,
this, &QmlProfilerStatisticsModel::dataChanged);
connect(modelManager->notesModel(), &Timeline::TimelineNotesModel::changed,
@@ -142,8 +140,6 @@ void QmlProfilerStatisticsModel::clear()
d->notes.clear();
d->callStack.clear();
d->compileStack.clear();
- d->callStack.push(QmlEvent());
- d->compileStack.push(QmlEvent());
d->qmlTime = 0;
d->lastEndTime = 0;
d->durations.clear();
@@ -215,7 +211,7 @@ void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEvent
case RangeStart:
// binding loop detection: check whether event is already in stack
if (type.rangeType() == Binding || type.rangeType() == HandlingSignal) {
- for (int ii = 1; ii < stack.size(); ++ii) {
+ for (int ii = 0; ii < stack.size(); ++ii) {
if (stack.at(ii).typeIndex() == event.typeIndex()) {
d->eventsInBindingLoop.insert(event.typeIndex());
break;
@@ -246,7 +242,7 @@ void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEvent
stack.pop();
- if (stack.count() > 1)
+ if (!stack.isEmpty())
d->data[stack.top().typeIndex()].durationSelf -= duration;
break;
}