* only set the image path when setTheme is called if we have one already set

* check for colourization after the path is set so that it, well, actually works. oops.

svn path=/trunk/KDE/kdelibs/; revision=969913
This commit is contained in:
Aaron J. Seigo 2009-05-19 08:54:56 +00:00
parent 3984fdb402
commit 195df16da7

25
svg.cpp
View File

@ -132,8 +132,17 @@ class SvgPrivate
path.clear();
themePath.clear();
// check if svg wants colorscheme applied
if (themed) {
themePath = imagePath;
QObject::connect(actualTheme(), SIGNAL(themeChanged()), q, SLOT(themeChanged()));
} else if (QFile::exists(imagePath)) {
path = imagePath;
} else {
kDebug() << "file '" << path << "' does not exist!";
}
// check if svg wants colorscheme applied
QObject::disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
q, SLOT(colorsChanged()));
@ -143,16 +152,6 @@ class SvgPrivate
q, SLOT(colorsChanged()));
}
if (themed) {
themePath = imagePath;
QObject::connect(actualTheme(), SIGNAL(themeChanged()),
q, SLOT(themeChanged()));
} else if (QFile::exists(imagePath)) {
path = imagePath;
} else {
kDebug() << "file '" << path << "' does not exist!";
}
//also images with absolute path needs to have a natural size initialized, even if looks a bit weird using Theme to store non-themed stuff
if (themed || QFile::exists(imagePath)) {
QRectF rect;
@ -614,7 +613,9 @@ void Svg::setTheme(Plasma::Theme *theme)
}
d->theme = theme;
setImagePath(imagePath());
if (!imagePath().isEmpty()) {
setImagePath(imagePath());
}
}
Theme *Svg::theme() const