From 36e33c8c9fdbc982c4b38bc6047e097adf92fdce Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 1 Dec 2019 06:01:47 +0000 Subject: [PATCH] plasma: use reasonable maximum cache cost when build against Katie Signed-off-by: Ivailo Monev --- plasma/theme.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plasma/theme.cpp b/plasma/theme.cpp index c7c9465f..1914e8c6 100644 --- a/plasma/theme.cpp +++ b/plasma/theme.cpp @@ -93,7 +93,13 @@ public: cacheTheme = config.cacheTheme(); pixmapCache = new QSharedPointer >(new QCache()); +#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);