if parented to an applet and the appet has a package, use it.

svn path=/trunk/KDE/kdelibs/; revision=906378
This commit is contained in:
Aaron J. Seigo 2009-01-06 03:45:44 +00:00
parent a9cc2e29b6
commit 8c8e40c194

15
svg.cpp
View File

@ -33,6 +33,8 @@
#include <ksharedptr.h>
#include <ksvgrenderer.h>
#include "applet.h"
#include "package.h"
#include "theme.h"
namespace Plasma
@ -230,7 +232,18 @@ class SvgPrivate
//kDebug() << kBacktrace();
if (themed && path.isEmpty()) {
path = Plasma::Theme::defaultTheme()->imagePath(themePath);
Applet *applet = qobject_cast<Applet*>(q->parent());
if (applet && applet->package()) {
path = applet->package()->filePath("images", themePath + ".svg");
if (path.isEmpty()) {
path = applet->package()->filePath("images", themePath + ".svgz");
}
}
if (path.isEmpty()) {
path = Plasma::Theme::defaultTheme()->imagePath(themePath);
}
}
//kDebug() << "********************************";