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
This commit is contained in:
Marco Martin 2008-12-05 19:50:01 +00:00
parent 98b833977b
commit 2952fe3e5f

13
svg.cpp
View File

@ -79,6 +79,7 @@ class SvgPrivate
eraseRenderer(); eraseRenderer();
} }
//This function is meant for the rects cache
QString cacheId(const QString &elementId) QString cacheId(const QString &elementId)
{ {
if (size.isValid() && size != naturalSize) { 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 setImagePath(const QString &imagePath, Svg *q)
{ {
bool isThemed = !QDir::isAbsolutePath(imagePath); bool isThemed = !QDir::isAbsolutePath(imagePath);
@ -150,7 +159,7 @@ class SvgPrivate
return QPixmap(); return QPixmap();
} }
QString id = cacheId(path); QString id = cachePath(path);
if (!elementId.isEmpty()) { if (!elementId.isEmpty()) {
id.append(elementId); id.append(elementId);
@ -204,7 +213,7 @@ class SvgPrivate
while (i != itemsToSave.end()) { while (i != itemsToSave.end()) {
QPixmap p = i.value(); QPixmap p = i.value();
QString id = cacheId(path); QString id = cachePath(path);
if (!i.key().isEmpty()) { if (!i.key().isEmpty()) {
id.append(i.key()); id.append(i.key());