QmlProfiler: Disambiguate parent/child terminology in statistics

When talking about call stacks call them "caller" and "callee". Call
the invisible root item of the model "rootItem".

Change-Id: I551b23f1491d391145193901d3f3a29ab3942089
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2018-03-23 10:14:48 +01:00
parent abfe7fd3c7
commit 5de5794c49
3 changed files with 18 additions and 18 deletions

View File

@@ -140,7 +140,7 @@ void QmlProfilerStatisticsModel::clear()
void QmlProfilerStatisticsModel::setRelativesModel(QmlProfilerStatisticsRelativesModel *relative,
QmlProfilerStatisticsRelation relation)
{
if (relation == QmlProfilerStatisticsParents)
if (relation == QmlProfilerStatisticsCallers)
m_callersModel = relative;
else
m_calleesModel = relative;
@@ -311,11 +311,11 @@ void QmlProfilerStatisticsRelativesModel::loadEvent(RangeType type, const QmlEve
stack.push({event.timestamp(), event.typeIndex()});
break;
case RangeEnd: {
int parentTypeIndex = stack.count() > 1 ? stack[stack.count() - 2].typeId : -1;
int relativeTypeIndex = (m_relation == QmlProfilerStatisticsParents) ? parentTypeIndex :
int callerTypeIndex = stack.count() > 1 ? stack[stack.count() - 2].typeId : -1;
int relativeTypeIndex = (m_relation == QmlProfilerStatisticsCallers) ? callerTypeIndex :
event.typeIndex();
int selfTypeIndex = (m_relation == QmlProfilerStatisticsParents) ? event.typeIndex() :
parentTypeIndex;
int selfTypeIndex = (m_relation == QmlProfilerStatisticsCallers) ? event.typeIndex() :
callerTypeIndex;
QmlStatisticsRelativesMap &relativesMap = m_data[selfTypeIndex];
QmlStatisticsRelativesMap::Iterator it = relativesMap.find(relativeTypeIndex);