Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kiconthemes for openSUSE:Factory checked in at 2021-04-12 12:34:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kiconthemes (Old) and /work/SRC/openSUSE:Factory/.kiconthemes.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kiconthemes" Mon Apr 12 12:34:29 2021 rev:95 rq:884262 version:5.81.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kiconthemes/kiconthemes.changes 2021-04-06 17:29:00.463071255 +0200 +++ /work/SRC/openSUSE:Factory/.kiconthemes.new.2401/kiconthemes.changes 2021-04-12 12:36:26.229302212 +0200 @@ -1,0 +2,13 @@ +Mon Apr 5 07:12:29 UTC 2021 - Christophe Giboudeaux <[email protected]> + +- Update to 5.81.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.81.0 +- Too many changes since 5.80.0, only listing bugfixes: + * ensure qrc + QDir::searchPaths work for icons (kde#434451) +- Drop patches: + * 0001-ensure-qrc-QDir-searchPaths-work-for-icons.patch + * 3262669e.patch + +------------------------------------------------------------------- Old: ---- 0001-ensure-qrc-QDir-searchPaths-work-for-icons.patch 3262669e.patch kiconthemes-5.80.0.tar.xz kiconthemes-5.80.0.tar.xz.sig New: ---- kiconthemes-5.81.0.tar.xz kiconthemes-5.81.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kiconthemes.spec ++++++ --- /var/tmp/diff_new_pack.qp5jJH/_old 2021-04-12 12:36:26.829303141 +0200 +++ /var/tmp/diff_new_pack.qp5jJH/_new 2021-04-12 12:36:26.833303147 +0200 @@ -17,14 +17,14 @@ %define lname libKF5IconThemes5 -%define _tar_path 5.80 +%define _tar_path 5.81 # 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 lang Name: kiconthemes -Version: 5.80.0 +Version: 5.81.0 Release: 0 Summary: Icon GUI utilities License: LGPL-2.1-or-later AND GPL-2.0-or-later @@ -36,10 +36,6 @@ Source2: frameworks.keyring %endif Source99: baselibs.conf -# PATCH-FIX-UPSTREAM -Patch1: 0001-ensure-qrc-QDir-searchPaths-work-for-icons.patch -# PATCH-FIX-UPSTREAM -Patch2: 3262669e.patch BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: fdupes BuildRequires: cmake(KF5Archive) >= %{_kf5_bugfix_version} ++++++ kiconthemes-5.80.0.tar.xz -> kiconthemes-5.81.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/CMakeLists.txt new/kiconthemes-5.81.0/CMakeLists.txt --- old/kiconthemes-5.80.0/CMakeLists.txt 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/CMakeLists.txt 2021-04-04 13:43:06.000000000 +0200 @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.5) -set(KF_VERSION "5.80.0") # handled by release scripts -set(KF_DEP_VERSION "5.80.0") # handled by release scripts +set(KF_VERSION "5.81.0") # handled by release scripts +set(KF_DEP_VERSION "5.81.0") # handled by release scripts project(KIconThemes VERSION ${KF_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.80.0 NO_MODULE) +find_package(ECM 5.81.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) @@ -56,7 +56,7 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII) remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00) -add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054F00) +add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055000) add_definitions(-DQT_NO_FOREACH) add_definitions(-DTRANSLATION_DOMAIN=\"kiconthemes5\") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/autotests/CMakeLists.txt new/kiconthemes-5.81.0/autotests/CMakeLists.txt --- old/kiconthemes-5.80.0/autotests/CMakeLists.txt 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/autotests/CMakeLists.txt 2021-04-04 13:43:06.000000000 +0200 @@ -16,6 +16,7 @@ kiconloader_resourcethemetest kicontheme_unittest kiconengine_unittest + kiconengine_scaled_unittest kicondialog_unittest ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/autotests/kiconengine_scaled_unittest.cpp new/kiconthemes-5.81.0/autotests/kiconengine_scaled_unittest.cpp --- old/kiconthemes-5.80.0/autotests/kiconengine_scaled_unittest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/kiconthemes-5.81.0/autotests/kiconengine_scaled_unittest.cpp 2021-04-04 13:43:06.000000000 +0200 @@ -0,0 +1,58 @@ +/* + SPDX-FileCopyrightText: 2021 Volker Krause <[email protected]> + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include <QStandardPaths> +#include <QTest> + +#include <KIconEngine> +#include <KIconLoader> + +static int setupEnvBeforeQApplication = []() { + qunsetenv("QT_SCREEN_SCALE_FACTORS"); + qputenv("QT_SCALE_FACTOR", "2.0"); + return 1; +}(); + +class KIconEngine_Scaled_UnitTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase() + { + QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + QStandardPaths::setTestModeEnabled(true); + } + + void testCenterIcon() + { + QIcon icon(new KIconEngine(QStringLiteral(":/test-22x22.png"), KIconLoader::global())); + QVERIFY(!icon.isNull()); + + QWindow w; + QCOMPARE(w.devicePixelRatio(), 2.0); + auto image = icon.pixmap(&w, QSize(22, 22)).toImage(); + QCOMPARE(image.devicePixelRatio(), 2.0); + QCOMPARE(image.size(), QSize(44, 44)); + + QImage unscaled; + QVERIFY(unscaled.load(QStringLiteral(":/test-22x22.png"))); + QVERIFY(!unscaled.isNull()); + QCOMPARE(unscaled.size(), QSize(22, 22)); + unscaled.setDevicePixelRatio(2.0); + unscaled = unscaled.convertToFormat(image.format()).scaled(44, 44, Qt::KeepAspectRatio, Qt::SmoothTransformation); + QCOMPARE(image, unscaled); + + // center vertically + QVERIFY(icon.pixmap(&w, QSize(22, 26)).toImage().copy(0, 4, 44, 44) == image); + // center horizontally + QVERIFY(icon.pixmap(&w, QSize(26, 22)).toImage().copy(4, 0, 44, 44) == image); + } +}; + +QTEST_MAIN(KIconEngine_Scaled_UnitTest) + +#include "kiconengine_scaled_unittest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/autotests/kiconengine_unittest.cpp new/kiconthemes-5.81.0/autotests/kiconengine_unittest.cpp --- old/kiconthemes-5.80.0/autotests/kiconengine_unittest.cpp 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/autotests/kiconengine_unittest.cpp 2021-04-04 13:43:06.000000000 +0200 @@ -122,6 +122,26 @@ QVERIFY(icon.pixmap(26, 22).toImage().copy(2, 0, 22, 22) == image); } + void testNonSquareSvg() + { + QIcon icon(new KIconEngine(QStringLiteral(":/nonsquare.svg"), KIconLoader::global())); + QVERIFY(!icon.isNull()); + + // verify we get the content fully fitted in when asking for the right aspect ratio + const QImage image = icon.pixmap(40, 20).toImage(); + QCOMPARE(image.pixelColor(0, 0), QColor(255, 0, 0)); + QCOMPARE(image.pixelColor(19, 9), QColor(255, 0, 0)); + QCOMPARE(image.pixelColor(39, 0), QColor(0, 255, 0)); + QCOMPARE(image.pixelColor(20, 9), QColor(0, 255, 0)); + QCOMPARE(image.pixelColor(0, 19), QColor(0, 0, 255)); + QCOMPARE(image.pixelColor(19, 10), QColor(0, 0, 255)); + QCOMPARE(image.pixelColor(39, 19), QColor(255, 255, 0)); + QCOMPARE(image.pixelColor(20, 10), QColor(255, 255, 0)); + + // and now with a wrong aspect ratio + QCOMPARE(icon.pixmap(40, 40).toImage().convertToFormat(image.format()).copy(0, 10, 40, 20), image); + } + private: QDir testIconsDir; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/autotests/kiconloader_unittest.cpp new/kiconthemes-5.81.0/autotests/kiconloader_unittest.cpp --- old/kiconthemes-5.80.0/autotests/kiconloader_unittest.cpp 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/autotests/kiconloader_unittest.cpp 2021-04-04 13:43:06.000000000 +0200 @@ -7,6 +7,7 @@ #include <kiconloader.h> +#include <QDir> #include <QRegularExpression> #include <QStandardPaths> #include <QTest> @@ -255,9 +256,10 @@ QPixmap pix = icon.pixmap(QSize(22, 22)); QVERIFY(!pix.isNull()); } - QCOMPARE(icon.actualSize(QSize(96, 22)), QSize(22, 22)); - QCOMPARE(icon.actualSize(QSize(22, 96)), QSize(22, 22)); - QCOMPARE(icon.actualSize(QSize(22, 16)), QSize(16, 16)); + // Qt's implementation of actualSize does not crop to squares, ensure we don't do that either + QCOMPARE(icon.actualSize(QSize(96, 22)), QSize(96, 22)); + QCOMPARE(icon.actualSize(QSize(22, 96)), QSize(22, 96)); + QCOMPARE(icon.actualSize(QSize(22, 16)), QSize(22, 16)); // Can we ask for a really small size? { @@ -494,6 +496,20 @@ uintToHex(testColorWithAlpha.rgba(), argbHex.data()); QCOMPARE(argbHex, QStringLiteral("7b6496c8")); } + + void testQDirSetSearchPaths() + { + // setup search path for testprefix: => we shall find the iconinspecialsearchpath.svg afterwards, see e.g. bug 434451 + QDir::setSearchPaths("testprefix", QStringList(":/searchpathdefineddir")); + QPixmap pix = KIconLoader::global()->loadIcon(QStringLiteral("testprefix:iconinspecialsearchpath.svg"), + KIconLoader::NoGroup, + 24, + KIconLoader::DefaultState, + QStringList(), + nullptr, + true); + QVERIFY(!pix.isNull()); + } }; QTEST_MAIN(KIconLoader_UnitTest) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/autotests/nonsquare.svg new/kiconthemes-5.81.0/autotests/nonsquare.svg --- old/kiconthemes-5.80.0/autotests/nonsquare.svg 1970-01-01 01:00:00.000000000 +0100 +++ new/kiconthemes-5.81.0/autotests/nonsquare.svg 2021-04-04 13:43:06.000000000 +0200 @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + SPDX-License-Identifier: CC0-1.0 + SPDX-FileCopyrightText: none +--> +<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="20" height="10" version="1.1"> + <rect y="0" x="0" height="5" width="10" style="fill:#ff0000;fill-opacity:1;stroke:none"/> + <rect y="0" x="10" height="5" width="10" style="fill:#00ff00;fill-opacity:1;stroke:none"/> + <rect y="5" x="0" height="5" width="10" style="fill:#0000ff;fill-opacity:1;stroke:none"/> + <rect y="5" x="10" height="5" width="10" style="fill:#ffff00;fill-opacity:1;stroke:none"/> +</svg> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/autotests/resources.qrc new/kiconthemes-5.81.0/autotests/resources.qrc --- old/kiconthemes-5.80.0/autotests/resources.qrc 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/autotests/resources.qrc 2021-04-04 13:43:06.000000000 +0200 @@ -7,7 +7,9 @@ <file>oxygen.theme</file> <file>breeze.theme</file> <file>coloredsvgicon.svg</file> + <file>nonsquare.svg</file> <file alias="/icons/themeinresource/index.theme">breeze.theme</file> <file alias="/icons/themeinresource/22x22/appsNoContext/someiconintheme.png">test-22x22.png</file> + <file alias="/searchpathdefineddir/iconinspecialsearchpath.svg">coloredsvgicon.svg</file> </qresource> </RCC> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/po/it/kiconthemes5.po new/kiconthemes-5.81.0/po/it/kiconthemes5.po --- old/kiconthemes-5.80.0/po/it/kiconthemes5.po 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/po/it/kiconthemes5.po 2021-04-04 13:43:06.000000000 +0200 @@ -7,7 +7,7 @@ # Giovanni Venturi <[email protected]>, 2006. # Nicola Ruggero <[email protected]>, 2006, 2007. # Luigi Toscano <[email protected]>, 2008, 2009, 2010, 2011, 2012, 2014, 2015. -# Vincenzo Reale <[email protected]>, 2018. +# Vincenzo Reale <[email protected]>, 2018. msgid "" msgstr "" "Project-Id-Version: kio4\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/po/nb/kiconthemes5.po new/kiconthemes-5.81.0/po/nb/kiconthemes5.po --- old/kiconthemes-5.80.0/po/nb/kiconthemes5.po 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/po/nb/kiconthemes5.po 2021-04-04 13:43:06.000000000 +0200 @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: kio4\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" -"POT-Creation-Date: 2021-01-23 02:29+0100\n" +"POT-Creation-Date: 2021-03-02 02:36+0100\n" "PO-Revision-Date: 2012-12-30 20:55+0100\n" "Last-Translator: Bj??rn Steensrud <[email protected]>\n" "Language-Team: Norwegian Bokm??l <[email protected]>\n" @@ -29,92 +29,92 @@ "X-Accelerator-Marker: &\n" "X-Text-Markup: kde4\n" -#: kicondialog.cpp:258 kicondialog.cpp:270 kicondialog.cpp:598 +#: kicondialog.cpp:266 kicondialog.cpp:279 kicondialog.cpp:604 #, kde-format msgid "Select Icon" msgstr "Velg ikon" -#: kicondialog.cpp:286 +#: kicondialog.cpp:295 #, kde-format msgid "Icon Source" msgstr "Ikonkilde" -#: kicondialog.cpp:295 +#: kicondialog.cpp:304 #, kde-format msgid "S&ystem icons:" msgstr "&Systemikoner:" -#: kicondialog.cpp:301 +#: kicondialog.cpp:310 #, kde-format msgid "O&ther icons:" msgstr "A&ndre ikoner:" -#: kicondialog.cpp:304 +#: kicondialog.cpp:313 #, kde-format msgid "&Browse..." msgstr "&Bla gjennom?????" -#: kicondialog.cpp:315 +#: kicondialog.cpp:324 #, kde-format msgid "&Search:" msgstr "&S??k:" -#: kicondialog.cpp:322 +#: kicondialog.cpp:331 #, kde-format msgid "Search interactively for icon names (e.g. folder)." msgstr "S??k interaktivt etter ikon-navn (f.eks. mapper)." -#: kicondialog.cpp:352 +#: kicondialog.cpp:360 #, kde-format msgid "Actions" msgstr "Handlinger" -#: kicondialog.cpp:353 +#: kicondialog.cpp:361 #, kde-format msgid "Applications" msgstr "Programmer" -#: kicondialog.cpp:354 +#: kicondialog.cpp:362 #, kde-format msgid "Categories" msgstr "Kategorier" -#: kicondialog.cpp:355 +#: kicondialog.cpp:363 #, kde-format msgid "Devices" msgstr "Enheter" -#: kicondialog.cpp:356 +#: kicondialog.cpp:364 #, kde-format msgid "Emblems" msgstr "Emblemer" -#: kicondialog.cpp:357 +#: kicondialog.cpp:365 #, kde-format msgid "Emotes" msgstr "Emotikoner" -#: kicondialog.cpp:358 +#: kicondialog.cpp:366 #, kde-format msgid "Mimetypes" msgstr "Mime-typer" -#: kicondialog.cpp:359 +#: kicondialog.cpp:367 #, kde-format msgid "Places" msgstr "Steder" -#: kicondialog.cpp:360 +#: kicondialog.cpp:368 #, kde-format msgid "Status" msgstr "Status" -#: kicondialog.cpp:361 +#: kicondialog.cpp:369 #, kde-format msgid "All" msgstr "" -#: kicondialog.cpp:598 +#: kicondialog.cpp:604 #, kde-format msgid "" "*.ico *.png *.xpm *.svg *.svgz|Icon Files (*.ico *.png *.xpm *.svg *.svgz)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/po/se/kiconthemes5.po new/kiconthemes-5.81.0/po/se/kiconthemes5.po --- old/kiconthemes-5.80.0/po/se/kiconthemes5.po 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/po/se/kiconthemes5.po 2021-04-04 13:43:06.000000000 +0200 @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: kio4\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" -"POT-Creation-Date: 2021-01-23 02:29+0100\n" +"POT-Creation-Date: 2021-03-02 02:36+0100\n" "PO-Revision-Date: 2012-06-03 01:00+0200\n" "Last-Translator: B??rre Gaup <[email protected]>\n" "Language-Team: Northern Sami <[email protected]>\n" @@ -19,92 +19,92 @@ "X-Accelerator-Marker: &\n" "X-Text-Markup: kde4\n" -#: kicondialog.cpp:258 kicondialog.cpp:270 kicondialog.cpp:598 +#: kicondialog.cpp:266 kicondialog.cpp:279 kicondialog.cpp:604 #, kde-format msgid "Select Icon" msgstr "V??llje gova??a" -#: kicondialog.cpp:286 +#: kicondialog.cpp:295 #, kde-format msgid "Icon Source" msgstr "Gova??g??ldu" -#: kicondialog.cpp:295 +#: kicondialog.cpp:304 #, kde-format msgid "S&ystem icons:" msgstr "&Vuog??datgova??at:" -#: kicondialog.cpp:301 +#: kicondialog.cpp:310 #, kde-format msgid "O&ther icons:" msgstr "Ea&r?? gova??at:" -#: kicondialog.cpp:304 +#: kicondialog.cpp:313 #, kde-format msgid "&Browse..." msgstr "&Bl??????e?????" -#: kicondialog.cpp:315 +#: kicondialog.cpp:324 #, kde-format msgid "&Search:" msgstr "&Oza:" -#: kicondialog.cpp:322 +#: kicondialog.cpp:331 #, kde-format msgid "Search interactively for icon names (e.g. folder)." msgstr "Oza gova??namaid interaktiivala????at (omd. m??hpa)." -#: kicondialog.cpp:352 +#: kicondialog.cpp:360 #, kde-format msgid "Actions" msgstr "Doaimmat" -#: kicondialog.cpp:353 +#: kicondialog.cpp:361 #, kde-format msgid "Applications" msgstr "Progr??mmat" -#: kicondialog.cpp:354 +#: kicondialog.cpp:362 #, kde-format msgid "Categories" msgstr "L??git" -#: kicondialog.cpp:355 +#: kicondialog.cpp:363 #, kde-format msgid "Devices" msgstr "Ovttadagat" -#: kicondialog.cpp:356 +#: kicondialog.cpp:364 #, kde-format msgid "Emblems" msgstr "Emblemat" -#: kicondialog.cpp:357 +#: kicondialog.cpp:365 #, kde-format msgid "Emotes" msgstr "Moj??nat" -#: kicondialog.cpp:358 +#: kicondialog.cpp:366 #, kde-format msgid "Mimetypes" msgstr "MIME-??l??jat" -#: kicondialog.cpp:359 +#: kicondialog.cpp:367 #, kde-format msgid "Places" msgstr "B??ikkit" -#: kicondialog.cpp:360 +#: kicondialog.cpp:368 #, kde-format msgid "Status" msgstr "St??htus" -#: kicondialog.cpp:361 +#: kicondialog.cpp:369 #, kde-format msgid "All" msgstr "Buot" -#: kicondialog.cpp:598 +#: kicondialog.cpp:604 #, kde-format msgid "" "*.ico *.png *.xpm *.svg *.svgz|Icon Files (*.ico *.png *.xpm *.svg *.svgz)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/po/zh_CN/kiconthemes5.po new/kiconthemes-5.81.0/po/zh_CN/kiconthemes5.po --- old/kiconthemes-5.80.0/po/zh_CN/kiconthemes5.po 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/po/zh_CN/kiconthemes5.po 2021-04-04 13:43:06.000000000 +0200 @@ -17,7 +17,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2021-03-02 02:36+0100\n" -"PO-Revision-Date: 2021-03-02 16:17\n" +"PO-Revision-Date: 2021-03-27 17:29\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.80.0/src/kiconengine.cpp new/kiconthemes-5.81.0/src/kiconengine.cpp --- old/kiconthemes-5.80.0/src/kiconengine.cpp 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/src/kiconengine.cpp 2021-04-04 13:43:06.000000000 +0200 @@ -47,10 +47,7 @@ QSize KIconEngine::actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) { - Q_UNUSED(state) - Q_UNUSED(mode) - const int iconSize = qMin(size.width(), size.height()); - return QSize(iconSize, iconSize); + return QIconEngine::actualSize(size, mode, state); } void KIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) @@ -85,21 +82,22 @@ const QSize scaledSize = size / scale; const int kstate = qIconModeToKIconState(mode); - const int iconSize = qMin(scaledSize.width(), scaledSize.height()); - QPixmap pix = mIconLoader.data()->loadScaledIcon(mIconName, KIconLoader::Desktop, scale, iconSize, kstate, mOverlays); + QPixmap pix = mIconLoader.data()->loadScaledIcon(mIconName, KIconLoader::Desktop, scale, scaledSize, kstate, mOverlays); if (pix.size() == size) { return pix; } QPixmap pix2(size); - auto dpr = pix.devicePixelRatio(); - pix2.setDevicePixelRatio(dpr); + pix2.setDevicePixelRatio(scale); pix2.fill(QColor(0, 0, 0, 0)); QPainter painter(&pix2); - const QPoint newTopLeft((pix2.width() - pix.width()) / (2 * dpr), (pix2.height() - pix.height()) / (2 * dpr)); - painter.drawPixmap(newTopLeft, pix); + painter.setRenderHint(QPainter::SmoothPixmapTransform); + const QSizeF targetSize = pix.size().scaled(scaledSize, Qt::KeepAspectRatio); + QRectF targetRect({0, 0}, targetSize); + targetRect.moveCenter(QRectF(pix2.rect()).center() / scale); + painter.drawPixmap(targetRect, pix, pix.rect()); return pix2; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/src/kiconengineplugin.json new/kiconthemes-5.81.0/src/kiconengineplugin.json --- old/kiconthemes-5.80.0/src/kiconengineplugin.json 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/src/kiconengineplugin.json 2021-04-04 13:43:06.000000000 +0200 @@ -1,4 +1,4 @@ { - "Keys": [ "KIconEngine", "svg", "svgz", "svg.gz" ] + "Keys": [ "KIconEngine" ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/src/kiconloader.cpp new/kiconthemes-5.81.0/src/kiconloader.cpp --- old/kiconthemes-5.80.0/src/kiconloader.cpp 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/src/kiconloader.cpp 2021-04-04 13:43:06.000000000 +0200 @@ -11,7 +11,6 @@ */ #include "kiconloader.h" -#include "kicontheme_p.h" // kdecore #include <KConfigGroup> @@ -93,19 +92,6 @@ } /** - * Checks for relative paths quickly on UNIX-alikes, slowly on everything else. - */ -static bool pathIsRelative(const QString &path) -{ -#ifdef Q_OS_UNIX - // catch both /xxx/yyy and :/xxx/yyy for resources - return (!path.isEmpty() && path[0] != QLatin1Char('/') && path[0] != QLatin1Char(':')); -#else - return QDir::isRelativePath(path); -#endif -} - -/** * Holds a QPixmap for this process, along with its associated path on disk. */ struct PixmapWithPath { @@ -238,7 +224,7 @@ /** * @internal */ - bool initIconThemes(); + void initIconThemes(); /** * @internal @@ -307,14 +293,14 @@ * and icon state information to valid states. All parameters except the * name can be modified as well to be valid. */ - void normalizeIconMetadata(KIconLoader::Group &group, int &size, int &state) const; + void normalizeIconMetadata(KIconLoader::Group &group, QSize &size, int &state) const; /** * @internal * Used with KIconLoader::loadIcon to get a base key name from the given * icon metadata. Ensure the metadata is normalized first. */ - QString makeCacheKey(const QString &name, KIconLoader::Group group, const QStringList &overlays, int size, qreal scale, int state) const; + QString makeCacheKey(const QString &name, KIconLoader::Group group, const QStringList &overlays, const QSize &size, qreal scale, int state) const; /** * @internal @@ -331,7 +317,7 @@ * @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, qreal scale = 1.0, KIconLoader::States state = KIconLoader::DefaultState); + QImage createIconImage(const QString &path, const QSize &size = {}, qreal scale = 1.0, KIconLoader::States state = KIconLoader::DefaultState); /** * @internal @@ -404,20 +390,6 @@ public: KIconLoaderGlobalData() { - // we trigger the rcc loading & fallback theme setting here instead of the old way via Q_COREAPP_STARTUP_FUNCTION - // so that loading the icon engine plugin doesn't trigger changing the icon theme while loading the first icon - // if nothing else initialized this before. - - // ensure we load rcc files for application bundles (+ setup their theme) - initRCCIconTheme(); - - // Set the icon theme fallback to breeze - // Most of our apps use "lots" of icons that most of the times - // are only available with breeze, we still honour the user icon - // theme but if the icon is not found there, we go to breeze - // since it's almost sure it'll be there - QIcon::setFallbackThemeName(QStringLiteral("breeze")); - const QStringList genericIconsFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("mime/generic-icons")); // qCDebug(KICONTHEMES) << genericIconsFiles; for (const QString &file : genericIconsFiles) { @@ -640,11 +612,10 @@ } } -bool KIconLoaderPrivate::initIconThemes() +void KIconLoaderPrivate::initIconThemes() { if (mIconThemeInited) { - // If mpThemeRoot isn't 0 then initing has succeeded - return (mpThemeRoot != nullptr); + return; } // qCDebug(KICONTHEMES); mIconThemeInited = true; @@ -657,9 +628,9 @@ qCDebug(KICONTHEMES) << "Couldn't find current icon theme, falling back to default."; def = new KIconTheme(KIconTheme::defaultThemeName(), appname); if (!def->isValid()) { - qWarning() << "Error: standard icon theme" << KIconTheme::defaultThemeName() << "not found!"; + qCDebug(KICONTHEMES) << "Standard icon theme" << KIconTheme::defaultThemeName() << "not found!"; delete def; - return false; + return; } } mpThemeRoot = new KIconThemeNode(def); @@ -674,8 +645,6 @@ searchPaths.append(QStringLiteral("icons")); // was xdgdata-icon in KStandardDirs // These are not in the icon spec, but e.g. GNOME puts some icons there anyway. searchPaths.append(QStringLiteral("pixmaps")); // was xdgdata-pixmaps in KStandardDirs - - return true; } KIconLoader::~KIconLoader() = default; @@ -832,15 +801,15 @@ return name; } -void KIconLoaderPrivate::normalizeIconMetadata(KIconLoader::Group &group, int &size, int &state) const +void KIconLoaderPrivate::normalizeIconMetadata(KIconLoader::Group &group, QSize &size, int &state) const { if ((state < 0) || (state >= KIconLoader::LastState)) { qWarning() << "Illegal icon state:" << state; state = KIconLoader::DefaultState; } - if (size < 0) { - size = 0; + if (size.width() < 0 || size.height() < 0) { + size = {}; } // For "User" icons, bail early since the size should be based on the size on disk, @@ -855,16 +824,16 @@ } // If size == 0, use default size for the specified group. - if (size == 0) { + if (size.isNull()) { if (group < 0) { qWarning() << "Neither size nor group specified!"; group = KIconLoader::Desktop; } - size = mpGroups[group].size; + size = QSize(mpGroups[group].size, mpGroups[group].size); } } -QString KIconLoaderPrivate::makeCacheKey(const QString &name, KIconLoader::Group group, const QStringList &overlays, int size, qreal scale, int state) const +QString KIconLoaderPrivate::makeCacheKey(const QString &name, KIconLoader::Group group, const QStringList &overlays, const QSize &size, qreal scale, int state) const { // The KSharedDataCache is shared so add some namespacing. The following code // uses QStringBuilder (new in Qt 4.6) @@ -873,7 +842,7 @@ return (group == KIconLoader::User ? QLatin1String("$kicou_") : QLatin1String("$kico_")) % name % QLatin1Char('_') - % QString::number(size) + % (size.width() == size.height() ? QString::number(size.height()) : QString::number(size.height()) % QLatin1Char('x') % QString::number(size.width())) % QLatin1Char('@') % QString::number(scale, 'f', 1) % QLatin1Char('_') @@ -939,13 +908,13 @@ return processedContents; } -QImage KIconLoaderPrivate::createIconImage(const QString &path, int size, qreal scale, KIconLoader::States state) +QImage KIconLoaderPrivate::createIconImage(const QString &path, const QSize &size, qreal scale, KIconLoader::States state) { // TODO: metadata in the theme to make it do this only if explicitly supported? QImageReader reader; QBuffer buffer; - if (q->theme()->followsColorScheme() && (path.endsWith(QLatin1String("svg")) || path.endsWith(QLatin1String("svgz")))) { + if (q->theme() && q->theme()->followsColorScheme() && (path.endsWith(QLatin1String("svg")) || path.endsWith(QLatin1String("svgz")))) { buffer.setData(processSvg(path, state)); reader.setDevice(&buffer); } else { @@ -956,8 +925,18 @@ return QImage(); } - if (size != 0) { - reader.setScaledSize(QSize(size * scale, size * scale)); + if (!size.isNull()) { + // ensure we keep aspect ratio + const QSize wantedSize = size * scale; + QSize finalSize(reader.size()); + if (finalSize.isNull()) { + // nothing to scale + finalSize = wantedSize; + } else { + // like QSvgIconEngine::pixmap try to keep aspect ratio + finalSize.scale(wantedSize, Qt::KeepAspectRatio); + } + reader.setScaledSize(finalSize); } return reader.read(); @@ -1200,15 +1179,14 @@ QString KIconLoader::iconPath(const QString &_name, int group_or_size, bool canReturnNull, qreal scale) const { - if (!d->initIconThemes()) { - return QString(); - } - - if (_name.isEmpty() || !pathIsRelative(_name)) { + // we need to honor resource :/ paths and QDir::searchPaths => use QDir::isAbsolutePath, see bug 434451 + if (_name.isEmpty() || QDir::isAbsolutePath(_name)) { // we have either an absolute path or nothing to work with return _name; } + d->initIconThemes(); + QString name = d->removeIconExtension(_name); QString path; @@ -1304,13 +1282,28 @@ QString *path_store, bool canReturnNull) const { + return loadScaledIcon(_name, group, scale, QSize(size, size), state, overlays, path_store, canReturnNull); +} + +QPixmap KIconLoader::loadScaledIcon(const QString &_name, + KIconLoader::Group group, + qreal scale, + const QSize &_size, + int state, + const QStringList &overlays, + QString *path_store, + bool canReturnNull) const + +{ QString name = _name; bool favIconOverlay = false; - if (size < 0 || _name.isEmpty()) { + if (_size.width() < 0 || _size.height() < 0 || _name.isEmpty()) { return QPixmap(); } + QSize size = _size; + /* * This method works in a kind of pipeline, with the following steps: * 1. Sanity checks. @@ -1327,7 +1320,8 @@ name = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1Char('/') + name + QStringLiteral(".png"); } - bool absolutePath = !pathIsRelative(name); + // we need to honor resource :/ paths and QDir::searchPaths => use QDir::isAbsolutePath, see bug 434451 + const bool absolutePath = QDir::isAbsolutePath(name); if (!absolutePath) { name = d->removeIconExtension(name); } @@ -1367,11 +1361,9 @@ } // Image is not cached... go find it and apply effects. - if (!d->initIconThemes()) { - return QPixmap(); - } + d->initIconThemes(); - favIconOverlay = favIconOverlay && size > 22; + favIconOverlay = favIconOverlay && std::min(size.height(), size.width()) > 22; // First we look for non-User icons. If we don't find one we'd search in // the User space anyways... @@ -1379,7 +1371,7 @@ if (absolutePath && !favIconOverlay) { path = name; } else { - path = d->findMatchingIconWithGenericFallbacks(favIconOverlay ? QStringLiteral("text-html") : name, size, scale); + path = d->findMatchingIconWithGenericFallbacks(favIconOverlay ? QStringLiteral("text-html") : name, std::min(size.height(), size.width()), scale); } } @@ -1391,7 +1383,7 @@ // Still can't find it? Use "unknown" if we can't return null. // We keep going in the function so we can ensure this result gets cached. if (path.isEmpty() && !canReturnNull) { - path = d->unknownIconPath(size, scale); + path = d->unknownIconPath(std::min(size.height(), size.width()), scale); iconWasUnknown = true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/src/kiconloader.h new/kiconthemes-5.81.0/src/kiconloader.h --- old/kiconthemes-5.80.0/src/kiconloader.h 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/src/kiconloader.h 2021-04-04 13:43:06.000000000 +0200 @@ -11,6 +11,7 @@ #define KICONLOADER_H #include <QObject> +#include <QSize> #include <QString> #include <QStringList> #include <memory> @@ -280,6 +281,49 @@ int state = KIconLoader::DefaultState, const QStringList &overlays = QStringList(), QString *path_store = nullptr, + bool canReturnNull = false) const; + + /** + * Loads an icon. It will try very hard to find an icon which is + * suitable. If no exact match is found, a close match is searched. + * If neither an exact nor a close match is found, a null pixmap or + * the "unknown" pixmap is returned, depending on the value of the + * @p canReturnNull parameter. + * + * @param name The name of the icon, without extension. + * @param group The icon group. This will specify the size of and effects to + * be applied to the icon. + * @param scale The scale of the icon group to use. If no icon exists in the + * scaled group, a 1x icon with its size multiplied by the scale will be + * loaded instead. + * @param size If nonzero, this overrides the size specified by @p group. + * See KIconLoader::StdSizes. The icon will be fit into @p size + * without changing the aspect ratio, which particularly matters + * for non-square icons. + * @param state The icon state: @p DefaultState, @p ActiveState or + * @p DisabledState. Depending on the user's preferences, the iconloader + * may apply a visual effect to hint about its state. + * @param overlays a list of emblem icons to overlay, by name + * @see drawOverlays + * @param path_store If not null, the path of the icon is stored here, + * if the icon was found. If the icon was not found @p path_store + * is unaltered even if the "unknown" pixmap was returned. + * @param canReturnNull Can return a null pixmap? If false, the + * "unknown" pixmap is returned when no appropriate icon has been + * found. <em>Note:</em> a null pixmap can still be returned in the + * event of invalid parameters, such as empty names, negative sizes, + * and etc. + * @return the QPixmap. Can be null when not found, depending on + * @p canReturnNull. + * @since 5.81 + */ + QPixmap loadScaledIcon(const QString &name, + KIconLoader::Group group, + qreal scale, + const QSize &size = {}, + int state = KIconLoader::DefaultState, + const QStringList &overlays = QStringList(), + QString *path_store = nullptr, bool canReturnNull = false) const; /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/src/kicontheme.cpp new/kiconthemes-5.81.0/src/kicontheme.cpp --- old/kiconthemes-5.80.0/src/kicontheme.cpp 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/src/kicontheme.cpp 2021-04-04 13:43:06.000000000 +0200 @@ -10,7 +10,6 @@ */ #include "kicontheme.h" -#include "kicontheme_p.h" #include "debug.h" @@ -33,6 +32,9 @@ Q_GLOBAL_STATIC(QString, _themeOverride) +// Support for icon themes in RCC files. +// The intended use case is standalone apps on Windows / MacOS / etc. +// For this reason we use AppDataLocation: BINDIR/data on Windows, Resources on OS X void initRCCIconTheme() { const QString iconThemeRcc = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("icontheme.rcc")); @@ -55,7 +57,19 @@ } } } +Q_COREAPP_STARTUP_FUNCTION(initRCCIconTheme) +// Set the icon theme fallback to breeze +// Most of our apps use "lots" of icons that most of the times +// are only available with breeze, we still honour the user icon +// theme but if the icon is not found there, we go to breeze +// since it's almost sure it'll be there +static void setBreezeFallback() +{ + QIcon::setFallbackThemeName(QStringLiteral("breeze")); +} + +Q_COREAPP_STARTUP_FUNCTION(setBreezeFallback) class KIconThemeDir; class KIconThemePrivate { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.80.0/src/kicontheme_p.h new/kiconthemes-5.81.0/src/kicontheme_p.h --- old/kiconthemes-5.80.0/src/kicontheme_p.h 2021-03-06 17:25:12.000000000 +0100 +++ new/kiconthemes-5.81.0/src/kicontheme_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -/* - This file is part of the KDE libraries - SPDX-FileCopyrightText: 2021 Christoph Cullmann <[email protected]> - - SPDX-License-Identifier: LGPL-2.0-or-later -*/ - -#ifndef KICONTHEME_P_H -#define KICONTHEME_P_H - -/** - * Support for icon themes in RCC files. - * The intended use case is standalone apps on Windows / MacOS / etc. - * For this reason we use AppDataLocation: BINDIR/data on Windows, Resources on OS X. - * Will be triggered by KIconLoaderGlobalData construction. - */ -void initRCCIconTheme(); - -#endif
