plasma: use reasonable maximum cache cost when build against Katie

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-12-01 06:01:47 +00:00
parent cb6ddb2623
commit 36e33c8c9f

View file

@ -93,7 +93,13 @@ public:
cacheTheme = config.cacheTheme();
pixmapCache = new QSharedPointer<QCache<QString, QPixmap> >(new QCache<QString, QPixmap>());
#ifndef QT_KATIE
pixmapCache->data()->setMaxCost(config.themeCacheKb() * 1024);
#else
// max cost is number of elements QCache can hold in Katie's implementation
const int reasonable = qMax(config.themeCacheKb() / 4, 100);
pixmapCache->data()->setMaxCost(reasonable);
#endif
saveTimer = new QTimer(q);
saveTimer->setSingleShot(true);