From 812340ea2fc688da8c9b1ad23b33334676c83433 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 2 Aug 2016 22:10:45 +0100 Subject: [PATCH] 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 --- src/declarativeimports/core/iconitem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarativeimports/core/iconitem.cpp b/src/declarativeimports/core/iconitem.cpp index 29c7f05b5..8f29ee2d1 100644 --- a/src/declarativeimports/core/iconitem.cpp +++ b/src/declarativeimports/core/iconitem.cpp @@ -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(); if (m_icon.isNull()) { - // fallback for non-theme icons - m_icon = source.value(); + m_icon = QIcon::fromTheme(sourceString); } m_svgIconName.clear(); delete m_svgIcon;