1515#include < qstring.h>
1616#include < qtmetamacros.h>
1717
18+ #include " ../../core/iconimageprovider.hpp"
1819#include " ../../dbus/dbusutil.hpp"
1920#include " dbus_item.h"
2021#include " dbus_item_types.hpp"
@@ -49,15 +50,16 @@ StatusNotifierItem::StatusNotifierItem(const QString& address, QObject* parent)
4950 QObject::connect (this ->item , &DBusStatusNotifierItem::NewTitle, &this ->title , &AbstractDBusProperty::update);
5051 QObject::connect (this ->item , &DBusStatusNotifierItem::NewIcon, &this ->iconName , &AbstractDBusProperty::update);
5152 QObject::connect (this ->item , &DBusStatusNotifierItem::NewIcon, &this ->iconPixmaps , &AbstractDBusProperty::update);
52- // QObject::connect(this->item, &DBusStatusNotifierItem::NewIcon, &this->iconThemePath, &AbstractDBusProperty::update);
53+ QObject::connect (this ->item , &DBusStatusNotifierItem::NewIcon, &this ->iconThemePath , &AbstractDBusProperty::update);
5354 QObject::connect (this ->item , &DBusStatusNotifierItem::NewOverlayIcon, &this ->overlayIconName , &AbstractDBusProperty::update);
5455 QObject::connect (this ->item , &DBusStatusNotifierItem::NewOverlayIcon, &this ->overlayIconPixmaps , &AbstractDBusProperty::update);
55- // QObject::connect(this->item, &DBusStatusNotifierItem::NewOverlayIcon, &this->iconThemePath, &AbstractDBusProperty::update);
56+ QObject::connect (this ->item , &DBusStatusNotifierItem::NewOverlayIcon, &this ->iconThemePath , &AbstractDBusProperty::update);
5657 QObject::connect (this ->item , &DBusStatusNotifierItem::NewAttentionIcon, &this ->attentionIconName , &AbstractDBusProperty::update);
5758 QObject::connect (this ->item , &DBusStatusNotifierItem::NewAttentionIcon, &this ->attentionIconPixmaps , &AbstractDBusProperty::update);
58- // QObject::connect(this->item, &DBusStatusNotifierItem::NewAttentionIcon, &this->iconThemePath, &AbstractDBusProperty::update);
59+ QObject::connect (this ->item , &DBusStatusNotifierItem::NewAttentionIcon, &this ->iconThemePath , &AbstractDBusProperty::update);
5960 QObject::connect (this ->item , &DBusStatusNotifierItem::NewToolTip, &this ->tooltip , &AbstractDBusProperty::update);
6061
62+ QObject::connect (&this ->iconThemePath , &AbstractDBusProperty::changed, this , &StatusNotifierItem::updateIcon);
6163 QObject::connect (&this ->iconName , &AbstractDBusProperty::changed, this , &StatusNotifierItem::updateIcon);
6264 QObject::connect (&this ->attentionIconName , &AbstractDBusProperty::changed, this , &StatusNotifierItem::updateIcon);
6365 QObject::connect (&this ->overlayIconName , &AbstractDBusProperty::changed, this , &StatusNotifierItem::updateIcon);
@@ -83,11 +85,12 @@ bool StatusNotifierItem::isReady() const { return this->mReady; }
8385QString StatusNotifierItem::iconId () const {
8486 if (this ->status .get () == " NeedsAttention" ) {
8587 auto name = this ->attentionIconName .get ();
86- if (!name.isEmpty ()) return QString ( " image://icon/ " ) + name;
88+ if (!name.isEmpty ()) return IconImageProvider::requestString ( name, this -> iconThemePath . get ()) ;
8789 } else {
8890 auto name = this ->iconName .get ();
8991 auto overlayName = this ->overlayIconName .get ();
90- if (!name.isEmpty () && overlayName.isEmpty ()) return QString (" image://icon/" ) + name;
92+ if (!name.isEmpty () && overlayName.isEmpty ())
93+ return IconImageProvider::requestString (name, this ->iconThemePath .get ());
9194 }
9295
9396 return QString (" image://service.sni/" ) + this ->watcherId + " /" + QString::number (this ->iconIndex );
0 commit comments