adapt to the Package merge

This commit is contained in:
Aaron Seigo 2011-07-15 12:59:17 +02:00
parent cebb2ea6d6
commit 976c668a13

10
svg.cpp
View File

@ -388,11 +388,15 @@ void SvgPrivate::createRenderer()
//kDebug() << kBacktrace(); //kDebug() << kBacktrace();
if (themed && path.isEmpty() && !themeFailed) { if (themed && path.isEmpty() && !themeFailed) {
Applet *applet = qobject_cast<Applet*>(q->parent()); Applet *applet = qobject_cast<Applet*>(q->parent());
if (applet && applet->package()) { //FIXME: this maybe could be more efficient if we knew if the package was empty, e.g. for
path = applet->package()->filePath("images", themePath + ".svg"); //C++; however, I'm not sure this has any real world runtime impact. something to measure
//for.
if (applet && applet->package().isValid()) {
const Package package = applet->package();
path = package.filePath("images", themePath + ".svg");
if (path.isEmpty()) { if (path.isEmpty()) {
path = applet->package()->filePath("images", themePath + ".svgz"); path = package.filePath("images", themePath + ".svgz");
} }
} }