Commit dc40abfa authored by Ismael Asensio's avatar Ismael Asensio Committed by Nate Graham
Browse files

[applets/weather] Port from KIconLoader to QIcon

Summary:
`KIconLoader` was used only to check if the `iconName` is valid.
This patch uses `QIcon::hasThemeIcon()` instead.
It might help T11637 a little.

Test Plan: No behavior changes

Reviewers: #plasma, ngraham

Reviewed By: ngraham

Subscribers: plasma-devel

Tags: #plasma

Maniphest Tasks: T11637

Differential Revision: https://phabricator.kde.org/D24964
parent b91b56d2
......@@ -18,10 +18,10 @@
#include "util.h"
// KF
#include <KIconLoader>
#include <KUnitConversion/Value>
#include <KLocalizedString>
// Qt
#include <QIcon>
#include <QPixmap>
#include <QLocale>
// Std
......@@ -43,9 +43,7 @@ Util::Util(QObject *parent)
QString Util::existingWeatherIconName(const QString &iconName) const
{
const bool isValid = !iconName.isEmpty() &&
!KIconLoader::global()->loadIcon(iconName, KIconLoader::Desktop, 0,
KIconLoader::DefaultState, QStringList(), nullptr, true).isNull();
const bool isValid = !iconName.isEmpty() && QIcon::hasThemeIcon(iconName);
return isValid ? iconName : QStringLiteral("weather-not-available");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment