From 2952fe3e5fba45c01739632ffabfb8f4bfd55bbd Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 5 Dec 2008 19:50:01 +0000 Subject: [PATCH] rects cache and pixmap cache needs indeed ids a bit different due to the fact that framesvgs are always at the "natural" size per se... this should fix the systray breakage svn path=/trunk/KDE/kdelibs/; revision=893029 --- svg.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/svg.cpp b/svg.cpp index 1fc17eff2..b8c8c65bc 100644 --- a/svg.cpp +++ b/svg.cpp @@ -79,6 +79,7 @@ class SvgPrivate eraseRenderer(); } + //This function is meant for the rects cache QString cacheId(const QString &elementId) { if (size.isValid() && size != naturalSize) { @@ -91,6 +92,14 @@ class SvgPrivate } } + //This function is meant for the pixmap cache + QString cachePath(const QString &path) + { + return QString("%3_%2_%1_").arg(int(size.width())) + .arg(int(size.height())) + .arg(path); + } + bool setImagePath(const QString &imagePath, Svg *q) { bool isThemed = !QDir::isAbsolutePath(imagePath); @@ -150,7 +159,7 @@ class SvgPrivate return QPixmap(); } - QString id = cacheId(path); + QString id = cachePath(path); if (!elementId.isEmpty()) { id.append(elementId); @@ -204,7 +213,7 @@ class SvgPrivate while (i != itemsToSave.end()) { QPixmap p = i.value(); - QString id = cacheId(path); + QString id = cachePath(path); if (!i.key().isEmpty()) { id.append(i.key());