aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-10-27 18:42:39 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2014-11-21 10:54:01 +0100
commitb7742f79b621ed6424fc5f9a3097208a0ba64768 (patch)
tree29057a57702e6b09b8c8c2a489b38cc5bdb0015b /src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp
parenta42e07bebaf6a161020459a66aab021cb0e29f90 (diff)
QmlProfiler: Merge SortedTimelineModel into AbstractTimelineModel
In order to provide a stable interface we need most of SortedTimelineModel to be private. There is no real benefit in keeping a distinction between AbstractTimelineModel and SortedTimelineModel as SortedTimelineModel isn't very useful on its own. Change-Id: Ibc6945e2740320f430f2634f95c7807d6b460123 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp
index 552c17c86a..114b2a991a 100644
--- a/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp
@@ -138,7 +138,7 @@ void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::computeNestingContract
nestingEndTimes.fill(0, nestingLevels + 1);
for (i = 0; i < eventCount; i++) {
- qint64 st = q->ranges[i].start;
+ qint64 st = ranges[i].start;
// per type
if (nestingEndTimes[nestingLevels] > st) {
@@ -151,7 +151,7 @@ void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::computeNestingContract
nestingEndTimes[nestingLevels-1] <= st)
nestingLevels--;
}
- nestingEndTimes[nestingLevels] = st + q->ranges[i].duration;
+ nestingEndTimes[nestingLevels] = st + ranges[i].duration;
data[i].displayRowCollapsed = nestingLevels;
}
@@ -163,7 +163,7 @@ void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::computeExpandedLevels(
QHash<int, int> eventRow;
int eventCount = q->count();
for (int i = 0; i < eventCount; i++) {
- int typeId = q->range(i).typeId;
+ int typeId = ranges[i].typeId;
if (!eventRow.contains(typeId)) {
eventRow[typeId] = expandedRowTypes.size();
expandedRowTypes << typeId;
@@ -184,25 +184,23 @@ void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::findBindingLoops()
for (int i = 0; i < q->count(); ++i) {
const Range *potentialParent = callStack.isEmpty()
- ? 0 : &q->ranges[callStack.top().second];
+ ? 0 : &ranges[callStack.top().second];
while (potentialParent
- && !(potentialParent->start + potentialParent->duration > q->ranges[i].start)) {
+ && !(potentialParent->start + potentialParent->duration > ranges[i].start)) {
callStack.pop();
- potentialParent = callStack.isEmpty() ? 0
- : &q->ranges[callStack.top().second];
+ potentialParent = callStack.isEmpty() ? 0 : &ranges[callStack.top().second];
}
// check whether event is already in stack
for (int ii = 0; ii < callStack.size(); ++ii) {
- if (callStack.at(ii).first == q->range(i).typeId) {
+ if (callStack.at(ii).first == ranges[i].typeId) {
data[i].bindingLoopHead = callStack.at(ii).second;
break;
}
}
-
- CallStackEntry newEntry(q->range(i).typeId, i);
+ CallStackEntry newEntry(ranges[i].typeId, i);
callStack.push(newEntry);
}
@@ -266,7 +264,7 @@ QVariantMap QmlProfilerRangeModel::details(int index) const
d->modelManager->qmlModel()->getEventTypes();
result.insert(QStringLiteral("displayName"), categoryLabel(d->rangeType));
- result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(range(index).duration));
+ result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(duration(index)));
result.insert(tr("Details"), types[id].data);
result.insert(tr("Location"), types[id].displayName);