diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-06-13 16:56:46 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@digia.com> | 2014-06-18 15:56:46 +0300 |
commit | 71f04e35d7cb9f10d634cd88f2b3ca4a5f47560d (patch) | |
tree | 3d95ab26e2cfc401751062369139cf7d90998f94 | |
parent | 14babc53952589b9d9079720af6c4bb6ccb00265 (diff) | |
download | qt-creator-71f04e35d7cb9f10d634cd88f2b3ca4a5f47560d.tar.gz |
Adapt to centralization of type data.
Change-Id: Ie2ad2f7ab326adb88334b3bd686cbde0f25f1a83
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
-rw-r--r-- | plugins/qmlprofilerextension/memoryusagemodel.cpp | 10 | ||||
-rw-r--r-- | plugins/qmlprofilerextension/pixmapcachemodel.cpp | 10 | ||||
-rw-r--r-- | plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp | 8 |
3 files changed, 17 insertions, 11 deletions
diff --git a/plugins/qmlprofilerextension/memoryusagemodel.cpp b/plugins/qmlprofilerextension/memoryusagemodel.cpp index 5d9e0329e8..4482715702 100644 --- a/plugins/qmlprofilerextension/memoryusagemodel.cpp +++ b/plugins/qmlprofilerextension/memoryusagemodel.cpp @@ -159,11 +159,13 @@ void MemoryUsageModel::loadData() qint64 currentUsage = 0; int currentUsageIndex = -1; int currentJSHeapIndex = -1; + const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes(); foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { - if (!eventAccepted(event)) + const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; + if (!eventAccepted(type)) continue; - if (event.detailType == QmlDebug::SmallItem || event.detailType == QmlDebug::LargeItem) { + if (type.detailType == QmlDebug::SmallItem || type.detailType == QmlDebug::LargeItem) { currentUsage += event.numericData1; MemoryAllocation allocation = { QmlDebug::SmallItem, @@ -177,10 +179,10 @@ void MemoryUsageModel::loadData() currentUsageIndex = d->insertStart(event.startTime, allocation); } - if (event.detailType == QmlDebug::HeapPage || event.detailType == QmlDebug::LargeItem) { + if (type.detailType == QmlDebug::HeapPage || type.detailType == QmlDebug::LargeItem) { currentSize += event.numericData1; MemoryAllocation allocation = { - (QmlDebug::MemoryType)event.detailType, + (QmlDebug::MemoryType)type.detailType, currentSize, event.numericData1 }; diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.cpp b/plugins/qmlprofilerextension/pixmapcachemodel.cpp index da2a306130..1160625629 100644 --- a/plugins/qmlprofilerextension/pixmapcachemodel.cpp +++ b/plugins/qmlprofilerextension/pixmapcachemodel.cpp @@ -272,17 +272,19 @@ void PixmapCacheModel::loadData() int lastCacheSizeEvent = -1; int cumulatedCount = 0; + const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes(); foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { - if (!eventAccepted(event)) + const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; + if (!eventAccepted(type)) continue; PixmapCacheEvent newEvent; - newEvent.pixmapEventType = event.detailType; + newEvent.pixmapEventType = type.detailType; qint64 startTime = event.startTime; newEvent.urlIndex = -1; for (QVector<Pixmap>::const_iterator it(d->pixmaps.cend()); it != d->pixmaps.cbegin();) { - if ((--it)->url == event.location.filename) { + if ((--it)->url == type.location.filename) { newEvent.urlIndex = it - d->pixmaps.cbegin(); break; } @@ -291,7 +293,7 @@ void PixmapCacheModel::loadData() newEvent.sizeIndex = -1; if (newEvent.urlIndex == -1) { newEvent.urlIndex = d->pixmaps.count(); - d->pixmaps << Pixmap(event.location.filename); + d->pixmaps << Pixmap(type.location.filename); } Pixmap &pixmap = d->pixmaps[newEvent.urlIndex]; diff --git a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp index 46d5340eae..3f457476f7 100644 --- a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp +++ b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp @@ -200,11 +200,13 @@ void SceneGraphTimelineModel::loadData() int lastRenderEvent = -1; // combine the data of several eventtypes into two rows + const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes(); foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { - if (!eventAccepted(event)) + const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; + if (!eventAccepted(type)) continue; - if (event.detailType == SceneGraphRenderLoopFrame) { + if (type.detailType == SceneGraphRenderLoopFrame) { SceneGraphEvent newEvent; newEvent.sgEventType = SceneGraphRenderThread; qint64 duration = event.numericData1 + event.numericData2 + event.numericData3; @@ -219,7 +221,7 @@ void SceneGraphTimelineModel::loadData() if (lastRenderEvent >= 0) { qint64 *timing = d->data(lastRenderEvent).timing; - switch ((SceneGraphEventType)event.detailType) { + switch ((SceneGraphEventType)type.detailType) { case SceneGraphRendererFrame: { timing[1] = event.numericData1; timing[10] = event.numericData2; |