If we pass a QIcon as an argument to IconItem::Source, use it

Currently the code gets the icon name from the QIcon and tries to do
some Plasma theming with it.
However if that fails it then loads the QIcon::fromTheme again.

This is pointless in most cases and will break any icons that have a
custom loader (all SNIs)

REVIEW: 128580
This commit is contained in:
David Edmundson 2016-08-02 22:10:45 +01:00
parent 9814aff6b9
commit 812340ea2f

View File

@ -147,10 +147,10 @@ void IconItem::setSource(const QVariant &source)
m_svgIconName = sourceString;
//fail, use QIcon
} else {
m_icon = QIcon::fromTheme(sourceString);
//if we started with a QIcon use that.
m_icon = source.value<QIcon>();
if (m_icon.isNull()) {
// fallback for non-theme icons
m_icon = source.value<QIcon>();
m_icon = QIcon::fromTheme(sourceString);
}
m_svgIconName.clear();
delete m_svgIcon;