diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-12-13 15:58:57 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-01-03 12:40:42 +0000 |
commit | 55d69971544f7ccc57618164c8ab86fefd22e327 (patch) | |
tree | 437f9d07835c0077bb39f68cf2fb0f8bc7a85d8a /src/plugins/qmlprofiler | |
parent | 577ab21b30f074e469c1eaf7c042bcab93acaff0 (diff) |
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>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r-- | src/plugins/qmlprofiler/pixmapcachemodel.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/pixmapcachemodel.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/qmlprofiler/pixmapcachemodel.cpp b/src/plugins/qmlprofiler/pixmapcachemodel.cpp index 703f4bf192..22375bb8c6 100644 --- a/src/plugins/qmlprofiler/pixmapcachemodel.cpp +++ b/src/plugins/qmlprofiler/pixmapcachemodel.cpp @@ -117,6 +117,7 @@ QVariantMap PixmapCacheModel::details(int index) const if (ev->pixmapEventType == PixmapCacheCountChanged) { result.insert(QLatin1String("displayName"), tr("Image Cached")); + result.insert(tr("Cache Size"), QString::fromLatin1("%1 px").arg(ev->cacheSize)); } else { result.insert(QLatin1String("displayName"), tr("Image Loaded")); 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("Cache Size"), QString::fromLatin1("%1 px").arg(ev->cacheSize)); result.insert(tr("File"), getFilenameOnly(m_pixmaps[ev->urlIndex].url)); result.insert(tr("Width"), QString::fromLatin1("%1 px") .arg(m_pixmaps[ev->urlIndex].sizes[ev->sizeIndex].size.width())); diff --git a/src/plugins/qmlprofiler/pixmapcachemodel.h b/src/plugins/qmlprofiler/pixmapcachemodel.h index 8e79729c36..ccc7e70364 100644 --- a/src/plugins/qmlprofiler/pixmapcachemodel.h +++ b/src/plugins/qmlprofiler/pixmapcachemodel.h @@ -92,7 +92,7 @@ public: int urlIndex = -1; int sizeIndex = -1; int rowNumberCollapsed = -1; - qint64 cacheSize = -1; + qint64 cacheSize = 0; }; PixmapCacheModel(QmlProfilerModelManager *manager, QObject *parent = 0); |