summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/qmlprofilerextension/pixmapcachemodel.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.cpp b/plugins/qmlprofilerextension/pixmapcachemodel.cpp
index ea297b04bc..f3b8a02761 100644
--- a/plugins/qmlprofilerextension/pixmapcachemodel.cpp
+++ b/plugins/qmlprofilerextension/pixmapcachemodel.cpp
@@ -456,6 +456,21 @@ void PixmapCacheModel::loadData()
if (state.loadState == Initial) {
newEvent.pixmapEventType = PixmapLoadingStarted;
state.started = d->insert(traceStartTime(), startTime - traceStartTime(), newEvent);
+
+ // All other indices are wrong now as we've prepended. Fix them ...
+ if (lastCacheSizeEvent >= state.started)
+ ++lastCacheSizeEvent;
+
+ for (int pixmapIndex = 0; pixmapIndex < d->pixmaps.count(); ++pixmapIndex) {
+ Pixmap &brokenPixmap = d->pixmaps[pixmapIndex];
+ for (int sizeIndex = 0; sizeIndex < brokenPixmap.sizes.count(); ++sizeIndex) {
+ PixmapState &brokenSize = brokenPixmap.sizes[sizeIndex];
+ if ((pixmapIndex != newEvent.urlIndex || sizeIndex != newEvent.sizeIndex) &&
+ brokenSize.started >= state.started) {
+ ++brokenSize.started;
+ }
+ }
+ }
}
d->insertEnd(state.started, startTime - d->range(state.started).start);