forked from qt-creator/qt-creator
QmlProfiler: Only show pixmap cache size on cache change events
... and make the default size 0, rather than -1. Showing cache sizes for individual pixmaps doesn't make much sense as other pixmaps might get loaded at the same time. Task-number: QTCREATORBUG-17424 Change-Id: Iead21c21d87b454ef03961d22119e0f5351d11ea Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
This commit is contained in:
@@ -117,6 +117,7 @@ QVariantMap PixmapCacheModel::details(int index) const
|
|||||||
|
|
||||||
if (ev->pixmapEventType == PixmapCacheCountChanged) {
|
if (ev->pixmapEventType == PixmapCacheCountChanged) {
|
||||||
result.insert(QLatin1String("displayName"), tr("Image Cached"));
|
result.insert(QLatin1String("displayName"), tr("Image Cached"));
|
||||||
|
result.insert(tr("Cache Size"), QString::fromLatin1("%1 px").arg(ev->cacheSize));
|
||||||
} else {
|
} else {
|
||||||
result.insert(QLatin1String("displayName"), tr("Image Loaded"));
|
result.insert(QLatin1String("displayName"), tr("Image Loaded"));
|
||||||
if (m_pixmaps[ev->urlIndex].sizes[ev->sizeIndex].loadState != Finished)
|
if (m_pixmaps[ev->urlIndex].sizes[ev->sizeIndex].loadState != Finished)
|
||||||
@@ -124,7 +125,6 @@ QVariantMap PixmapCacheModel::details(int index) const
|
|||||||
result.insert(tr("Duration"), Timeline::formatTime(duration(index)));
|
result.insert(tr("Duration"), Timeline::formatTime(duration(index)));
|
||||||
}
|
}
|
||||||
|
|
||||||
result.insert(tr("Cache Size"), QString::fromLatin1("%1 px").arg(ev->cacheSize));
|
|
||||||
result.insert(tr("File"), getFilenameOnly(m_pixmaps[ev->urlIndex].url));
|
result.insert(tr("File"), getFilenameOnly(m_pixmaps[ev->urlIndex].url));
|
||||||
result.insert(tr("Width"), QString::fromLatin1("%1 px")
|
result.insert(tr("Width"), QString::fromLatin1("%1 px")
|
||||||
.arg(m_pixmaps[ev->urlIndex].sizes[ev->sizeIndex].size.width()));
|
.arg(m_pixmaps[ev->urlIndex].sizes[ev->sizeIndex].size.width()));
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public:
|
|||||||
int urlIndex = -1;
|
int urlIndex = -1;
|
||||||
int sizeIndex = -1;
|
int sizeIndex = -1;
|
||||||
int rowNumberCollapsed = -1;
|
int rowNumberCollapsed = -1;
|
||||||
qint64 cacheSize = -1;
|
qint64 cacheSize = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
PixmapCacheModel(QmlProfilerModelManager *manager, QObject *parent = 0);
|
PixmapCacheModel(QmlProfilerModelManager *manager, QObject *parent = 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user