From b796384928f58f48c0e7ed5b36fa3b78f1be5ff7 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 24 May 2023 21:21:26 +0300 Subject: [PATCH] kcontrol: adjust to KIconTheme changes Signed-off-by: Ivailo Monev --- kcontrol/icons/iconthemes.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kcontrol/icons/iconthemes.cpp b/kcontrol/icons/iconthemes.cpp index 2ff3e3a5..100b32ec 100644 --- a/kcontrol/icons/iconthemes.cpp +++ b/kcontrol/icons/iconthemes.cpp @@ -43,7 +43,6 @@ #include #include #include -#include // this private header is only installed for us! #include #include #include @@ -354,17 +353,18 @@ void loadPreview(QLabel *label, KIconTheme& icontheme, const QStringList& iconna << icontheme.inherits(); foreach(const QString &iconthemename, iconthemenames) { foreach(const QString &name, iconnames) { - K3Icon icon = KIconTheme(iconthemename).iconPath(QString("%1.png").arg(name), size, KIconLoader::MatchBest); - if (icon.isValid()) { - label->setPixmap(QPixmap(icon.path).scaled(size, size)); + KIconTheme kicontheme(iconthemename); + QString icon = kicontheme.iconPath(QString("%1.png").arg(name), size, KIconLoader::MatchBest); + if (!icon.isEmpty()) { + label->setPixmap(QPixmap(icon).scaled(size, size)); return; } - icon = KIconTheme(iconthemename).iconPath(QString("%1.svg").arg(name), size, KIconLoader::MatchBest); - if(!icon.isValid() ) { - icon = KIconTheme(iconthemename).iconPath(QString("%1.svgz").arg(name), size, KIconLoader::MatchBest); + icon = kicontheme.iconPath(QString("%1.svg").arg(name), size, KIconLoader::MatchBest); + if (icon.isEmpty() ) { + icon = kicontheme.iconPath(QString("%1.svgz").arg(name), size, KIconLoader::MatchBest); } - if (icon.isValid()) { - label->setPixmap(QPixmap(icon.path).scaled(size, size)); + if (!icon.isEmpty()) { + label->setPixmap(QPixmap(icon).scaled(size, size)); return; } } -- 2.11.0