Hello community, here is the log from the commit of package kiconthemes for openSUSE:Factory checked in at 2015-09-24 07:11:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2015-09-02 07:46:14.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kiconthemes.new/kiconthemes.changes 2015-09-24 07:11:59.000000000 +0200 @@ -1,0 +2,10 @@ +Tue Sep 8 17:13:11 UTC 2015 - hrvoje.senjan@gmail.com + +- Update to 5.14.0 + * KIconLoader: fix reconfigure() forgetting about inherited + themes and app dirs + * Adhere better to the icon loading spec + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.14.0.php + +------------------------------------------------------------------- Old: ---- kiconthemes-5.13.0.tar.xz New: ---- kiconthemes-5.14.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kiconthemes.spec ++++++ --- /var/tmp/diff_new_pack.iRZueD/_old 2015-09-24 07:12:00.000000000 +0200 +++ /var/tmp/diff_new_pack.iRZueD/_new 2015-09-24 07:12:00.000000000 +0200 @@ -18,9 +18,9 @@ %bcond_without lang %define lname libKF5IconThemes5 -%define _tar_path 5.13 +%define _tar_path 5.14 Name: kiconthemes -Version: 5.13.0 +Version: 5.14.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 ++++++ kiconthemes-5.13.0.tar.xz -> kiconthemes-5.14.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.13.0/CMakeLists.txt new/kiconthemes-5.14.0/CMakeLists.txt --- old/kiconthemes-5.13.0/CMakeLists.txt 2015-08-04 13:01:18.000000000 +0200 +++ new/kiconthemes-5.14.0/CMakeLists.txt 2015-09-05 11:03:04.000000000 +0200 @@ -4,7 +4,7 @@ # ECM setup include(FeatureSummary) -find_package(ECM 5.13.0 NO_MODULE) +find_package(ECM 5.14.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) @@ -19,8 +19,8 @@ include(ECMGenerateHeaders) include(ECMMarkNonGuiExecutable) -set(KF5_VERSION "5.13.0") # handled by release scripts -set(KF5_DEP_VERSION "5.13.0") # handled by release scripts +set(KF5_VERSION "5.14.0") # handled by release scripts +set(KF5_DEP_VERSION "5.14.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KICONTHEMES diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.13.0/autotests/breeze.theme new/kiconthemes-5.14.0/autotests/breeze.theme --- old/kiconthemes-5.13.0/autotests/breeze.theme 2015-08-04 13:01:18.000000000 +0200 +++ new/kiconthemes-5.14.0/autotests/breeze.theme 2015-09-05 11:03:04.000000000 +0200 @@ -2,8 +2,8 @@ Name=Breeze Comment=Breeze icon theme Hidden=false -Directories=22x22/actions,22x22/animations,22x22/apps,22x22/mimetypes -Inherits=Oxygen +Directories=22x22/actions,22x22/animations,22x22/apps,22x22/mimetypes,22x22/appsNoContext,22x22/appsNoType,22x22/appsNoContextOrType +Inherits=oxygen [22x22/actions] Size=22 @@ -24,3 +24,14 @@ Size=22 Context=MimeTypes Type=Threshold + +[22x22/appsNoContext] +Size=22 +Type=Threshold + +[22x22/appsNoType] +Size=22 +Context=MimeTypes + +[22x22/appsNoContextOrType] +Size=22 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.13.0/autotests/kiconloader_unittest.cpp new/kiconthemes-5.14.0/autotests/kiconloader_unittest.cpp --- old/kiconthemes-5.13.0/autotests/kiconloader_unittest.cpp 2015-08-04 13:01:18.000000000 +0200 +++ new/kiconthemes-5.14.0/autotests/kiconloader_unittest.cpp 2015-09-05 11:03:04.000000000 +0200 @@ -72,6 +72,7 @@ QVERIFY(testIconsDir.mkpath(QStringLiteral("oxygen/22x22/animations"))); QVERIFY(testIconsDir.mkpath(QStringLiteral("oxygen/22x22/apps"))); QVERIFY(testIconsDir.mkpath(QStringLiteral("oxygen/22x22/mimetypes"))); + QVERIFY(testIconsDir.mkpath(QStringLiteral("oxygen/32x32/apps"))); QVERIFY(QFile::copy(QStringLiteral(":/oxygen.theme"), testIconsDir.filePath(QStringLiteral("oxygen/index.theme")))); QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("oxygen/22x22/apps/kde.png")))); QVERIFY(QFile::copy(QStringLiteral(":/anim-22x22.png"), testIconsDir.filePath(QStringLiteral("oxygen/22x22/animations/process-working.png")))); @@ -82,15 +83,22 @@ QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("oxygen/22x22/mimetypes/x-office-document.png")))); QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("oxygen/22x22/mimetypes/audio-x-generic.png")))); QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("oxygen/22x22/mimetypes/unknown.png")))); + QVERIFY(QFile::copy(QStringLiteral(":/test-32x32.png"), testIconsDir.filePath(QStringLiteral("oxygen/32x32/apps/kde.png")))); - // set up a minimal Breeze icon theme, fallback to breeze + // set up a minimal Breeze icon theme, fallback to oxygen QVERIFY(testIconsDir.mkpath(QStringLiteral("breeze/22x22/actions"))); QVERIFY(testIconsDir.mkpath(QStringLiteral("breeze/22x22/animations"))); QVERIFY(testIconsDir.mkpath(QStringLiteral("breeze/22x22/apps"))); QVERIFY(testIconsDir.mkpath(QStringLiteral("breeze/22x22/mimetypes"))); + QVERIFY(testIconsDir.mkpath(QStringLiteral("breeze/22x22/appsNoContext"))); + QVERIFY(testIconsDir.mkpath(QStringLiteral("breeze/22x22/appsNoType"))); + QVERIFY(testIconsDir.mkpath(QStringLiteral("breeze/22x22/appsNoContextOrType"))); QVERIFY(QFile::copy(QStringLiteral(":/breeze.theme"), testIconsDir.filePath(QStringLiteral("breeze/index.theme")))); //kde.png is missing, it should fallback to oxygen //QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("breeze/22x22/apps/kde.png")))); + QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("breeze/22x22/appsNoContext/iconindirectorywithoutcontext.png")))); + QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("breeze/22x22/appsNoType/iconindirectorywithouttype.png")))); + QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("breeze/22x22/appsNoContextOrType/iconindirectorywithoutcontextortype.png")))); QVERIFY(QFile::copy(QStringLiteral(":/anim-22x22.png"), testIconsDir.filePath(QStringLiteral("breeze/22x22/animations/process-working.png")))); QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("breeze/22x22/mimetypes/text-plain.png")))); QVERIFY(QFile::copy(QStringLiteral(":/test-22x22.png"), testIconsDir.filePath(QStringLiteral("breeze/22x22/mimetypes/application-octet-stream.png")))); @@ -114,8 +122,7 @@ QFile::remove(cacheFile); // Clear SHM cache - KIconLoader iconLoader; - iconLoader.newIconLoader(); + KIconLoader::global()->reconfigure(QString()); } void testUnknownIconNotCached() @@ -276,25 +283,68 @@ QCOMPARE(path2, path); } + void testHasIcon() + { + // Do everything twice to check code paths that might use a cache + QVERIFY(KIconLoader::global()->hasIcon("kde")); + QVERIFY(KIconLoader::global()->hasIcon("kde")); + KIconLoader iconLoader; + QVERIFY(iconLoader.hasIcon("kde")); + + QVERIFY(KIconLoader::global()->hasIcon("process-working")); + QVERIFY(KIconLoader::global()->hasIcon("process-working")); + QVERIFY(!KIconLoader::global()->hasIcon("no-such-icon-exists")); + QVERIFY(!KIconLoader::global()->hasIcon("no-such-icon-exists")); + } + + void testIconPath() + { + // Test iconPath with non-existing icon + const QString path = KIconLoader::global()->iconPath("nope-no-such-icon", KIconLoader::Desktop, true /*canReturnNull*/); + QVERIFY2(path.isEmpty(), qPrintable(path)); + + const QString unknownPath = KIconLoader::global()->iconPath("nope-no-such-icon", KIconLoader::Desktop, false); + QVERIFY(!unknownPath.isEmpty()); + QVERIFY(QFile::exists(unknownPath)); + } + void testPathStore() { QString path; - KIconLoader::global()->loadIcon("kde", KIconLoader::Desktop, 24, + QPixmap pix = KIconLoader::global()->loadIcon("kde", KIconLoader::Desktop, 0, + KIconLoader::DefaultState, QStringList(), + &path); + QVERIFY(!path.isEmpty()); + QVERIFY(QFile::exists(path)); + QVERIFY2(path.contains("32x32"), qPrintable(path)); + QCOMPARE(pix.size(), QSize(32, 32)); + + // Compare with iconPath() + QString path2 = KIconLoader::global()->iconPath("kde", KIconLoader::Desktop); + QCOMPARE(path2, path); + + // Now specify a size + pix = KIconLoader::global()->loadIcon("kde", KIconLoader::Desktop, 24, KIconLoader::DefaultState, QStringList(), &path); QVERIFY(!path.isEmpty()); + QVERIFY(QFile::exists(path)); + QVERIFY2(path.contains("22x22"), qPrintable(path)); + QCOMPARE(pix.size(), QSize(24, 24)); + + QVERIFY(KIconLoader::global()->hasIcon("kde")); path = QString(); KIconLoader::global()->loadIcon("does_not_exist", KIconLoader::Desktop, 24, KIconLoader::DefaultState, QStringList(), &path, true /* canReturnNull */); - QVERIFY(path.isEmpty()); + QVERIFY2(path.isEmpty(), qPrintable(path)); path = "some filler to check loadIcon() clears the variable"; KIconLoader::global()->loadIcon("does_not_exist", KIconLoader::Desktop, 24, KIconLoader::DefaultState, QStringList(), &path, true /* canReturnNull */); - QVERIFY(path.isEmpty()); + QVERIFY2(path.isEmpty(), qPrintable(path)); //Test that addAppDir doesn't break loading of icons from the old known paths KIconLoader loader; @@ -333,7 +383,6 @@ loader3.loadIcon("kde", KIconLoader::Desktop, 24, KIconLoader::DefaultState, QStringList(), &path); - QEXPECT_FAIL("", "The combination addAppDir and reconfigure is not working right now.", Continue); QVERIFY(!path.isEmpty()); path = QString(); @@ -343,6 +392,30 @@ QVERIFY(!path.isEmpty()); } + void testPathsNoContextType() { + { + QString path; + KIconLoader::global()->loadIcon("iconindirectorywithoutcontext", KIconLoader::Desktop, 24, + KIconLoader::DefaultState, QStringList(), + &path); + QVERIFY(path.endsWith("appsNoContext/iconindirectorywithoutcontext.png")); + } + { + QString path; + KIconLoader::global()->loadIcon("iconindirectorywithouttype", KIconLoader::Desktop, 24, + KIconLoader::DefaultState, QStringList(), + &path); + QVERIFY(path.endsWith("appsNoType/iconindirectorywithouttype.png")); + } + { + QString path; + KIconLoader::global()->loadIcon("iconindirectorywithoutcontextortype", KIconLoader::Desktop, 24, + KIconLoader::DefaultState, QStringList(), + &path); + QVERIFY(path.endsWith("appsNoContextOrType/iconindirectorywithoutcontextortype.png")); + } + } + void testLoadIconNoGroupOrSize() // #246016 { QPixmap pix = KIconLoader::global()->loadIcon("connected", KIconLoader::NoGroup); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.13.0/autotests/oxygen.theme new/kiconthemes-5.14.0/autotests/oxygen.theme --- old/kiconthemes-5.13.0/autotests/oxygen.theme 2015-08-04 13:01:18.000000000 +0200 +++ new/kiconthemes-5.14.0/autotests/oxygen.theme 2015-09-05 11:03:04.000000000 +0200 @@ -2,7 +2,7 @@ Name=Oxygen Comment=Oxygen icon theme Hidden=false -Directories=22x22/actions,22x22/animations,22x22/apps,22x22/mimetypes +Directories=22x22/actions,22x22/animations,22x22/apps,22x22/mimetypes,32x32/apps [22x22/actions] Size=22 @@ -23,3 +23,8 @@ Size=22 Context=MimeTypes Type=Threshold + +[32x32/apps] +Size=32 +Context=Applications +Type=Threshold diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.13.0/autotests/resources.qrc new/kiconthemes-5.14.0/autotests/resources.qrc --- old/kiconthemes-5.13.0/autotests/resources.qrc 2015-08-04 13:01:18.000000000 +0200 +++ new/kiconthemes-5.14.0/autotests/resources.qrc 2015-09-05 11:03:04.000000000 +0200 @@ -1,6 +1,7 @@ <!DOCTYPE RCC><RCC version="1.0"> <qresource> <file>test-22x22.png</file> + <file>test-32x32.png</file> <file>app-image.png</file> <file>anim-22x22.png</file> <file>oxygen.theme</file> Files old/kiconthemes-5.13.0/autotests/test-32x32.png and new/kiconthemes-5.14.0/autotests/test-32x32.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.13.0/src/kiconloader.cpp new/kiconthemes-5.14.0/src/kiconloader.cpp --- old/kiconthemes-5.13.0/src/kiconloader.cpp 2015-08-04 13:01:18.000000000 +0200 +++ new/kiconthemes-5.14.0/src/kiconloader.cpp 2015-09-05 11:03:04.000000000 +0200 @@ -161,6 +161,8 @@ appname.clear(); searchPaths.clear(); links.clear(); + mIconThemeInited = false; + mThemesInTree.clear(); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.13.0/src/kiconloader.h new/kiconthemes-5.14.0/src/kiconloader.h --- old/kiconthemes-5.13.0/src/kiconloader.h 2015-08-04 13:01:18.000000000 +0200 +++ new/kiconthemes-5.14.0/src/kiconloader.h 2015-09-05 11:03:04.000000000 +0200 @@ -420,11 +420,12 @@ KIconEffect *iconEffect() const; /** - * Called by newIconLoader to reconfigure the icon loader. - * @param _appname the new application name + * Reconfigure the icon loader, for instance to change the associated app name or extra search paths. + * This also clears the in-memory pixmap cache (even if the appname didn't change, which is useful for unittests) + * @param appname the application name (empty for the global iconloader) * @param extraSearchPaths additional search paths, either absolute or relative to GenericDataLocation */ - void reconfigure(const QString &_appname, const QStringList &extraSearchPaths = QStringList()); + void reconfigure(const QString &appname, const QStringList &extraSearchPaths = QStringList()); /** * Returns the unknown icon. An icon that is used when no other icon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiconthemes-5.13.0/src/kicontheme.cpp new/kiconthemes-5.14.0/src/kicontheme.cpp --- old/kiconthemes-5.13.0/src/kicontheme.cpp 2015-08-04 13:01:18.000000000 +0200 +++ new/kiconthemes-5.14.0/src/kicontheme.cpp 2015-09-05 11:03:04.000000000 +0200 @@ -639,11 +639,13 @@ mContext = KIconLoader::StatusIcon; } else if (tmp == QLatin1String("Stock")) { // invalid, but often present context, skip warning return; + } else if (tmp.isEmpty()) { + // do nothing. key not required } else { qWarning() << "Invalid Context=" << tmp << "line for icon theme: " << dir(); return; } - tmp = config.readEntry(QStringLiteral("Type")); + tmp = config.readEntry(QStringLiteral("Type"), QStringLiteral("Threshold")); if (tmp == QLatin1String("Fixed")) { mType = KIconLoader::Fixed; } else if (tmp == QLatin1String("Scalable")) {