From 981bb850e9ee891c07950fea86a2efd1c9502a0b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 3 Jul 2014 10:53:13 +0200 Subject: [PATCH] QmlProfiler: Rename Qt5 "Painting" to "Animations" and always show it "Animations" is a much better name as that's what it actually shows. It also serves to distinguish from the QtQuick 1 only "Painting" category that really does show the time QPainter took to paint the scene. Hiding the "Animations" category when profiling QtQuick 1 makes no sense as we also don't hide the JavaScript category or any of the commercial addons which are only available from QtQuick 2. As QtQuick 1 is deprecated we keep hiding the Painting category when profiling QtQuick 2 to reduce clutter in the UI for the more common case. Change-Id: I0e14fab8abf427dc1abb6d00874e7e4af0fa30e5 Reviewed-by: Leena Miettinen Reviewed-by: Kai Koehne --- .../qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp index 37a3d4c6f1f..cc6b1d8296c 100644 --- a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp @@ -54,7 +54,6 @@ public: int maxGuiThreadAnimations; int maxRenderThreadAnimations; - bool seenForeignPaintEvent; int rowFromThreadId(QmlDebug::AnimationThread threadId) const; private: @@ -63,11 +62,10 @@ private: PaintEventsModelProxy::PaintEventsModelProxy(QObject *parent) : AbstractTimelineModel(new PaintEventsModelProxyPrivate, - QLatin1String("PaintEventsModelProxy"), tr("Painting"), + QLatin1String("PaintEventsModelProxy"), tr("Animations"), QmlDebug::Event, QmlDebug::MaximumRangeType, parent) { Q_D(PaintEventsModelProxy); - d->seenForeignPaintEvent = false; d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0; } @@ -78,7 +76,6 @@ void PaintEventsModelProxy::clear() d->clear(); d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0; d->expanded = false; - d->seenForeignPaintEvent = false; d->modelManager->modelProxyCountUpdated(d->modelId, 0, 1); } @@ -105,11 +102,8 @@ void PaintEventsModelProxy::loadData() foreach (const QmlProfilerDataModel::QmlEventData &event, referenceList) { const QmlProfilerDataModel::QmlEventTypeData &type = typeList[event.typeIndex]; - if (!eventAccepted(type)) { - if (type.rangeType == QmlDebug::Painting) - d->seenForeignPaintEvent = true; + if (!eventAccepted(type)) continue; - } lastEvent.threadId = (QmlDebug::AnimationThread)event.numericData3; @@ -156,7 +150,7 @@ int PaintEventsModelProxy::rowCount() const { Q_D(const PaintEventsModelProxy); if (isEmpty()) - return d->seenForeignPaintEvent ? 0 : 1; + return 1; else return (d->maxGuiThreadAnimations == 0 || d->maxRenderThreadAnimations == 0) ? 2 : 3; }