From kde-commits Tue Jan 31 21:09:05 2017 From: Marco Martin Date: Tue, 31 Jan 2017 21:09:05 +0000 To: kde-commits Subject: [plasma-framework/mart/FrameSvgTransactions] src/plasma: make clearCahce() actually make sense Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=148589695429261 Git commit 95f964efe77d6445ffdb838590bf3cd743a9108d by Marco Martin. Committed on 31/01/2017 at 21:06. Pushed by mart into branch 'mart/FrameSvgTransactions'. make clearCahce() actually make sense the clearCache() implementation wasn't really working anymore as d->frames didn't have more than one (or two in case of mask) frames anymore and used the wrong key for removing from the static sghared frames pool Change-Id: I783600a89a60aec71ed9f218ffe195bf3de1f613 M +6 -17 src/plasma/framesvg.cpp https://commits.kde.org/plasma-framework/95f964efe77d6445ffdb838590bf3cd743= a9108d diff --git a/src/plasma/framesvg.cpp b/src/plasma/framesvg.cpp index 9237ca5a5..ca9de526a 100644 --- a/src/plasma/framesvg.cpp +++ b/src/plasma/framesvg.cpp @@ -390,23 +390,12 @@ bool FrameSvg::cacheAllRenderedFrames() const = void FrameSvg::clearCache() { - /* FrameData *frame =3D d->frames[d->prefix]; - - // delete all the frames that aren't this one - QMutableHashIterator it(d->frames); - while (it.hasNext()) { - FrameData *p =3D it.next().value(); - if (frame !=3D p) { - //TODO: should we clear from the Theme pixmap cache as well? - if (p->deref(this)) { - const QString key =3D d->cacheId(p, it.key()); - FrameSvgPrivate::s_sharedFrames[p->theme].remove(key); - p->cachedBackground =3D QPixmap(); - } - - it.remove(); - } - }*/ + if (d->frame) { + d->frame->cachedBackground =3D QPixmap(); + } + if (d->maskFrame) { + d->maskFrame->cachedBackground =3D QPixmap(); + } } = QPixmap FrameSvg::framePixmap()