forked from qt-creator/qt-creator
QmlProfiler: remove useless checks from labels() methods
The view should check if it needs the labels before requesting them. Change-Id: I935259e91337202224af7890d0617e1b12dd922a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -210,17 +210,15 @@ QVariantList QmlProfilerRangeModel::labels() const
|
||||
{
|
||||
QVariantList result;
|
||||
|
||||
if (expanded() && !hidden()) {
|
||||
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types =
|
||||
modelManager()->qmlModel()->getEventTypes();
|
||||
for (int i = 1; i < expandedRowCount(); i++) { // Ignore the -1 for the first row
|
||||
QVariantMap element;
|
||||
int typeId = m_expandedRowTypes[i];
|
||||
element.insert(QLatin1String("displayName"), QVariant(types[typeId].displayName));
|
||||
element.insert(QLatin1String("description"), QVariant(types[typeId].data));
|
||||
element.insert(QLatin1String("id"), QVariant(typeId));
|
||||
result << element;
|
||||
}
|
||||
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types =
|
||||
modelManager()->qmlModel()->getEventTypes();
|
||||
for (int i = 1; i < expandedRowCount(); i++) { // Ignore the -1 for the first row
|
||||
QVariantMap element;
|
||||
int typeId = m_expandedRowTypes[i];
|
||||
element.insert(QLatin1String("displayName"), QVariant(types[typeId].displayName));
|
||||
element.insert(QLatin1String("description"), QVariant(types[typeId].data));
|
||||
element.insert(QLatin1String("id"), QVariant(typeId));
|
||||
result << element;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user