[dataengines/sni] Reapply IconThemePath on icon theme change

SNI can have custom icon path in IconThemePath attribute.
StatusNotifierItemSource uses custom KIconLoader to add this theme dir.

KIconLoader forgets this path on any system change
(for example when icon theme is change in system settings).

Reapply custom theme path on KIconLoader::iconChanged.

BUG: 433557
FIXED-IN: 5.22.0
wilder-5.22
Konrad Materka 5 years ago committed by Nate Graham
parent ea95ebd0cd
commit 40bf43ad57
  1. 5
      dataengines/statusnotifieritem/statusnotifieritemsource.cpp

@ -264,6 +264,11 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
// add app dir requires an app name, though this is completely unused in this context
m_customIconLoader->addAppDir(appName.size() ? appName : QStringLiteral("unused"), path);
connect(m_customIconLoader, &KIconLoader::iconChanged, this, [=] {
m_customIconLoader->reconfigure(appName, QStringList(path));
m_customIconLoader->addAppDir(appName.size() ? appName : QStringLiteral("unused"), path);
});
}
setData(QStringLiteral("IconThemePath"), path);

Loading…
Cancel
Save