Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package kiconthemes for openSUSE:Factory 
checked in at 2022-07-11 19:08:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kiconthemes (Old)
 and      /work/SRC/openSUSE:Factory/.kiconthemes.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kiconthemes"

Mon Jul 11 19:08:46 2022 rev:110 rq:988142 version:5.96.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kiconthemes/kiconthemes.changes  2022-06-17 
21:21:13.738731597 +0200
+++ /work/SRC/openSUSE:Factory/.kiconthemes.new.1523/kiconthemes.changes        
2022-07-11 19:10:05.323668943 +0200
@@ -1,0 +2,12 @@
+Sun Jul  3 11:55:59 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr>
+
+- Update to 5.96.0
+  * New feature release
+  * For more details please see:
+  * https://kde.org/announcements/frameworks/5/5.96.0
+- Changes since 5.95.0:
+  * Use entryInfo list
+  * Use range for loop
+  * Improve warning messages a bit
+
+-------------------------------------------------------------------

Old:
----
  kiconthemes-5.95.0.tar.xz
  kiconthemes-5.95.0.tar.xz.sig

New:
----
  kiconthemes-5.96.0.tar.xz
  kiconthemes-5.96.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kiconthemes.spec ++++++
--- /var/tmp/diff_new_pack.tY41n1/_old  2022-07-11 19:10:05.799669634 +0200
+++ /var/tmp/diff_new_pack.tY41n1/_new  2022-07-11 19:10:05.803669640 +0200
@@ -17,14 +17,14 @@
 
 
 %define lname   libKF5IconThemes5
-%define _tar_path 5.95
+%define _tar_path 5.96
 # Full KF5 version (e.g. 5.33.0)
 %{!?_kf5_version: %global _kf5_version %{version}}
 # Last major and minor KF5 version (e.g. 5.33)
 %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | 
awk -F. '{print $1"."$2}')}
 %bcond_without released
 Name:           kiconthemes
-Version:        5.95.0
+Version:        5.96.0
 Release:        0
 Summary:        Icon GUI utilities
 License:        LGPL-2.1-or-later AND GPL-2.0-or-later


++++++ kiconthemes-5.95.0.tar.xz -> kiconthemes-5.96.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.95.0/CMakeLists.txt 
new/kiconthemes-5.96.0/CMakeLists.txt
--- old/kiconthemes-5.95.0/CMakeLists.txt       2022-06-09 23:20:38.000000000 
+0200
+++ new/kiconthemes-5.96.0/CMakeLists.txt       2022-07-02 17:53:15.000000000 
+0200
@@ -1,12 +1,12 @@
 cmake_minimum_required(VERSION 3.16)
 
-set(KF_VERSION "5.95.0") # handled by release scripts
-set(KF_DEP_VERSION "5.95.0") # handled by release scripts
+set(KF_VERSION "5.96.0") # handled by release scripts
+set(KF_DEP_VERSION "5.96.0") # handled by release scripts
 project(KIconThemes VERSION ${KF_VERSION})
 
 # ECM setup
 include(FeatureSummary)
-find_package(ECM 5.95.0  NO_MODULE)
+find_package(ECM 5.96.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL "https://commits.kde.org/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -22,6 +22,7 @@
 include(ECMGenerateHeaders)
 include(ECMMarkNonGuiExecutable)
 include(ECMQtDeclareLoggingCategory)
+include(ECMDeprecationSettings)
 include(ECMAddQch)
 include(CMakeDependentOption)
 
@@ -56,8 +57,11 @@
 
 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
 remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
-add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02)
-add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055900)
+
+ecm_set_disabled_deprecation_versions(
+    QT 5.15.2
+    KF 5.95
+)
 
 add_definitions(-DTRANSLATION_DOMAIN=\"kiconthemes5\")
 ki18n_install(po)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.95.0/po/bg/kiconthemes5.po 
new/kiconthemes-5.96.0/po/bg/kiconthemes5.po
--- old/kiconthemes-5.95.0/po/bg/kiconthemes5.po        2022-06-09 
23:20:38.000000000 +0200
+++ new/kiconthemes-5.96.0/po/bg/kiconthemes5.po        2022-07-02 
17:53:15.000000000 +0200
@@ -3,24 +3,25 @@
 #
 # Zlatko Popov <zlatkopo...@fsa-bg.org>, 2006, 2007, 2008, 2009.
 # Yasen Pramatarov <ya...@lindeas.com>, 2010, 2021.
+# Mincho Kondarev <mkonda...@yahoo.de>, 2022.
 msgid ""
 msgstr ""
 "Project-Id-Version: kio4\n"
 "Report-Msgid-Bugs-To: https://bugs.kde.org\n";
 "POT-Creation-Date: 2021-11-30 00:41+0000\n"
-"PO-Revision-Date: 2021-01-06 17:38+0200\n"
-"Last-Translator: Yasen Pramatarov <ya...@lindeas.com>\n"
+"PO-Revision-Date: 2022-05-20 22:57+0200\n"
+"Last-Translator: Mincho Kondarev <mkonda...@yahoo.de>\n"
 "Language-Team: Bulgarian <d...@ludost.net>\n"
 "Language: bg\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Lokalize 20.08.2\n"
+"X-Generator: Lokalize 22.04.0\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
 #: kicondialog.cpp:312
 msgid "All"
-msgstr ""
+msgstr "????????????"
 
 #: kicondialog.cpp:313
 msgid "Actions"
@@ -59,27 +60,25 @@
 msgstr "??????????????????"
 
 #: kicondialog.cpp:345
-#, fuzzy, kde-format
-#| msgid "Others"
+#, kde-format
 msgctxt "Other icons"
 msgid "Other"
 msgstr "??????????"
 
 #: kicondialog.cpp:392
-#, fuzzy, kde-format
-#| msgid "&Browse..."
+#, kde-format
 msgid "Browse???"
-msgstr "&??????????..."
+msgstr "?????????????????"
 
 #: kicondialog.cpp:594
 #, kde-format
 msgid "No icons matching the search"
-msgstr ""
+msgstr "???????? ??????????, ?????????????????????????? ???? 
??????????????????"
 
 #: kicondialog.cpp:596
 #, kde-format
 msgid "No icons in this category"
-msgstr ""
+msgstr "???????? ?????????? ?? ???????? ??????????????????"
 
 #. i18n: ectx: property (windowTitle), widget (QWidget, IconDialog)
 #: kicondialog.cpp:676 kicondialog.ui:14
@@ -99,11 +98,10 @@
 #: kicondialog.ui:24
 #, kde-format
 msgid "Icon category"
-msgstr ""
+msgstr "?????????????????? ??????????"
 
 #. i18n: ectx: property (placeholderText), widget (QLineEdit, searchLine)
 #: kicondialog.ui:44
-#, fuzzy, kde-format
-#| msgid "Select Icon"
+#, kde-format
 msgid "Search Icons..."
-msgstr "?????????? ???? ??????????"
+msgstr "?????????????? ???? ??????????..."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.95.0/po/ca@valencia/kiconthemes5.po 
new/kiconthemes-5.96.0/po/ca@valencia/kiconthemes5.po
--- old/kiconthemes-5.95.0/po/ca@valencia/kiconthemes5.po       2022-06-09 
23:20:38.000000000 +0200
+++ new/kiconthemes-5.96.0/po/ca@valencia/kiconthemes5.po       2022-07-02 
17:53:15.000000000 +0200
@@ -68,7 +68,7 @@
 #, kde-format
 msgctxt "Other icons"
 msgid "Other"
-msgstr "Atres"
+msgstr "Altres"
 
 #: kicondialog.cpp:392
 #, kde-format
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.95.0/po/zh_CN/kiconthemes5.po 
new/kiconthemes-5.96.0/po/zh_CN/kiconthemes5.po
--- old/kiconthemes-5.95.0/po/zh_CN/kiconthemes5.po     2022-06-09 
23:20:38.000000000 +0200
+++ new/kiconthemes-5.96.0/po/zh_CN/kiconthemes5.po     2022-07-02 
17:53:15.000000000 +0200
@@ -17,7 +17,7 @@
 "Project-Id-Version: kdeorg\n"
 "Report-Msgid-Bugs-To: https://bugs.kde.org\n";
 "POT-Creation-Date: 2021-11-30 00:41+0000\n"
-"PO-Revision-Date: 2022-06-05 04:17\n"
+"PO-Revision-Date: 2022-07-02 10:59\n"
 "Last-Translator: \n"
 "Language-Team: Chinese Simplified\n"
 "Language: zh_CN\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.95.0/src/kiconeffect.cpp 
new/kiconthemes-5.96.0/src/kiconeffect.cpp
--- old/kiconthemes-5.95.0/src/kiconeffect.cpp  2022-06-09 23:20:38.000000000 
+0200
+++ new/kiconthemes-5.96.0/src/kiconeffect.cpp  2022-07-02 17:53:15.000000000 
+0200
@@ -11,6 +11,7 @@
 */
 
 #include "kiconeffect.h"
+#include "debug.h"
 
 #include <KColorScheme>
 #include <KConfigGroup>
@@ -176,11 +177,11 @@
 QImage KIconEffect::apply(const QImage &image, int group, int state) const
 {
     if (state >= KIconLoader::LastState) {
-        qWarning() << "Illegal icon state: " << state;
+        qCWarning(KICONTHEMES) << "Invalid icon state:" << state << ", should 
be one of KIconLoader::States";
         return image;
     }
     if (group >= KIconLoader::LastGroup) {
-        qWarning() << "Illegal icon group: " << group;
+        qCWarning(KICONTHEMES) << "Invalid icon group:" << group << ", should 
be one of KIconLoader::Group";
         return image;
     }
     return apply(image, d->effect[group][state], d->value[group][state], 
d->color[group][state], d->color2[group][state], d->trans[group][state]);
@@ -195,7 +196,7 @@
 {
     QImage image = img;
     if (effect >= LastEffect) {
-        qWarning() << "Illegal icon effect: " << effect;
+        qCWarning(KICONTHEMES) << "Invalid icon effect:" << effect << ", 
should be one of KIconLoader::Effects";
         return image;
     }
     if (value > 1.0) {
@@ -229,11 +230,11 @@
 QPixmap KIconEffect::apply(const QPixmap &pixmap, int group, int state) const
 {
     if (state >= KIconLoader::LastState) {
-        qWarning() << "Illegal icon state: " << state;
+        qCWarning(KICONTHEMES) << "Invalid icon state:" << state << ", should 
be one of KIconLoader::States";
         return pixmap;
     }
     if (group >= KIconLoader::LastGroup) {
-        qWarning() << "Illegal icon group: " << group;
+        qCWarning(KICONTHEMES) << "Invalid icon group:" << group << ", should 
be one of KIconLoader::Group";
         return pixmap;
     }
     return apply(pixmap, d->effect[group][state], d->value[group][state], 
d->color[group][state], d->color2[group][state], d->trans[group][state]);
@@ -249,7 +250,7 @@
     QPixmap result;
 
     if (effect >= LastEffect) {
-        qWarning() << "Illegal icon effect: " << effect;
+        qCWarning(KICONTHEMES) << "Invalid icon effect:" << effect << ", 
should be one of KIconLoader::Effects";
         return result;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.95.0/src/kiconengine.cpp 
new/kiconthemes-5.96.0/src/kiconengine.cpp
--- old/kiconthemes-5.95.0/src/kiconengine.cpp  2022-06-09 23:20:38.000000000 
+0200
+++ new/kiconthemes-5.96.0/src/kiconengine.cpp  2022-07-02 17:53:15.000000000 
+0200
@@ -48,22 +48,18 @@
 
 static inline int qIconModeToKIconState(QIcon::Mode mode)
 {
-    int kstate;
     switch (mode) {
     case QIcon::Normal:
-        kstate = KIconLoader::DefaultState;
-        break;
+        return KIconLoader::DefaultState;
     case QIcon::Active:
-        kstate = KIconLoader::ActiveState;
-        break;
+        return KIconLoader::ActiveState;
     case QIcon::Disabled:
-        kstate = KIconLoader::DisabledState;
-        break;
+        return KIconLoader::DisabledState;
     case QIcon::Selected:
-        kstate = KIconLoader::SelectedState;
-        break;
+        return KIconLoader::SelectedState;
+    default:
+        return KIconLoader::DefaultState;
     }
-    return kstate;
 }
 
 QSize KIconEngine::actualSize(const QSize &size, QIcon::Mode mode, 
QIcon::State state)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.95.0/src/kiconloader.cpp 
new/kiconthemes-5.96.0/src/kiconloader.cpp
--- old/kiconthemes-5.95.0/src/kiconloader.cpp  2022-06-09 23:20:38.000000000 
+0200
+++ new/kiconthemes-5.96.0/src/kiconloader.cpp  2022-07-02 17:53:15.000000000 
+0200
@@ -696,16 +696,16 @@
 
 void KIconLoaderPrivate::addInheritedThemes(KIconThemeNode *node, const 
QString &appname)
 {
-    const QStringList lst = node->theme->inherits();
+    const QStringList inheritedThemes = node->theme->inherits();
 
-    for (QStringList::ConstIterator it = lst.begin(), total = lst.end(); it != 
total; ++it) {
-        if ((*it) == QLatin1String("hicolor")) {
+    for (const auto &inheritedTheme : inheritedThemes) {
+        if (inheritedTheme == QLatin1String("hicolor")) {
             // The icon theme spec says that "hicolor" must be the very last
             // of all inherited themes, so don't add it here but at the very 
end
             // of addBaseThemes().
             continue;
         }
-        addThemeByName(*it, appname);
+        addThemeByName(inheritedTheme, appname);
     }
 }
 
@@ -735,40 +735,32 @@
 
     QStringList list;
     const QStringList icnlibs = 
QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, 
QStringLiteral("icons"), QStandardPaths::LocateDirectory);
-    char buf[1000];
-    for (QStringList::ConstIterator it = icnlibs.begin(), total = 
icnlibs.end(); it != total; ++it) {
-        QDir dir(*it);
+    for (const auto &iconDir : icnlibs) {
+        QDir dir(iconDir);
         if (!dir.exists()) {
             continue;
         }
-        const QStringList lst = 
dir.entryList(QStringList(QStringLiteral("default.*")), QDir::Dirs);
-        for (QStringList::ConstIterator it2 = lst.begin(), total = lst.end(); 
it2 != total; ++it2) {
-            if (!QFileInfo::exists(*it + *it2 + 
QStringLiteral("/index.desktop")) //
-                && !QFileInfo::exists(*it + *it2 + 
QStringLiteral("/index.theme"))) {
+        const auto defaultEntries = 
dir.entryInfoList(QStringList(QStringLiteral("default.*")), QDir::Dirs);
+        for (const auto &defaultEntry : defaultEntries) {
+            if (!QFileInfo::exists(defaultEntry.filePath() + 
QLatin1String("/index.desktop")) //
+                && !QFileInfo::exists(defaultEntry.filePath() + 
QLatin1String("/index.theme"))) {
                 continue;
             }
-            // TODO: Is any special handling required for NTFS symlinks?
-#ifndef Q_OS_WIN
-            const int r = readlink(QFile::encodeName(*it + *it2), buf, 
sizeof(buf) - 1);
-            if (r > 0) {
-                buf[r] = 0;
-                const QDir dir2(buf);
-                QString themeName = dir2.dirName();
-
+            if (defaultEntry.isSymbolicLink()) {
+                const QString themeName = 
QDir(defaultEntry.symLinkTarget()).dirName();
                 if (!list.contains(themeName)) {
                     list.append(themeName);
                 }
             }
-#endif
         }
     }
 
-    for (QStringList::ConstIterator it = list.constBegin(), total = 
list.constEnd(); it != total; ++it) {
+    for (const auto &theme : list) {
         // Don't add the KDE defaults once more, we have them anyways.
-        if (*it == QLatin1String("default.kde") || *it == 
QLatin1String("default.kde4")) {
+        if (theme == QLatin1String("default.kde") || theme == 
QLatin1String("default.kde4")) {
             continue;
         }
-        addThemeByName(*it, QLatin1String(""));
+        addThemeByName(theme, QLatin1String(""));
     }
 
     extraDesktopIconsLoaded = true;
@@ -795,7 +787,7 @@
 void KIconLoaderPrivate::normalizeIconMetadata(KIconLoader::Group &group, 
QSize &size, int &state) const
 {
     if ((state < 0) || (state >= KIconLoader::LastState)) {
-        qWarning() << "Illegal icon state:" << state;
+        qCWarning(KICONTHEMES) << "Invalid icon state:" << state << ", should 
be one of KIconLoader::States";
         state = KIconLoader::DefaultState;
     }
 
@@ -810,7 +802,7 @@
     }
 
     if ((group < -1) || (group >= KIconLoader::LastGroup)) {
-        qWarning() << "Illegal icon group:" << group;
+        qCWarning(KICONTHEMES) << "Invalid icon group:" << group << ", should 
be one of KIconLoader::Group";
         group = KIconLoader::Desktop;
     }
 
@@ -1169,7 +1161,7 @@
     }
 
     if (group_or_size >= KIconLoader::LastGroup) {
-        qCDebug(KICONTHEMES) << "Illegal icon group:" << group_or_size;
+        qCDebug(KICONTHEMES) << "Invalid icon group:" << group_or_size;
         return path;
     }
 
@@ -1444,7 +1436,7 @@
     d->initIconThemes();
 
     if ((group < -1 || group >= KIconLoader::LastGroup) && group != 
KIconLoader::User) {
-        qCDebug(KICONTHEMES) << "Illegal icon group:" << group;
+        qCDebug(KICONTHEMES) << "Invalid icon group:" << group << ", should be 
one of KIconLoader::Group";
         group = KIconLoader::Desktop;
     }
     if (size == 0 && group < 0) {
@@ -1494,7 +1486,7 @@
     d->initIconThemes();
 
     if ((group < -1) || (group >= KIconLoader::LastGroup)) {
-        qCDebug(KICONTHEMES) << "Illegal icon group: " << group;
+        qCDebug(KICONTHEMES) << "Invalid icon group: " << group << ", should 
be one of KIconLoader::Group";
         group = KIconLoader::Desktop;
     }
     if ((size == 0) && (group < 0)) {
@@ -1554,7 +1546,7 @@
     }
 
     if (group < 0 || group >= KIconLoader::LastGroup) {
-        qCDebug(KICONTHEMES) << "Illegal icon group:" << group;
+        qCDebug(KICONTHEMES) << "Invalid icon group:" << group << ", should be 
one of KIconLoader::Group";
         return -1;
     }
     return d->mpGroups[group].size;
@@ -1566,8 +1558,8 @@
     const QStringList formats = QStringList() << QStringLiteral("*.png") << 
QStringLiteral("*.xpm") << QStringLiteral("*.svg") << QStringLiteral("*.svgz");
     const QStringList lst = dir.entryList(formats, QDir::Files);
     QStringList result;
-    for (QStringList::ConstIterator it = lst.begin(), total = lst.end(); it != 
total; ++it) {
-        result += iconsDir + QLatin1Char('/') + *it;
+    for (const auto &file : lst) {
+        result += iconsDir + QLatin1Char('/') + file;
     }
     return result;
 }
@@ -1578,7 +1570,7 @@
 
     QStringList result;
     if (group_or_size >= KIconLoader::LastGroup) {
-        qCDebug(KICONTHEMES) << "Illegal icon group:" << group_or_size;
+        qCDebug(KICONTHEMES) << "Invalid icon group:" << group_or_size;
         return result;
     }
     int size;
@@ -1596,18 +1588,17 @@
     QString name;
     QStringList res2;
     QStringList entries;
-    QStringList::ConstIterator it;
-    for (it = result.constBegin(); it != result.constEnd(); ++it) {
-        int n = (*it).lastIndexOf(QLatin1Char('/'));
+    for (const auto &icon : std::as_const(result)) {
+        const int n = icon.lastIndexOf(QLatin1Char('/'));
         if (n == -1) {
-            name = *it;
+            name = icon;
         } else {
-            name = (*it).mid(n + 1);
+            name = icon.mid(n + 1);
         }
         name = d->removeIconExtension(name);
         if (!entries.contains(name)) {
             entries += name;
-            res2 += *it;
+            res2 += icon;
         }
     }
     return res2;
@@ -1619,7 +1610,7 @@
 
     QStringList result;
     if (group_or_size >= KIconLoader::LastGroup) {
-        qCDebug(KICONTHEMES) << "Illegal icon group:" << group_or_size;
+        qCDebug(KICONTHEMES) << "Invalid icon group:" << group_or_size;
         return result;
     }
     int size;
@@ -1637,18 +1628,17 @@
     QString name;
     QStringList res2;
     QStringList entries;
-    QStringList::ConstIterator it;
-    for (it = result.constBegin(); it != result.constEnd(); ++it) {
-        int n = (*it).lastIndexOf(QLatin1Char('/'));
+    for (const auto &icon : std::as_const(result)) {
+        const int n = icon.lastIndexOf(QLatin1Char('/'));
         if (n == -1) {
-            name = *it;
+            name = icon;
         } else {
-            name = (*it).mid(n + 1);
+            name = icon.mid(n + 1);
         }
         name = d->removeIconExtension(name);
         if (!entries.contains(name)) {
             entries += name;
-            res2 += *it;
+            res2 += icon;
         }
     }
     return res2;
@@ -1680,7 +1670,7 @@
     }
 
     if (group < 0 || group >= KIconLoader::LastGroup) {
-        qCDebug(KICONTHEMES) << "Illegal icon group:" << group;
+        qCDebug(KICONTHEMES) << "Invalid icon group:" << group << ", should be 
one of KIconLoader::Group";
         return false;
     }
     return true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.95.0/src/kicontheme.cpp 
new/kiconthemes-5.96.0/src/kicontheme.cpp
--- old/kiconthemes-5.95.0/src/kicontheme.cpp   2022-06-09 23:20:38.000000000 
+0200
+++ new/kiconthemes-5.96.0/src/kicontheme.cpp   2022-07-02 17:53:15.000000000 
+0200
@@ -28,6 +28,7 @@
 
 #include <qplatformdefs.h>
 
+#include <array>
 #include <cmath>
 
 Q_GLOBAL_STATIC(QString, _themeOverride)
@@ -78,8 +79,20 @@
     bool hidden;
     KSharedConfig::Ptr sharedConfig;
 
-    int mDefSize[6];
-    QList<int> mSizes[6];
+    struct GroupInfo {
+        KIconLoader::Group type;
+        const char *name;
+        int defaultSize;
+        QList<int> availableSizes{};
+    };
+    std::array<GroupInfo, KIconLoader::LastGroup> m_iconGroups = {{
+        {KIconLoader::Desktop, "Desktop", 32},
+        {KIconLoader::Toolbar, "Toolbar", 22},
+        {KIconLoader::MainToolbar, "MainToolbar", 22},
+        {KIconLoader::Small, "Small", 16},
+        {KIconLoader::Panel, "Panel", 48},
+        {KIconLoader::Dialog, "Dialog", 32},
+    }};
 
     int mDepth;
     QString mDir, mName, mInternalName, mDesc;
@@ -259,9 +272,9 @@
         && (name == defaultThemeName()
             || name == QLatin1String("hicolor")
             || name == QLatin1String("locolor"))) { /* clang-format on */
-        const QStringList icnlibs = 
QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
-        for (QStringList::ConstIterator it = icnlibs.constBegin(), total = 
icnlibs.constEnd(); it != total; ++it) {
-            const QString cDir = *it + QLatin1Char('/') + appName + 
QStringLiteral("/icons/") + name + QLatin1Char('/');
+        const QStringList dataDirs = 
QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
+        for (const auto &dir : dataDirs) {
+            const QString cDir = dir + QLatin1Char('/') + appName + 
QLatin1String("/icons/") + name + QLatin1Char('/');
             if (QFileInfo::exists(cDir)) {
                 themeDirs += cDir;
             }
@@ -287,8 +300,8 @@
 
     QString fileName;
     QString mainSection;
-    for (QStringList::ConstIterator it = icnlibs.constBegin(), total = 
icnlibs.constEnd(); it != total; ++it) {
-        const QString cDir = *it + QLatin1Char('/') + name + QLatin1Char('/');
+    for (const auto &iconDir : std::as_const(icnlibs)) {
+        const QString cDir = iconDir + QLatin1Char('/') + name + 
QLatin1Char('/');
         if (QDir(cDir).exists()) {
             themeDirs += cDir;
             if (d->mDir.isEmpty()) {
@@ -320,9 +333,9 @@
     d->mDepth = cfg.readEntry("DisplayDepth", 32);
     d->mInherits = cfg.readEntry("Inherits", QStringList());
     if (name != defaultThemeName()) {
-        for (QStringList::Iterator it = d->mInherits.begin(), total = 
d->mInherits.end(); it != total; ++it) {
-            if (*it == QLatin1String("default")) {
-                *it = defaultThemeName();
+        for (auto &inheritedTheme : d->mInherits) {
+            if (inheritedTheme == QLatin1String("default")) {
+                inheritedTheme = defaultThemeName();
             }
         }
     }
@@ -335,13 +348,13 @@
         cfg.readEntry("KDE-Extensions", QStringList{QStringLiteral(".png"), 
QStringLiteral(".svgz"), QStringLiteral(".svg"), QStringLiteral(".xpm")});
 
     const QStringList dirs = cfg.readPathEntry("Directories", QStringList()) + 
cfg.readPathEntry("ScaledDirectories", QStringList());
-    for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) 
{
-        KConfigGroup cg(d->sharedConfig, *it);
-        for (QStringList::ConstIterator itDir = themeDirs.constBegin(); itDir 
!= themeDirs.constEnd(); ++itDir) {
-            const QString currentDir(*itDir + *it + QLatin1Char('/'));
+    for (const auto &dirName : dirs) {
+        KConfigGroup cg(d->sharedConfig, dirName);
+        for (const auto &themeDir : std::as_const(themeDirs)) {
+            const QString currentDir(themeDir + dirName + QLatin1Char('/'));
             if (!addedDirs.contains(currentDir) && QDir(currentDir).exists()) {
                 addedDirs.insert(currentDir);
-                KIconThemeDir *dir = new KIconThemeDir(*itDir, *it, cg);
+                KIconThemeDir *dir = new KIconThemeDir(themeDir, dirName, cg);
                 if (dir->isValid()) {
                     if (dir->scale() > 1) {
                         d->mScaledDirs.append(dir);
@@ -355,19 +368,10 @@
         }
     }
 
-    QStringList groups;
-    groups += QStringLiteral("Desktop");
-    groups += QStringLiteral("Toolbar");
-    groups += QStringLiteral("MainToolbar");
-    groups += QStringLiteral("Small");
-    groups += QStringLiteral("Panel");
-    groups += QStringLiteral("Dialog");
-    const int defDefSizes[] = {32, 22, 22, 16, 48, 32};
     KConfigGroup cg(d->sharedConfig, mainSection);
-    for (int i = 0; i < groups.size(); ++i) {
-        const QString group = groups.at(i);
-        d->mDefSize[i] = cg.readEntry(group + QStringLiteral("Default"), 
defDefSizes[i]);
-        d->mSizes[i] = cg.readEntry(group + QStringLiteral("Sizes"), 
QList<int>());
+    for (auto &iconGroup : d->m_iconGroups) {
+        iconGroup.defaultSize = cg.readEntry(iconGroup.name + 
QLatin1String("Default"), iconGroup.defaultSize);
+        iconGroup.availableSizes = cg.readEntry(iconGroup.name + 
QLatin1String("Sizes"), QList<int>());
     }
 }
 
@@ -429,20 +433,20 @@
 
 int KIconTheme::defaultSize(KIconLoader::Group group) const
 {
-    if ((group < 0) || (group >= KIconLoader::LastGroup)) {
-        qWarning() << "Illegal icon group: " << group;
+    if (group < 0 || group >= KIconLoader::LastGroup) {
+        qCWarning(KICONTHEMES) << "Invalid icon group:" << group << ", should 
be one of KIconLoader::Group";
         return -1;
     }
-    return d->mDefSize[group];
+    return d->m_iconGroups[group].defaultSize;
 }
 
 QList<int> KIconTheme::querySizes(KIconLoader::Group group) const
 {
-    if ((group < 0) || (group >= KIconLoader::LastGroup)) {
-        qWarning() << "Illegal icon group: " << group;
+    if (group < 0 || group >= KIconLoader::LastGroup) {
+        qCWarning(KICONTHEMES) << "Invalid icon group:" << group << ", should 
be one of KIconLoader::Group";
         return QList<int>();
     }
-    return d->mSizes[group];
+    return d->m_iconGroups[group].availableSizes;
 }
 
 QStringList KIconTheme::queryIcons(int size, KIconLoader::Context context) 
const
@@ -471,29 +475,6 @@
     }
 
     return result;
-
-    /*
-        int delta = 1000, dw;
-
-        // Find close match
-        KIconThemeDir *best = 0L;
-        for(int i=0; i<d->mDirs.size(); ++i) {
-            dir = d->mDirs.at(i);
-            if ((context != KIconLoader::Any) && (context != dir->context())) {
-                continue;
-            }
-            dw = dir->size() - size;
-            if ((dw > 6) || (abs(dw) >= abs(delta)))
-                continue;
-            delta = dw;
-            best = dir;
-        }
-        if (best == 0L) {
-            return QStringList();
-        }
-
-        return best->iconList();
-        */
 }
 
 QStringList KIconTheme::queryIconsByContext(int size, KIconLoader::Context 
context) const
@@ -632,24 +613,24 @@
     // These are not in the icon spec, but e.g. GNOME puts some icons there 
anyway.
     icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, 
QStringLiteral("pixmaps"), QStandardPaths::LocateDirectory);
 
-    for (const QString &it : std::as_const(icnlibs)) {
-        QDir dir(it);
-        const QStringList lst = dir.entryList(QDir::Dirs | 
QDir::NoDotAndDotDot);
-        for (QStringList::ConstIterator it2 = lst.begin(), total = lst.end(); 
it2 != total; ++it2) {
-            if ((*it2).startsWith(QLatin1String("default."))) {
+    for (const QString &iconDir : std::as_const(icnlibs)) {
+        QDir dir(iconDir);
+        const QStringList themeDirs = dir.entryList(QDir::Dirs | 
QDir::NoDotAndDotDot);
+        for (const auto &theme : themeDirs) {
+            if (theme.startsWith(QLatin1String("default."))) {
                 continue;
             }
-            if (!QFileInfo::exists(it + QLatin1Char('/') + *it2 + 
QLatin1String("/index.desktop"))
-                && !QFileInfo::exists(it + QLatin1Char('/') + *it2 + 
QLatin1String("/index.theme"))) {
+            if (!QFileInfo::exists(iconDir + QLatin1Char('/') + theme + 
QLatin1String("/index.desktop"))
+                && !QFileInfo::exists(iconDir + QLatin1Char('/') + theme + 
QLatin1String("/index.theme"))) {
                 continue;
             }
-            KIconTheme oink(*it2);
+            KIconTheme oink(theme);
             if (!oink.isValid()) {
                 continue;
             }
 
-            if (!_theme_list()->contains(*it2)) {
-                _theme_list()->append(*it2);
+            if (!_theme_list()->contains(theme)) {
+                _theme_list()->append(theme);
             }
         }
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.95.0/tests/kiconloadertest.cpp 
new/kiconthemes-5.96.0/tests/kiconloadertest.cpp
--- old/kiconthemes-5.95.0/tests/kiconloadertest.cpp    2022-06-09 
23:20:38.000000000 +0200
+++ new/kiconthemes-5.96.0/tests/kiconloadertest.cpp    2022-07-02 
17:53:15.000000000 +0200
@@ -23,9 +23,9 @@
         const QStringList filelist = mpLoader->queryIcons(mGroup, mContext);
         qDebug() << " -> found " << filelist.count() << " icons.";
         int i = 0;
-        for (QStringList::ConstIterator it = filelist.begin(); it != 
filelist.end() /*&& i<10*/; ++it, ++i) {
+        for (const auto &icon : filelist) {
             // qDebug() << ( i==9 ? "..." : (*it) );
-            mpLoader->loadIcon((*it), (KIconLoader::Group)mGroup);
+            mpLoader->loadIcon(icon, (KIconLoader::Group)mGroup);
             ++count;
         }
     }

Reply via email to