Hello community,

here is the log from the commit of package kiconthemes for openSUSE:Factory 
checked in at 2016-07-03 12:22:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kiconthemes (Old)
 and      /work/SRC/openSUSE:Factory/.kiconthemes.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kiconthemes"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kiconthemes/kiconthemes.changes  2016-05-19 
12:07:44.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kiconthemes.new/kiconthemes.changes     
2016-07-03 12:22:40.000000000 +0200
@@ -1,0 +2,10 @@
+Mon Jun  6 21:25:32 UTC 2016 - [email protected]
+
+- Update to 5.23.0
+  * Don't make KIconThemes depend on Oxygen (kde#360664)
+  * Selected state concept for icons
+  * Use system colors for monochrome icons
+  * For more details please see:
+    https://www.kde.org/announcements/kde-frameworks-5.23.0.php
+
+-------------------------------------------------------------------

Old:
----
  kiconthemes-5.22.0.tar.xz

New:
----
  kiconthemes-5.23.0.tar.xz

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

Other differences:
------------------
++++++ kiconthemes.spec ++++++
--- /var/tmp/diff_new_pack.O8XpEN/_old  2016-07-03 12:22:41.000000000 +0200
+++ /var/tmp/diff_new_pack.O8XpEN/_new  2016-07-03 12:22:41.000000000 +0200
@@ -18,14 +18,15 @@
 
 %bcond_without lang
 %define lname   libKF5IconThemes5
-%define _tar_path 5.22
+%define _tar_path 5.23
 Name:           kiconthemes
-Version:        5.22.0
+Version:        5.23.0
 Release:        0
 %define kf5_version %{version}
 BuildRequires:  cmake >= 2.8.12
 BuildRequires:  extra-cmake-modules >= %{_tar_path}
 BuildRequires:  fdupes
+BuildRequires:  karchive-devel >= %{_tar_path}
 BuildRequires:  kconfigwidgets-devel >= %{_tar_path}
 BuildRequires:  kcoreaddons-devel >= %{_tar_path}
 BuildRequires:  kf5-filesystem

++++++ kiconthemes-5.22.0.tar.xz -> kiconthemes-5.23.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/CMakeLists.txt 
new/kiconthemes-5.23.0/CMakeLists.txt
--- old/kiconthemes-5.22.0/CMakeLists.txt       2016-05-07 17:14:57.000000000 
+0200
+++ new/kiconthemes-5.23.0/CMakeLists.txt       2016-06-06 13:36:04.000000000 
+0200
@@ -4,7 +4,7 @@
 
 # ECM setup
 include(FeatureSummary)
-find_package(ECM 5.22.0  NO_MODULE)
+find_package(ECM 5.23.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL 
"https://projects.kde.org/projects/kdesupport/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -20,8 +20,8 @@
 include(ECMMarkNonGuiExecutable)
 include(ECMQtDeclareLoggingCategory)
 
-set(KF5_VERSION "5.22.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.22.0") # handled by release scripts
+set(KF5_VERSION "5.23.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.23.0") # handled by release scripts
 
 ecm_setup_version(${KF5_VERSION}
                   VARIABLE_PREFIX KICONTHEMES
@@ -35,6 +35,7 @@
 find_package(Qt5Svg ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
 find_package(Qt5DBus ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
 
+find_package(KF5Archive ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5I18n ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5ConfigWidgets ${KF5_DEP_VERSION} REQUIRED)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/autotests/CMakeLists.txt 
new/kiconthemes-5.23.0/autotests/CMakeLists.txt
--- old/kiconthemes-5.22.0/autotests/CMakeLists.txt     2016-05-07 
17:14:57.000000000 +0200
+++ new/kiconthemes-5.23.0/autotests/CMakeLists.txt     2016-06-06 
13:36:04.000000000 +0200
@@ -15,4 +15,5 @@
   kiconloader_unittest
   kiconloader_resourcethemetest
   kiconloader_benchmark
+  kicontheme_unittest
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/autotests/breeze.theme 
new/kiconthemes-5.23.0/autotests/breeze.theme
--- old/kiconthemes-5.22.0/autotests/breeze.theme       2016-05-07 
17:14:57.000000000 +0200
+++ new/kiconthemes-5.23.0/autotests/breeze.theme       2016-06-06 
13:36:04.000000000 +0200
@@ -4,6 +4,7 @@
 Hidden=false
 
Directories=22x22/actions,22x22/animations,22x22/apps,22x22/mimetypes,22x22/appsNoContext,22x22/appsNoType,22x22/appsNoContextOrType
 Inherits=oxygen
+FollowsColorScheme=true
 
 [22x22/actions]
 Size=22
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/autotests/coloredsvgicon.svg 
new/kiconthemes-5.23.0/autotests/coloredsvgicon.svg
--- old/kiconthemes-5.22.0/autotests/coloredsvgicon.svg 1970-01-01 
01:00:00.000000000 +0100
+++ new/kiconthemes-5.23.0/autotests/coloredsvgicon.svg 2016-06-06 
13:36:04.000000000 +0200
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="22"
+   height="22"
+   id="svg3049"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="coloredsvgicon.svg">
+  <defs
+     id="defs3051">
+    <style
+       type="text/css"
+       id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#4d4d4d;
+      }
+      .ColorScheme-Background {
+        color:#eff0f1;
+      }
+      .ColorScheme-Highlight {
+        color:#3daee9;
+      }
+      .ColorScheme-HighlightedText {
+        color:#eff0f1;
+      }
+      .ColorScheme-PositiveText {
+        color:#27ae60;
+      }
+      .ColorScheme-NeutralText {
+        color:#f67400;
+      }
+      .ColorScheme-NegativeText {
+        color:#da4453;
+      }
+      </style>
+  </defs>
+  <metadata
+     id="metadata3054">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Capa 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-421.71429,-525.79074)">
+    <rect
+       y="525.79071"
+       x="421.71429"
+       height="22"
+       width="22"
+       id="rect4102"
+       style="fill:currentColor;fill-opacity:1;stroke:none"
+       class="ColorScheme-Text" />
+  </g>
+</svg>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kiconthemes-5.22.0/autotests/kiconloader_unittest.cpp 
new/kiconthemes-5.23.0/autotests/kiconloader_unittest.cpp
--- old/kiconthemes-5.22.0/autotests/kiconloader_unittest.cpp   2016-05-07 
17:14:57.000000000 +0200
+++ new/kiconthemes-5.23.0/autotests/kiconloader_unittest.cpp   2016-06-06 
13:36:04.000000000 +0200
@@ -23,6 +23,7 @@
 #include <QTest>
 #include <QRegularExpression>
 #include <QTemporaryDir>
+#include <QGuiApplication>
 
 #include <kpixmapsequence.h>
 
@@ -115,6 +116,7 @@
         QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), 
testIconsDir.filePath(QStringLiteral("breeze/22x22/mimetypes/x-office-document.png"))));
         QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), 
testIconsDir.filePath(QStringLiteral("breeze/22x22/mimetypes/audio-x-generic.png"))));
         QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), 
testIconsDir.filePath(QStringLiteral("breeze/22x22/mimetypes/unknown.png"))));
+        QVERIFY(QFile::copy(QStringLiteral(":/coloredsvgicon.svg"), 
testIconsDir.filePath(QStringLiteral("breeze/22x22/apps/coloredsvgicon.svg"))));
 
         QVERIFY(QFile::setPermissions(breezeThemeFile, 
QFileDevice::ReadOwner|QFileDevice::WriteOwner));
         KConfig configFile(breezeThemeFile);
@@ -483,6 +485,18 @@
             QVERIFY(ts == foundSize);
         }
     }
+
+    void testColoredSvgIcon()
+    {
+        QPalette pal = qApp->palette();
+        pal.setColor(QPalette::WindowText, QColor(255, 0, 0));
+        qApp->setPalette(pal);
+        QImage img = 
KIconLoader::global()->loadIcon(QStringLiteral("coloredsvgicon"), 
KIconLoader::NoGroup).toImage();
+        QVERIFY(!img.isNull());
+        //Has the image been recolored to red,
+        //that is the color we wrote in kdeglobals as text color?
+        QCOMPARE(img.pixel(0,0), (uint)4294901760);
+    }
 };
 
 QTEST_MAIN(KIconLoader_UnitTest)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/autotests/kicontheme_unittest.cpp 
new/kiconthemes-5.23.0/autotests/kicontheme_unittest.cpp
--- old/kiconthemes-5.22.0/autotests/kicontheme_unittest.cpp    1970-01-01 
01:00:00.000000000 +0100
+++ new/kiconthemes-5.23.0/autotests/kicontheme_unittest.cpp    2016-06-06 
13:36:04.000000000 +0200
@@ -0,0 +1,60 @@
+/*
+    Copyright (C) 2016 Harald Sitter <[email protected]>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include <QStandardPaths>
+#include <QTest>
+
+#include <kicontheme.h>
+
+class KIconTheme_UnitTest : public QObject
+{
+    Q_OBJECT
+
+private Q_SLOTS:
+    void initTestCase()
+    {
+        QStandardPaths::setTestModeEnabled(true);
+    }
+
+    void init()
+    {
+        KIconTheme::forceThemeForTests(QString()); // Reset override.
+    }
+
+    void testForceThemeForTests()
+    {
+        auto forcedName = QStringLiteral("kitten");
+        auto resolvedCurrent = KIconTheme::current();
+        QVERIFY2(KIconTheme::current() != forcedName,
+                 "current theme initially expected to not be mangled");
+        // Force a specific theme.
+        KIconTheme::forceThemeForTests(forcedName);
+        QCOMPARE(KIconTheme::current(), forcedName);
+        // Reset override.
+        KIconTheme::forceThemeForTests(QString());
+        QCOMPARE(KIconTheme::current(), resolvedCurrent);
+        // And then override again to make sure we still can.
+        KIconTheme::forceThemeForTests(forcedName);
+        QCOMPARE(KIconTheme::current(), forcedName);
+    }
+};
+
+QTEST_MAIN(KIconTheme_UnitTest)
+
+#include "kicontheme_unittest.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/autotests/resources.qrc 
new/kiconthemes-5.23.0/autotests/resources.qrc
--- old/kiconthemes-5.22.0/autotests/resources.qrc      2016-05-07 
17:14:57.000000000 +0200
+++ new/kiconthemes-5.23.0/autotests/resources.qrc      2016-06-06 
13:36:04.000000000 +0200
@@ -6,6 +6,7 @@
     <file>anim-22x22.png</file>
     <file>oxygen.theme</file>
     <file>breeze.theme</file>
+    <file>coloredsvgicon.svg</file>
     <file alias="/icons/themeinresource/index.theme">breeze.theme</file>
     <file 
alias="/icons/themeinresource/22x22/appsNoContext/someiconintheme.png">test-22x22.png</file>
 </qresource>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/metainfo.yaml 
new/kiconthemes-5.23.0/metainfo.yaml
--- old/kiconthemes-5.22.0/metainfo.yaml        2016-05-07 17:14:57.000000000 
+0200
+++ new/kiconthemes-5.23.0/metainfo.yaml        2016-06-06 13:36:04.000000000 
+0200
@@ -11,3 +11,7 @@
  - qmake: KIconThemes
    cmake: "KF5::IconThemes"
 cmakename: KF5IconThemes
+
+public_lib: true
+group: Frameworks
+subgroup: Tier 3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/src/CMakeLists.txt 
new/kiconthemes-5.23.0/src/CMakeLists.txt
--- old/kiconthemes-5.22.0/src/CMakeLists.txt   2016-05-07 17:14:57.000000000 
+0200
+++ new/kiconthemes-5.23.0/src/CMakeLists.txt   2016-06-06 13:36:04.000000000 
+0200
@@ -26,6 +26,7 @@
   PRIVATE
     Qt5::DBus
     Qt5::Svg
+    KF5::Archive       # for KCompressionDevice
     KF5::I18n          # for i18n in KIconDialog
     KF5::WidgetsAddons # for KPixmapSequence family
     KF5::ItemViews      # for KListWidgetSearchLine
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/src/kiconengine.cpp 
new/kiconthemes-5.23.0/src/kiconengine.cpp
--- old/kiconthemes-5.22.0/src/kiconengine.cpp  2016-05-07 17:14:57.000000000 
+0200
+++ new/kiconthemes-5.23.0/src/kiconengine.cpp  2016-06-06 13:36:04.000000000 
+0200
@@ -51,6 +51,9 @@
     case QIcon::Disabled:
         kstate = KIconLoader::DisabledState;
         break;
+    case QIcon::Selected:
+        kstate = KIconLoader::SelectedState;
+        break;
     }
     return kstate;
 }
@@ -93,6 +96,7 @@
         return pm;
     }
 
+
     const int kstate = qIconModeToKIconState(mode);
     const int iconSize = qMin(size.width(), size.height());
     QPixmap pix = mIconLoader.data()->loadIcon(mIconName, 
KIconLoader::Desktop, iconSize, kstate, mOverlays);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/src/kiconloader.cpp 
new/kiconthemes-5.23.0/src/kiconloader.cpp
--- old/kiconthemes-5.22.0/src/kiconloader.cpp  2016-05-07 17:14:57.000000000 
+0200
+++ new/kiconthemes-5.23.0/src/kiconloader.cpp  2016-06-06 13:36:04.000000000 
+0200
@@ -34,7 +34,7 @@
 #include <QtCore/QDataStream>
 #include <QtCore/QByteArray>
 #include <QtCore/QStringBuilder> // % operator for QString
-#include <QCoreApplication>
+#include <QGuiApplication>
 #include <QIcon>
 #include <QImage>
 #include <QMovie>
@@ -48,6 +48,10 @@
 #include <ksharedconfig.h>
 #include <QtDBus/QDBusConnection>
 #include <QDBusMessage>
+#include <QSvgRenderer>
+#include <QXmlStreamReader>
+#include <QXmlStreamWriter>
+#include <QCryptographicHash>
 
 // kdeui
 #include "kicontheme.h"
@@ -57,8 +61,38 @@
 //kwidgetsaddons
 #include <kpixmapsequence.h>
 
+#include <kcolorscheme.h>
+#include <kcompressiondevice.h>
+
+namespace {
 // Used to make cache keys for icons with no group. Result type is QString*
-Q_GLOBAL_STATIC_WITH_ARGS(QString, NULL_EFFECT_FINGERPRINT, 
(QString::fromLatin1("noeffect")))
+QString NULL_EFFECT_FINGERPRINT()
+{
+    return QStringLiteral("noeffect");
+}
+
+QString STYLESHEET_TEMPLATE()
+{
+    return QStringLiteral(".ColorScheme-Text {\
+color:%1;\
+}\
+.ColorScheme-Background{\
+color:%2;\
+}\
+.ColorScheme-Highlight{\
+color:%3;\
+}\
+.ColorScheme-PositiveText{\
+color:%4;\
+}\
+.ColorScheme-NeutralText{\
+color:%5;\
+}\
+.ColorScheme-NegativeText{\
+color:%6;\
+}");
+}
+}
 
 /**
  * Checks for relative paths quickly on UNIX-alikes, slowly on everything else.
@@ -80,6 +114,13 @@
     QString path;
 };
 
+static QString paletteId(const QPalette &pal)
+{
+    const QString colorsString = pal.text().color().name() + 
pal.highlight().color().name() + pal.highlightedText().color().name();
+    //use md5 as speed is needed, not cryptographic security
+    return QCryptographicHash::hash(colorsString.toUtf8(), 
QCryptographicHash::Md5);
+}
+
 /*** KIconThemeNode: A node in the icon theme dependancy tree. ***/
 
 class KIconThemeNode
@@ -254,11 +295,20 @@
 
     /**
      * @internal
+     * If the icon is an SVG file, process it generating a stylesheet
+     * following the current color scheme. in this case the icon can use named 
colors
+     * as text color, background color, highlight color, 
positive/neutral/negative color
+     * @see KColorScheme
+     */
+    QByteArray processSvg(const QString &path, KIconLoader::States state) 
const;
+
+    /**
+     * @internal
      * Creates the QImage for @p path, using SVG rendering as appropriate.
      * @p size is only used for scalable images, but if non-zero non-scalable
      * images will be resized anyways.
      */
-    QImage createIconImage(const QString &path, int size = 0);
+    QImage createIconImage(const QString &path, int size = 0, 
KIconLoader::States state = KIconLoader::DefaultState);
 
     /**
      * @internal
@@ -611,7 +661,6 @@
     // present in an inherited theme, and hicolor goes last.
 
     addInheritedThemes(node, appname);
-    addThemeByName(KIconTheme::defaultThemeName(), appname);
     addThemeByName(QStringLiteral("hicolor"), appname);
 }
 
@@ -764,22 +813,84 @@
            % QLatin1Char('_')
            % overlays.join(QStringLiteral("_"))
            % (group >= 0 ? mpEffect.fingerprint(group, state)
-              : *NULL_EFFECT_FINGERPRINT());
+              : NULL_EFFECT_FINGERPRINT())
+           % QLatin1Char('_')
+           % paletteId(qApp->palette())
+           % (q->theme() && q->theme()->followsColorScheme() && state == 
KIconLoader::SelectedState ? QStringLiteral("_selected") : QString());
+}
+
+QByteArray KIconLoaderPrivate::processSvg(const QString &path, 
KIconLoader::States state) const
+{
+    QScopedPointer<QIODevice> device;
+
+    if (path.endsWith(QLatin1String("svgz"))) {
+        device.reset(new KCompressionDevice(path, KCompressionDevice::GZip));
+    } else {
+        device.reset(new QFile(path));
+    }
+
+    if (!device->open(QIODevice::ReadOnly)) {
+        return QByteArray();
+    }
+
+    const QPalette pal = qApp->palette();
+    KColorScheme scheme(QPalette::Active, KColorScheme::Window);
+    QString styleSheet = STYLESHEET_TEMPLATE().arg(
+        state == KIconLoader::SelectedState ? 
pal.highlightedText().color().name() : pal.windowText().color().name(),
+        state == KIconLoader::SelectedState ? pal.highlight().color().name() : 
pal.window().color().name(),
+        state == KIconLoader::SelectedState ? 
pal.highlightedText().color().name() : pal.highlight().color().name(),
+        scheme.foreground(KColorScheme::PositiveText).color().name(),
+        scheme.foreground(KColorScheme::NeutralText).color().name(),
+        scheme.foreground(KColorScheme::NegativeText).color().name());
+
+    QByteArray processedContents;
+    QXmlStreamReader reader(device.data());
+
+    QBuffer buffer(&processedContents);
+    buffer.open(QIODevice::WriteOnly);
+    QXmlStreamWriter writer(&buffer);
+    while (!reader.atEnd()) {
+        if (reader.readNext() == QXmlStreamReader::StartElement &&
+            reader.qualifiedName() == QLatin1String("style") &&
+            reader.attributes().value(QLatin1String("id")) == 
QLatin1String("current-color-scheme")) {
+            writer.writeStartElement(QLatin1String("style"));
+            writer.writeAttributes(reader.attributes());
+            writer.writeCharacters(styleSheet);
+            writer.writeEndElement();
+            while (reader.tokenType() != QXmlStreamReader::EndElement) {
+                reader.readNext();
+            }
+        } else if (reader.tokenType() != QXmlStreamReader::Invalid) {
+            writer.writeCurrentToken(reader);
+        }
+    }
+    buffer.close();
+
+    return processedContents;
 }
 
-QImage KIconLoaderPrivate::createIconImage(const QString &path, int size)
+QImage KIconLoaderPrivate::createIconImage(const QString &path, int size, 
KIconLoader::States state)
 {
-    QImageReader reader(path);
+    //TODO: metadata in the theme to make it do this only if explicitly 
supported?
+    QScopedPointer<QImageReader> reader;
+    QBuffer buffer;
+
+    if (q->theme()->followsColorScheme() && 
(path.endsWith(QLatin1String("svg")) || path.endsWith(QLatin1String("svgz")))) {
+        buffer.setData(processSvg(path, state));
+        reader.reset(new QImageReader(&buffer));
+    } else {
+        reader.reset(new QImageReader(path));
+    }
 
-    if (!reader.canRead()) {
+    if (!reader->canRead()) {
         return QImage();
     }
 
     if (size != 0) {
-        reader.setScaledSize(QSize(size, size));
+        reader->setScaledSize(QSize(size, size));
     }
 
-    return reader.read();
+    return reader->read();
 }
 
 void KIconLoaderPrivate::insertCachedPixmapWithPath(
@@ -1145,7 +1256,7 @@
 
     QImage img;
     if (!path.isEmpty()) {
-        img = d->createIconImage(path, size);
+        img = d->createIconImage(path, size, (KIconLoader::States)state);
     }
 
     if (group >= 0) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/src/kiconloader.h 
new/kiconthemes-5.23.0/src/kiconloader.h
--- old/kiconthemes-5.22.0/src/kiconloader.h    2016-05-07 17:14:57.000000000 
+0200
+++ new/kiconthemes-5.23.0/src/kiconloader.h    2016-06-06 13:36:04.000000000 
+0200
@@ -171,6 +171,7 @@
         DefaultState,  ///< The default state.
         ActiveState,   ///< Icon is active.
         DisabledState, ///< Icon is disabled.
+        SelectedState, ///< Icon is selected. @since 5.22
         LastState      ///< Last state (last constant)
     };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/src/kicontheme.cpp 
new/kiconthemes-5.23.0/src/kicontheme.cpp
--- old/kiconthemes-5.22.0/src/kicontheme.cpp   2016-05-07 17:14:57.000000000 
+0200
+++ new/kiconthemes-5.23.0/src/kicontheme.cpp   2016-06-06 13:36:04.000000000 
+0200
@@ -54,7 +54,9 @@
     QStringList mInherits;
     QStringList mExtensions;
     QVector<KIconThemeDir *> mDirs;
+    bool followsColorScheme : 1;
 };
+Q_GLOBAL_STATIC(QString, _themeOverride)
 Q_GLOBAL_STATIC(QString, _theme)
 Q_GLOBAL_STATIC(QStringList, _theme_list)
 
@@ -118,7 +120,6 @@
 KIconTheme::KIconTheme(const QString &name, const QString &appName, const 
QString &basePathHint)
     : d(new KIconThemePrivate)
 {
-
     d->mInternalName = name;
 
     QStringList themeDirs;
@@ -191,13 +192,14 @@
     d->mInherits = cfg.readEntry("Inherits", QStringList());
     if (name != defaultThemeName()) {
         for (QStringList::Iterator it = d->mInherits.begin(); it != 
d->mInherits.end(); ++it) {
-            if (*it == QLatin1String("default") || *it == 
QLatin1String("hicolor")) {
+            if (*it == QLatin1String("default")) {
                 *it = defaultThemeName();
             }
         }
     }
 
     d->hidden = cfg.readEntry("Hidden", false);
+    d->followsColorScheme = cfg.readEntry("FollowsColorScheme", false);
     d->example = cfg.readPathEntry("Example", QString());
     d->screenshot = cfg.readPathEntry("ScreenShot", QString());
     d->mExtensions = cfg.readEntry("KDE-Extensions", QStringList{ ".png", 
".svgz", ".svg", ".xpm" });
@@ -406,6 +408,11 @@
     return QString();
 }
 
+bool KIconTheme::followsColorScheme() const
+{
+    return d->followsColorScheme;
+}
+
 QString KIconTheme::iconPath(const QString &name, int size, 
KIconLoader::MatchType match) const
 {
     QString path;
@@ -488,26 +495,42 @@
 // static
 QString KIconTheme::current()
 {
-    // Static pointer because of unloading problems wrt DSO's.
+    // Static pointers because of unloading problems wrt DSO's.
+    if (_themeOverride && !_themeOverride->isEmpty()) {
+        *_theme() = *_themeOverride();
+    }
     if (!_theme()->isEmpty()) {
         return *_theme();
     }
 
-    KConfigGroup cg(KSharedConfig::openConfig(), "Icons");
-    *_theme() = cg.readEntry("Theme", defaultThemeName());
-    if (*_theme() == QLatin1String("hicolor")) {
-        *_theme() = defaultThemeName();
-    }
-    /*    if (_theme->isEmpty())
-        {
-            if (QPixmap::defaultDepth() > 8)
-                *_theme = defaultThemeName();
-            else
-                *_theme = QLatin1String("locolor");
-        }*/
+    QString theme;
+    // Check application specific config for a theme setting.
+    KConfigGroup app_cg(KSharedConfig::openConfig(QString(), 
KConfig::NoGlobals), "Icons");
+    theme = app_cg.readEntry("Theme", QString());
+    if (theme.isEmpty() || theme == QLatin1String("hicolor")) {
+        // No theme, try to use Qt's. A Platform plugin might have set
+        // a good theme there.
+        theme = QIcon::themeName();
+    }
+    if (theme.isEmpty() || theme == QLatin1String("hicolor")) {
+        // Still no theme, try config with kdeglobals.
+        KConfigGroup cg(KSharedConfig::openConfig(), "Icons");
+        theme = cg.readEntry("Theme", QString());
+    }
+    if (theme.isEmpty() || theme == QLatin1String("hicolor")) {
+        // Still no good theme, use default.
+        theme = defaultThemeName();
+    }
+    *_theme() = theme;
     return *_theme();
 }
 
+void KIconTheme::forceThemeForTests(const QString &themeName)
+{
+    *_themeOverride() = themeName;
+    _theme()->clear(); // ::current sets this again based on conditions
+}
+
 // static
 QStringList KIconTheme::list()
 {
@@ -563,7 +586,7 @@
 // static
 QString KIconTheme::defaultThemeName()
 {
-    return QStringLiteral("oxygen");
+    return QStringLiteral("hicolor");
 }
 
 void KIconTheme::assignIconsToContextMenu(ContextMenus type,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiconthemes-5.22.0/src/kicontheme.h 
new/kiconthemes-5.23.0/src/kicontheme.h
--- old/kiconthemes-5.22.0/src/kicontheme.h     2016-05-07 17:14:57.000000000 
+0200
+++ new/kiconthemes-5.23.0/src/kicontheme.h     2016-06-06 13:36:04.000000000 
+0200
@@ -182,6 +182,15 @@
     bool hasContext(KIconLoader::Context context) const;
 
     /**
+     * If true this theme is made by SVG icons that will be colorized 
following the system
+     * color scheme. This is necessary for monochrome themes that should look 
visible on both
+     * light and dark color schemes.
+     * @return true if the SVG will be colorized with a stylesheet.
+     * @since 5.22
+     */
+    bool followsColorScheme() const;
+
+    /**
      * List all icon themes installed on the system, global and local.
      * @return the list of all icon themes
      */
@@ -194,6 +203,26 @@
     static QString current();
 
     /**
+     * Force a current theme and disable automatic resolution of the current
+     * theme in favor of the forced theme.
+     *
+     * To reset a forced theme, simply set an empty themeName.
+     *
+     * @param themeName name of the theme to force as current theme, or an
+     *        empty string to unset theme forcing.
+     *
+     * @note This should only be used when a very precise expectation about
+     *       the current theme is present. Most notably in unit tests
+     *       this can be used to force a given theme.
+     *
+     * @warning A forced theme persists across reconfigure() calls!
+     *
+     * @see current
+     * @since 5.23
+     */
+    static void forceThemeForTests(const QString &themeName);
+
+    /**
      * Reconfigure the theme.
      */
     static void reconfigure();


Reply via email to