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:
parent
9814aff6b9
commit
812340ea2f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user