Commit 7956b176 authored by Ulf Hermann's avatar Ulf Hermann Committed by Ulf Hermann
Browse files

QmlProfiler: remove useless checks from labels() methods



The view should check if it needs the labels before requesting them.

Change-Id: I935259e91337202224af7890d0617e1b12dd922a
Reviewed-by: default avatarKai Koehne <kai.koehne@theqtcompany.com>
parent 91cb52d4
......@@ -186,7 +186,7 @@ QVariantList QmlProfilerAnimationsModel::labels() const
{
QVariantList result;
if (!hidden() && m_maxGuiThreadAnimations > 0) {
if (m_maxGuiThreadAnimations > 0) {
QVariantMap element;
element.insert(QLatin1String("displayName"), QVariant(tr("Animations")));
element.insert(QLatin1String("description"), QVariant(tr("GUI Thread")));
......@@ -194,7 +194,7 @@ QVariantList QmlProfilerAnimationsModel::labels() const
result << element;
}
if (!hidden() && m_maxRenderThreadAnimations > 0) {
if (m_maxRenderThreadAnimations > 0) {
QVariantMap element;
element.insert(QLatin1String("displayName"), QVariant(tr("Animations")));
element.insert(QLatin1String("description"), QVariant(tr("Render Thread")));
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment