From 325938ece3f904a3dbbab32babf83bbb62002417 Mon Sep 17 00:00:00 2001 From: Aleksei Nikiforov Date: Wed, 31 Mar 2021 10:54:44 +0300 Subject: [PATCH] Fix dead code in SvgRectsCache::loadImageFromCache This dead code was found during investigation of KDE bug 433907. "ok" is always "false", thus next condition is always "false" and m_localRectCache is never filled from cache. It looks like "ok" should be set to "true" if "key" contains a valid integer value. --- src/plasma/svg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plasma/svg.cpp b/src/plasma/svg.cpp index be744b8af..705ce407a 100644 --- a/src/plasma/svg.cpp +++ b/src/plasma/svg.cpp @@ -222,9 +222,10 @@ void SvgRectsCache::loadImageFromCache(const QString &path, uint lastModified) for (const auto &key : imageGroup.keyList()) { bool ok = false; + uint keyUInt = key.toUInt(&ok); if (ok) { const QRectF rect = imageGroup.readEntry(key, QRectF()); - m_localRectCache.insert(key.toUInt(), rect); + m_localRectCache.insert(keyUInt, rect); } } }