QmlProfiler: Rename all the timeline model data structs to Item

This allows us to define a template for filling a
QmlProfilerTimelineModel without spelling out all the type names.

Change-Id: I97870287a795d95f58a949729afa715f145817bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2018-05-09 09:27:07 +02:00
parent 9685711cb3
commit 86b368f912
14 changed files with 47 additions and 47 deletions

View File

@@ -109,7 +109,7 @@ static int toSameSignedInt(qint64 number)
QVariantMap MemoryUsageModel::details(int index) const
{
QVariantMap result;
const MemoryAllocationItem *ev = &m_data[index];
const Item *ev = &m_data[index];
if (ev->allocated >= -ev->deallocated)
result.insert(QLatin1String("displayName"), tr("Memory Allocated"));
@@ -181,7 +181,7 @@ void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type
m_data[m_currentUsageIndex].update(event.number<qint64>(0));
m_currentUsage = m_data[m_currentUsageIndex].size;
} else {
MemoryAllocationItem allocation(
Item allocation(
m_rangeStack.empty() ? event.typeIndex() :
m_rangeStack.top().originTypeIndex,
m_currentUsage);
@@ -212,7 +212,7 @@ void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type
m_data[m_currentJSHeapIndex].update(event.number<qint64>(0));
m_currentSize = m_data[m_currentJSHeapIndex].size;
} else {
MemoryAllocationItem allocation(
Item allocation(
m_rangeStack.empty() ? event.typeIndex() :
m_rangeStack.top().originTypeIndex,
m_currentSize);
@@ -279,13 +279,13 @@ bool MemoryUsageModel::handlesTypeId(int typeId) const
return false;
}
MemoryUsageModel::MemoryAllocationItem::MemoryAllocationItem(int typeId, qint64 baseAmount) :
MemoryUsageModel::Item::Item(int typeId, qint64 baseAmount) :
size(baseAmount), allocated(0), deallocated(0), allocations(0), deallocations(0),
typeId(typeId)
{
}
void MemoryUsageModel::MemoryAllocationItem::update(qint64 amount)
void MemoryUsageModel::Item::update(qint64 amount)
{
size += amount;
if (amount < 0) {