From a963302926464df5c2e3598dd2243f6135af302a Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 30 Aug 2017 16:39:53 +0200 Subject: [PATCH] [Icon Item] Don't needlessly unset imagePath We'll eventually delete the Plasma::Svg anyway if we failed to find an appropriate icon. Just need to make sure we don't use isValid with the old source set but this is only done with m_usesPlasmaTheme, hence the new check there, also optimizes the non-themed case. Differential Revision: https://phabricator.kde.org/D7584 --- src/declarativeimports/core/iconitem.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/declarativeimports/core/iconitem.cpp b/src/declarativeimports/core/iconitem.cpp index 550bf50b5..ed0caf018 100644 --- a/src/declarativeimports/core/iconitem.cpp +++ b/src/declarativeimports/core/iconitem.cpp @@ -175,13 +175,10 @@ void IconItem::setSource(const QVariant &source) //try as a svg icon from plasma theme m_svgIcon->setImagePath(QLatin1String("icons/") + sourceString.section('-', 0, 0)); m_svgIcon->setContainsMultipleImages(true); - //invalidate the image path to recalculate it later - } else { - m_svgIcon->setImagePath(QString()); } //success? - if (m_svgIcon->isValid() && m_svgIcon->hasElement(sourceString)) { + if (m_usesPlasmaTheme && m_svgIcon->isValid() && m_svgIcon->hasElement(sourceString)) { m_icon = QIcon(); m_svgIconName = sourceString; //ok, svg not available from the plasma theme