obey using cache, and clear the saved frames after we've put them in the cache

svn path=/trunk/KDE/kdelibs/; revision=967636
This commit is contained in:
Aaron J. Seigo 2009-05-13 16:37:13 +00:00
parent 170e38756f
commit 7ac1ba7ee1

View File

@ -394,9 +394,11 @@ void FrameSvgPrivate::generateBackground(FrameData *frame)
QString id = QString::fromLatin1("%5_%4_%3_%2_%1_"). QString id = QString::fromLatin1("%5_%4_%3_%2_%1_").
arg(frame->enabledBorders).arg(frame->frameSize.width()).arg(frame->frameSize.height()).arg(prefix).arg(q->imagePath()); arg(frame->enabledBorders).arg(frame->frameSize.width()).arg(frame->frameSize.height()).arg(prefix).arg(q->imagePath());
Theme *theme = Theme::defaultTheme(); if (q->isUsingRenderingCache()) {
if (theme->findInCache(id, frame->cachedBackground) && !frame->cachedBackground.isNull()) { Theme *theme = Theme::defaultTheme();
return; if (theme->findInCache(id, frame->cachedBackground) && !frame->cachedBackground.isNull()) {
return;
}
} }
//kDebug() << "generating background"; //kDebug() << "generating background";
@ -609,7 +611,12 @@ void FrameSvgPrivate::generateBackground(FrameData *frame)
void FrameSvgPrivate::scheduledCacheUpdate() void FrameSvgPrivate::scheduledCacheUpdate()
{ {
foreach ( QString prefixToSave, framesToSave) { if (!q->isUsingRenderingCache()) {
framesToSave.clear();
return;
}
foreach (QString prefixToSave, framesToSave) {
//insert background //insert background
FrameData *frame = frames[prefix]; FrameData *frame = frames[prefix];
framesToSave.removeAll(prefixToSave); framesToSave.removeAll(prefixToSave);
@ -627,6 +634,8 @@ void FrameSvgPrivate::scheduledCacheUpdate()
Theme::defaultTheme()->insertIntoCache(id, frame->cachedBackground); Theme::defaultTheme()->insertIntoCache(id, frame->cachedBackground);
} }
framesToSave.clear();
} }
void FrameSvgPrivate::updateSizes() void FrameSvgPrivate::updateSizes()