diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-10-27 18:45:14 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2014-11-21 14:50:15 +0200 |
commit | 587caba5e7dbb007b162e7db594922e64a509387 (patch) | |
tree | ae5989d5cf88006d08e23cb203f3cc4dc2e74927 | |
parent | 5ac685bdfa3d915e8e8de139153798e8e369094f (diff) | |
download | qt-creator-587caba5e7dbb007b162e7db594922e64a509387.tar.gz |
Adapt to merging of AbstractTimelineModel and SortedTimelineModel
Change-Id: I13cbcf98934daef075080a8bf27d505a673103cf
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
4 files changed, 22 insertions, 22 deletions
diff --git a/plugins/qmlprofilerextension/inputeventsmodel.cpp b/plugins/qmlprofilerextension/inputeventsmodel.cpp index 8ee322c364..43203330cd 100644 --- a/plugins/qmlprofilerextension/inputeventsmodel.cpp +++ b/plugins/qmlprofilerextension/inputeventsmodel.cpp @@ -46,7 +46,7 @@ quint64 InputEventsModel::features() const int InputEventsModel::selectionId(int index) const { Q_D(const InputEventsModel); - return d->modelManager->qmlModel()->getEventTypes()[range(index).typeId].detailType; + return d->modelManager->qmlModel()->getEventTypes()[typeId(index)].detailType; } QColor InputEventsModel::color(int index) const diff --git a/plugins/qmlprofilerextension/memoryusagemodel.cpp b/plugins/qmlprofilerextension/memoryusagemodel.cpp index 7d098257d4..b05dff01cc 100644 --- a/plugins/qmlprofilerextension/memoryusagemodel.cpp +++ b/plugins/qmlprofilerextension/memoryusagemodel.cpp @@ -206,7 +206,7 @@ void MemoryUsageModel::loadData() MemoryAllocation &last = currentUsageIndex > -1 ? d->data[currentUsageIndex] : dummy; if (!rangeStack.empty() && type.detailType == last.type && last.originTypeIndex == rangeStack.top().originTypeIndex && - rangeStack.top().startTime < range(currentUsageIndex).start) { + rangeStack.top().startTime < startTime(currentUsageIndex)) { last.update(event.numericData1); currentUsage = last.size; } else { @@ -217,7 +217,7 @@ void MemoryUsageModel::loadData() if (currentUsageIndex != -1) { insertEnd(currentUsageIndex, - event.startTime - range(currentUsageIndex).start - 1); + event.startTime - startTime(currentUsageIndex) - 1); } currentUsageIndex = insertStart(event.startTime, event.typeIndex); d->data.insert(currentUsageIndex, allocation); @@ -228,7 +228,7 @@ void MemoryUsageModel::loadData() MemoryAllocation &last = currentJSHeapIndex > -1 ? d->data[currentJSHeapIndex] : dummy; if (!rangeStack.empty() && type.detailType == last.type && last.originTypeIndex == rangeStack.top().originTypeIndex && - rangeStack.top().startTime < range(currentJSHeapIndex).start) { + rangeStack.top().startTime < startTime(currentJSHeapIndex)) { last.update(event.numericData1); currentSize = last.size; } else { @@ -241,7 +241,7 @@ void MemoryUsageModel::loadData() d->maxSize = currentSize; if (currentJSHeapIndex != -1) insertEnd(currentJSHeapIndex, - event.startTime - range(currentJSHeapIndex).start - 1); + event.startTime - startTime(currentJSHeapIndex) - 1); currentJSHeapIndex = insertStart(event.startTime, event.typeIndex); d->data.insert(currentJSHeapIndex, allocation); } @@ -253,10 +253,10 @@ void MemoryUsageModel::loadData() if (currentJSHeapIndex != -1) insertEnd(currentJSHeapIndex, d->modelManager->traceTime()->endTime() - - range(currentJSHeapIndex).start - 1); + startTime(currentJSHeapIndex) - 1); if (currentUsageIndex != -1) insertEnd(currentUsageIndex, d->modelManager->traceTime()->endTime() - - range(currentUsageIndex).start - 1); + startTime(currentUsageIndex) - 1); computeNesting(); diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.cpp b/plugins/qmlprofilerextension/pixmapcachemodel.cpp index 2937993f04..ffffdc5d4c 100644 --- a/plugins/qmlprofilerextension/pixmapcachemodel.cpp +++ b/plugins/qmlprofilerextension/pixmapcachemodel.cpp @@ -187,7 +187,7 @@ QVariantMap PixmapCacheModel::details(int index) const if (d->pixmaps[ev->urlIndex].sizes[ev->sizeIndex].loadState != Finished) result.insert(tr("Result"), tr("Load Error")); } - result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(range(index).duration)); + result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(duration(index))); } result.insert(tr("Cache Size"), QString::fromLatin1("%1 px").arg(ev->cacheSize)); @@ -248,7 +248,7 @@ void PixmapCacheModel::loadData() PixmapCacheEvent newEvent; newEvent.pixmapEventType = type.detailType; - qint64 startTime = event.startTime; + qint64 pixmapStartTime = event.startTime; newEvent.urlIndex = -1; for (QVector<Pixmap>::const_iterator it(d->pixmaps.cend()); it != d->pixmaps.cbegin();) { @@ -290,7 +290,7 @@ void PixmapCacheModel::loadData() PixmapState &state = pixmap.sizes[newEvent.sizeIndex]; if (state.cacheState == ToBeCached) { - lastCacheSizeEvent = d->updateCacheCount(lastCacheSizeEvent, startTime, + lastCacheSizeEvent = d->updateCacheCount(lastCacheSizeEvent, pixmapStartTime, state.size.width() * state.size.height(), newEvent, event.typeIndex); state.cacheState = Cached; @@ -298,7 +298,7 @@ void PixmapCacheModel::loadData() break; } case PixmapCacheCountChanged: {// Cache Size Changed Event - startTime = event.startTime + 1; // delay 1 ns for proper sorting + pixmapStartTime = event.startTime + 1; // delay 1 ns for proper sorting bool uncache = cumulatedCount > event.numericData3; cumulatedCount = event.numericData3; @@ -351,7 +351,7 @@ void PixmapCacheModel::loadData() pixmap.sizes << PixmapState(uncache ? Uncached : ToBeCached); } - lastCacheSizeEvent = d->updateCacheCount(lastCacheSizeEvent, startTime, pixSize, + lastCacheSizeEvent = d->updateCacheCount(lastCacheSizeEvent, pixmapStartTime, pixSize, newEvent, event.typeIndex); break; } @@ -372,7 +372,7 @@ void PixmapCacheModel::loadData() PixmapState &state = pixmap.sizes[newEvent.sizeIndex]; state.loadState = Loading; - state.started = insertStart(startTime, event.typeIndex); + state.started = insertStart(pixmapStartTime, event.typeIndex); d->data.insert(state.started, newEvent); break; } @@ -416,7 +416,7 @@ void PixmapCacheModel::loadData() // If the pixmap loading wasn't started, start it at traceStartTime() if (state.loadState == Initial) { newEvent.pixmapEventType = PixmapLoadingStarted; - state.started = insert(d->modelManager->traceTime()->startTime(), startTime - + state.started = insert(d->modelManager->traceTime()->startTime(), pixmapStartTime - d->modelManager->traceTime()->startTime(), event.typeIndex); d->data.insert(state.started, newEvent); @@ -436,7 +436,7 @@ void PixmapCacheModel::loadData() } } - insertEnd(state.started, startTime - range(state.started).start); + insertEnd(state.started, pixmapStartTime - startTime(state.started)); if (newEvent.pixmapEventType == PixmapLoadingError) { state.loadState = Error; switch (state.cacheState) { @@ -467,7 +467,7 @@ void PixmapCacheModel::loadData() if (lastCacheSizeEvent != -1) insertEnd(lastCacheSizeEvent, d->modelManager->traceTime()->endTime() - - range(lastCacheSizeEvent).start); + startTime(lastCacheSizeEvent)); d->resizeUnfinishedLoads(); @@ -504,8 +504,8 @@ void PixmapCacheModel::PixmapCacheModelPrivate::resizeUnfinishedLoads() // all the "load start" events with duration 0 continue till the end of the trace for (int i = 0; i < q->count(); i++) { if (data[i].pixmapEventType == PixmapCacheModel::PixmapLoadingStarted && - q->range(i).duration == 0) { - q->insertEnd(i, modelManager->traceTime()->endTime() - q->range(i).start); + ranges[i].duration == 0) { + q->insertEnd(i, modelManager->traceTime()->endTime() - ranges[i].start); } } } @@ -519,7 +519,7 @@ void PixmapCacheModel::PixmapCacheModelPrivate::flattenLoads() QVector <qint64> eventEndTimes; for (int i = 0; i < q->count(); i++) { PixmapCacheModel::PixmapCacheEvent &event = data[i]; - const Range &start = q->range(i); + const Range &start = ranges[i]; if (event.pixmapEventType == PixmapCacheModel::PixmapLoadingStarted) { event.rowNumberCollapsed = 0; while (eventEndTimes.count() > event.rowNumberCollapsed && @@ -552,7 +552,7 @@ int PixmapCacheModel::PixmapCacheModelPrivate::updateCacheCount(int lastCacheSiz qint64 prevSize = 0; if (lastCacheSizeEvent != -1) { prevSize = data[lastCacheSizeEvent].cacheSize; - q->insertEnd(lastCacheSizeEvent, startTime - q->range(lastCacheSizeEvent).start); + q->insertEnd(lastCacheSizeEvent, startTime - ranges[lastCacheSizeEvent].start); } newEvent.cacheSize = prevSize + pixSize; diff --git a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp index 27998d313f..28be51945e 100644 --- a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp +++ b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp @@ -178,7 +178,7 @@ QVariantMap SceneGraphTimelineModel::details(int index) const result.insert(QLatin1String("displayName"), tr(d->threadLabel(static_cast<SceneGraphStage>(ev->stage)))); result.insert(tr("Stage"), tr(StageLabels[ev->stage])); - result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(range(index).duration)); + result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(duration(index))); if (ev->glyphCount >= 0) result.insert(tr("Glyphs"), QString::number(ev->glyphCount)); @@ -296,7 +296,7 @@ void SceneGraphTimelineModel::SceneGraphTimelineModelPrivate::flattenLoads() for (int i = 0; i < q->count(); i++) { SceneGraphEvent &event = data[i]; - const Range &start = q->range(i); + const Range &start = ranges[i]; // Don't try to put render thread events in GUI row and vice versa. // Rows below those are free for all. if (event.stage < MaximumGUIThreadStage) |