* delay initialization of the theme pointer to the defaultTheme so that unthemed svgs don't incur the penalty of associating with the default theme, and new svg's have the chance to set their theme before setImagePath is called.

* always use the theme pointer and never defaultTheme() directly

svn path=/trunk/KDE/kdelibs/; revision=969469
This commit is contained in:
Aaron J. Seigo 2009-05-18 12:42:02 +00:00
parent fd1a5a98fc
commit 939954fac0

10
svg.cpp
View File

@ -68,7 +68,7 @@ class SvgPrivate
public:
SvgPrivate(Svg *svg)
: q(svg),
theme(Plasma::Theme::defaultTheme()),
theme(0),
saveTimer(0),
renderer(0),
lastModified(0),
@ -133,6 +133,10 @@ class SvgPrivate
themePath.clear();
if (themed) {
if (!theme) {
theme = Plasma::Theme::defaultTheme();
}
themePath = imagePath;
QObject::connect(theme, SIGNAL(themeChanged()),
q, SLOT(themeChanged()));
@ -188,10 +192,8 @@ class SvgPrivate
//kDebug() << "id is " << id;
Theme *theme = Theme::defaultTheme();
QPixmap p;
if (cacheRendering && theme->findInCache(id, p, lastModified)) {
if (cacheRendering && const_cast<Theme*>(theme)->findInCache(id, p, lastModified)) {
//kDebug() << "found cached version of " << id << p.size();
return p;
} else {