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

@@ -168,14 +168,14 @@ QVariant FlameGraphModel::lookup(const FlameGraphData &stats, int role) const
const QmlEventType &type = typeList[stats.typeIndex];
switch (role) {
case FilenameRole: return type.location.filename();
case LineRole: return type.location.line();
case ColumnRole: return type.location.column();
case TypeRole: return nameForType(type.rangeType);
case RangeTypeRole: return type.rangeType;
case DetailsRole: return type.data.isEmpty() ?
FlameGraphModel::tr("Source code not available") : type.data;
case LocationRole: return type.displayName;
case FilenameRole: return type.location().filename();
case LineRole: return type.location().line();
case ColumnRole: return type.location().column();
case TypeRole: return nameForType(type.rangeType());
case RangeTypeRole: return type.rangeType();
case DetailsRole: return type.data().isEmpty() ?
FlameGraphModel::tr("Source code not available") : type.data();
case LocationRole: return type.displayName();
default: return QVariant();
}
} else {