diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-06-23 14:29:40 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@digia.com> | 2014-07-09 12:58:07 +0200 |
commit | 49cc0c9df140d375a7342c3dc5ddedca776ea968 (patch) | |
tree | edae48e5e2e08dc21611cf52e685517a6ca47eee | |
parent | c930551b5541944e11d5e92cddb4c41991e1ad98 (diff) | |
download | qt-creator-49cc0c9df140d375a7342c3dc5ddedca776ea968.tar.gz |
QmlProfiler: Clean up assignment of initial details to events
- Build the displayname from the location only once per event
- Make sure Qt4 paint events show the "GUI Thread" label
- Remove useless "Animations" displayName. It isn't shown anywhere.
Task-number: QTCREATORBUG-12496
Change-Id: I823676499670fc019b5dbf225668f833d17076b8
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp index 92dc82959d..0a412c7588 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp @@ -66,16 +66,13 @@ QmlDebug::QmlEventLocation getLocation(const QmlProfilerDataModel::QmlEventTypeD QString getDisplayName(const QmlProfilerDataModel::QmlEventTypeData &event) { - const QmlDebug::QmlEventLocation eventLocation = getLocation(event); - QString displayName; - - if (!eventLocation.filename.isEmpty()) { - const QString filePath = QUrl(eventLocation.filename).path(); - displayName = filePath.mid(filePath.lastIndexOf(QLatin1Char('/')) + 1) + QLatin1Char(':') + - QString::number(eventLocation.line); + if (event.location.filename.isEmpty()) { + return QmlProfilerDataModel::tr("<bytecode>"); + } else { + const QString filePath = QUrl(event.location.filename).path(); + return filePath.mid(filePath.lastIndexOf(QLatin1Char('/')) + 1) + QLatin1Char(':') + + QString::number(event.location.line); } - - return displayName; } QString getInitialDetails(const QmlProfilerDataModel::QmlEventTypeData &event) @@ -97,6 +94,9 @@ QString getInitialDetails(const QmlProfilerDataModel::QmlEventTypeData &event) details.startsWith(QLatin1String("qrc:/"))) details = details.mid(details.lastIndexOf(QLatin1Char('/')) + 1); } + } else if (event.rangeType == QmlDebug::Painting) { + // QtQuick1 animations always run in GUI thread. + details = QmlProfilerDataModel::tr("GUI Thread"); } return details; @@ -223,13 +223,6 @@ void QmlProfilerDataModel::addQmlEvent(QmlDebug::Message message, QmlDebug::Rang { Q_D(QmlProfilerDataModel); QString displayName; - if (message == QmlDebug::Event && detailType == QmlDebug::AnimationFrame) { - displayName = tr("Animations"); - } else { - displayName = QString::fromLatin1("%1:%2").arg( - location.filename, - QString::number(location.line)); - } QmlEventTypeData typeData = {displayName, location, message, rangeType, detailType, data}; QmlEventData eventData = {-1, startTime, duration, ndata1, ndata2, ndata3, ndata4, ndata5}; |