QmlProfiler: Provide a sane ctor for QmlEventType and use it

... in turn, make its members private, so that we don't accidentally
change them.

Change-Id: Ibc65b406ee341d33f69647ed1b19e1e34f5cd535
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-06-06 19:51:55 +02:00
parent 5718f12af5
commit e10bc709bc
23 changed files with 267 additions and 318 deletions

View File

@@ -57,9 +57,9 @@ ProfileFeature QmlProfilerTimelineModel::mainFeature() const
return m_mainFeature;
}
bool QmlProfilerTimelineModel::accepted(const QmlEventType &event) const
bool QmlProfilerTimelineModel::accepted(const QmlEventType &type) const
{
return (event.rangeType == m_rangeType && event.message == m_message);
return (type.rangeType() == m_rangeType && type.message() == m_message);
}
bool QmlProfilerTimelineModel::handlesTypeId(int typeIndex) const
@@ -129,7 +129,7 @@ QVariantMap QmlProfilerTimelineModel::locationFromTypeId(int index) const
if (id >= types.length())
return result;
const QmlEventLocation &location = types.at(id).location;
QmlEventLocation location = types.at(id).location();
result.insert(QStringLiteral("file"), location.filename());
result.insert(QStringLiteral("line"), location.line());