use the package directly in Applet::Private
This commit is contained in:
parent
5b2eaf4a7f
commit
bbc569740e
@ -103,15 +103,16 @@ void PopupApplet::setPopupIcon(const QIcon &icon)
|
|||||||
|
|
||||||
void PopupApplet::setPopupIcon(const QString &iconName)
|
void PopupApplet::setPopupIcon(const QString &iconName)
|
||||||
{
|
{
|
||||||
if (package()) {
|
if (Applet::d->package) {
|
||||||
//Attempt1: is it in the plasmoid 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()) {
|
if (!file.isEmpty()) {
|
||||||
setPopupIcon(KIcon(file));
|
setPopupIcon(KIcon(file));
|
||||||
return;
|
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();
|
QString name = QString("icons/") + iconName.split("-").first();
|
||||||
if (!Plasma::Theme::defaultTheme()->imagePath(name).isEmpty()) {
|
if (!Plasma::Theme::defaultTheme()->imagePath(name).isEmpty()) {
|
||||||
if (!d->icon) {
|
if (!d->icon) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user