use the package directly in Applet::Private

This commit is contained in:
Aaron Seigo 2011-07-15 13:01:52 +02:00
parent 5b2eaf4a7f
commit bbc569740e

View File

@ -103,15 +103,16 @@ void PopupApplet::setPopupIcon(const QIcon &icon)
void PopupApplet::setPopupIcon(const QString &iconName)
{
if (package()) {
if (Applet::d->package) {
//Attempt1: is it in the plasmoid package?
const QString file = package()->filePath("images", iconName);
const QString file = Applet::d->package->filePath("images", iconName);
if (!file.isEmpty()) {
setPopupIcon(KIcon(file));
return;
}
//Attempt2: is it a svg in the icons directory?
}
//Attempt2: is it a svg in the icons directory?
QString name = QString("icons/") + iconName.split("-").first();
if (!Plasma::Theme::defaultTheme()->imagePath(name).isEmpty()) {
if (!d->icon) {