summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-03-21 13:28:54 +0100
committerUlf Hermann <ulf.hermann@digia.com>2014-03-24 16:58:29 +0200
commitfbfde55dc23d1bc8c6ea9a563a5a478e2bccf72f (patch)
treecfa99f9df2057485dbfd8483c07ba873f2cca1f8
parent03c324130677f3d1be1ad57d49d07dd6b61ff15c (diff)
downloadqt-creator-fbfde55dc23d1bc8c6ea9a563a5a478e2bccf72f.tar.gz
Make the cache count row lie less.
The height of the events there didn't correspond to the actual cache fill state. Change-Id: I8d0415d4ec4e9e97fb1821bb8c0f5b536e21abd4 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
-rw-r--r--plugins/qmlprofilerextension/pixmapcachemodel.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.cpp b/plugins/qmlprofilerextension/pixmapcachemodel.cpp
index dc26db9c77..1ff6e6ab99 100644
--- a/plugins/qmlprofilerextension/pixmapcachemodel.cpp
+++ b/plugins/qmlprofilerextension/pixmapcachemodel.cpp
@@ -98,17 +98,10 @@ QColor PixmapCacheModel::getColor(int index) const
float PixmapCacheModel::getHeight(int index) const
{
Q_D(const PixmapCacheModel);
- if (d->range(index).pixmapEventType == PixmapCacheCountChanged) {
- float scale = d->maxCacheSize - d->minCacheSize;
- float fraction = 1.0f;
- if (scale > 1)
- fraction = (float)(d->range(index).cacheSize -
- d->minCacheSize) / scale;
-
- return fraction * 0.85f + 0.15f;
- }
-
- return 1.0f;
+ if (d->range(index).pixmapEventType == PixmapCacheCountChanged)
+ return 0.15 + (float)d->range(index).cacheSize * 0.85 / (float)d->maxCacheSize;
+ else
+ return 1.0f;
}
QString getFilenameOnly(QString absUrl)