Hello community, here is the log from the commit of package kservice for openSUSE:Factory checked in at 2019-04-19 21:24:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kservice (Old) and /work/SRC/openSUSE:Factory/.kservice.new.5536 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kservice" Fri Apr 19 21:24:16 2019 rev:70 rq:695249 version:5.57.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kservice/kservice.changes 2019-03-21 09:48:14.558870690 +0100 +++ /work/SRC/openSUSE:Factory/.kservice.new.5536/kservice.changes 2019-04-19 21:24:17.791867529 +0200 @@ -1,0 +2,13 @@ +Sun Apr 14 20:21:44 UTC 2019 - [email protected] + +- Update to 5.57.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.57.0.php +- Changes since 5.56.0: + * Add X-GNOME-UsesNotifications as recognized key + * Add bison minimum version of 2.4.1 due to %code + * [kservice] Make it compile without foreach + * [kservice] compile without deprecated method + +------------------------------------------------------------------- Old: ---- kservice-5.56.0.tar.xz New: ---- kservice-5.57.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kservice.spec ++++++ --- /var/tmp/diff_new_pack.dAWX89/_old 2019-04-19 21:24:18.231868090 +0200 +++ /var/tmp/diff_new_pack.dAWX89/_new 2019-04-19 21:24:18.235868095 +0200 @@ -16,14 +16,14 @@ # -%define _tar_path 5.56 +%define _tar_path 5.57 # 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: kservice -Version: 5.56.0 +Version: 5.57.0 Release: 0 Summary: Plugin framework for desktop services License: LGPL-2.1-or-later ++++++ kservice-5.56.0.tar.xz -> kservice-5.57.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/.gitignore new/kservice-5.57.0/.gitignore --- old/kservice-5.56.0/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/kservice-5.57.0/.gitignore 2019-04-07 09:32:02.000000000 +0200 @@ -0,0 +1,21 @@ +# Ignore the following files +*~ +*.[oa] +*.diff +*.kate-swp +*.kdev4 +.kdev_include_paths +*.kdevelop.pcs +*.moc +*.moc.cpp +*.orig +*.user +.*.swp +.swp.* +Doxyfile +Makefile +avail +random_seed +/build*/ +CMakeLists.txt.user* +*.unc-backup* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/CMakeLists.txt new/kservice-5.57.0/CMakeLists.txt --- old/kservice-5.56.0/CMakeLists.txt 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/CMakeLists.txt 2019-04-07 09:32:02.000000000 +0200 @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.56.0") # handled by release scripts -set(KF5_DEP_VERSION "5.56.0") # handled by release scripts +set(KF5_VERSION "5.57.0") # handled by release scripts +set(KF5_DEP_VERSION "5.57.0") # handled by release scripts project(KService VERSION ${KF5_VERSION}) # Disallow in-source build @@ -12,7 +12,7 @@ # ECM setup include(FeatureSummary) -find_package(ECM 5.56.0 NO_MODULE) +find_package(ECM 5.57.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) @@ -63,7 +63,7 @@ PURPOSE "Required for the Trader parser" ) -find_package(BISON REQUIRED) +find_package(BISON 2.4.1 REQUIRED) set_package_properties(BISON PROPERTIES URL "http://www.gnu.org/software/bison" DESCRIPTION "general-purpose parser generator" @@ -72,7 +72,8 @@ ) add_definitions(-DTRANSLATION_DOMAIN=\"kservice5\") - +add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050c00) +add_definitions(-DQT_NO_FOREACH) if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ki18n_install(po) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/autotests/kmimeassociationstest.cpp new/kservice-5.57.0/autotests/kmimeassociationstest.cpp --- old/kservice-5.56.0/autotests/kmimeassociationstest.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/autotests/kmimeassociationstest.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -74,7 +74,7 @@ bool expected /* if set, show error if not found */) { bool found = false; - Q_FOREACH (const KService::Ptr &serv, offers) { + for (const KService::Ptr &serv : offers) { if (serv->entryPath() == entryPath) { if (found) { // should be there only once qWarning("ERROR: %s was found twice in the list", qPrintable(entryPath)); @@ -85,7 +85,7 @@ } if (!found && expected) { qWarning() << "ERROR:" << entryPath << "not found in offer list. Here's the full list:"; - Q_FOREACH (const KService::Ptr &serv, offers) { + for (const KService::Ptr &serv : offers) { qDebug() << serv->entryPath(); } } @@ -175,7 +175,7 @@ #if 0 const KService::List lst = KService::allServices(); QVERIFY(!lst.isEmpty()); - Q_FOREACH (const KService::Ptr &serv, lst) { + for (const KService::Ptr &serv : lst) { qDebug() << serv->entryPath() << serv->storageId() /*<< serv->desktopEntryName()*/; } #endif @@ -248,11 +248,11 @@ continue; } const QList<KServiceOffer> offers = offerHash.offersFor(mime); - Q_FOREACH (const QString &service, it.value()) { + for (const QString &service : it.value()) { KService::Ptr serv = KService::serviceByStorageId(service); if (serv && !offersContains(offers, serv)) { qDebug() << "expected offer" << serv->entryPath() << "not in offers for" << mime << ":"; - Q_FOREACH (const KServiceOffer &offer, offers) { + for (const KServiceOffer &offer : offers) { qDebug() << offer.service()->storageId(); } QFAIL("offer does not have servicetype"); @@ -264,7 +264,7 @@ end = removedApps.constEnd(); it != end; ++it) { const QString mime = it.key(); const QList<KServiceOffer> offers = offerHash.offersFor(mime); - Q_FOREACH (const QString &service, it.value()) { + for (const QString &service : it.value()) { KService::Ptr serv = KService::serviceByStorageId(service); if (serv && offersContains(offers, serv)) { //qDebug() << serv.data() << serv->entryPath() << "does not have" << mime; @@ -307,12 +307,12 @@ parser.parseMimeAppsList(fileName, 1050); // += 50 is correct. QList<KServiceOffer> offers = offerHash.offersFor(QStringLiteral("image/jpeg")); - qStableSort(offers); // like kbuildservicefactory.cpp does + std::stable_sort(offers.begin(), offers.end()); // like kbuildservicefactory.cpp does const QStringList expectedJpegApps = preferredApps[QStringLiteral("image/jpeg")]; QCOMPARE(assembleOffers(offers), expectedJpegApps); offers = offerHash.offersFor(QStringLiteral("text/html")); - qStableSort(offers); + std::stable_sort(offers.begin(), offers.end()); QStringList textHtmlApps = preferredApps[QStringLiteral("text/html")]; if (KService::serviceByStorageId(QStringLiteral("firefox.desktop"))) { textHtmlApps.append(QStringLiteral("firefox.desktop")); @@ -321,7 +321,7 @@ QCOMPARE(assembleOffers(offers), textHtmlApps); offers = offerHash.offersFor(QStringLiteral("image/png")); - qStableSort(offers); + std::stable_sort(offers.begin(), offers.end()); QCOMPARE(assembleOffers(offers), QStringList() << QStringLiteral("fakejpegapplication.desktop")); } @@ -479,7 +479,7 @@ static bool offersContains(const QList<KServiceOffer> &offers, KService::Ptr serv) { - Q_FOREACH (const KServiceOffer &offer, offers) { + for (const KServiceOffer &offer : offers) { if (offer.service()->storageId() == serv->storageId()) { return true; } @@ -489,7 +489,7 @@ static QStringList assembleOffers(const QList<KServiceOffer> &offers) { QStringList lst; - Q_FOREACH (const KServiceOffer &offer, offers) { + for (const KServiceOffer &offer : offers) { lst.append(offer.service()->storageId()); } return lst; @@ -497,7 +497,7 @@ static QStringList assembleServices(const QList<KService::Ptr> &services, int maxCount = -1) { QStringList lst; - Q_FOREACH (const KService::Ptr &service, services) { + for (const KService::Ptr &service : services) { lst.append(service->storageId()); if (maxCount > -1 && lst.count() == maxCount) { break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/autotests/kservicetest.cpp new/kservice-5.57.0/autotests/kservicetest.cpp --- old/kservice-5.56.0/autotests/kservicetest.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/autotests/kservicetest.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -248,13 +248,13 @@ { // If I want the konqueror unit tests to work, then I better not have a non-working part // as the preferred part for text/plain... - QStringList services; services << QStringLiteral("fakeservice.desktop") << QStringLiteral("fakepart.desktop") << QStringLiteral("faketextplugin.desktop") << QStringLiteral("fakeservice_querymustrebuild.desktop"); - Q_FOREACH (const QString &service, services) { + const QStringList services = QStringList() << QStringLiteral("fakeservice.desktop") << QStringLiteral("fakepart.desktop") << QStringLiteral("faketextplugin.desktop") << QStringLiteral("fakeservice_querymustrebuild.desktop"); + for (const QString &service : services) { const QString fakeService = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/") + service; QFile::remove(fakeService); } - QStringList serviceTypes; serviceTypes << QStringLiteral("fakeplugintype.desktop"); - Q_FOREACH (const QString &serviceType, serviceTypes) { + const QStringList serviceTypes = QStringList() << QStringLiteral("fakeplugintype.desktop"); + for (const QString &serviceType : serviceTypes) { const QString fakeServiceType = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservicetypes5/") + serviceType; //QFile::remove(fakeServiceType); } @@ -480,7 +480,7 @@ || !offerListHasService(offers, QStringLiteral("fakepart2.desktop")) || !offerListHasService(offers, QStringLiteral("otherpart.desktop")) || !offerListHasService(offers, QStringLiteral("preferredpart.desktop"))) { - foreach (KService::Ptr service, offers) { + for (KService::Ptr service : qAsConst(offers)) { qDebug("%s %s", qPrintable(service->name()), qPrintable(service->entryPath())); } } @@ -495,7 +495,7 @@ // Check ordering according to InitialPreference int lastPreference = -1; bool lastAllowedAsDefault = true; - Q_FOREACH (KService::Ptr service, offers) { + for (KService::Ptr service : qAsConst(offers)) { const QString path = service->entryPath(); const int preference = service->initialPreference(); // ## might be wrong if we use per-servicetype preferences... //qDebug( "%s has preference %d, allowAsDefault=%d", qPrintable( path ), preference, service->allowAsDefault() ); @@ -639,10 +639,10 @@ services.append(KService::serviceByDesktopPath(QStringLiteral("fakepart.desktop"))); disabledServices.append(KService::serviceByDesktopPath(QStringLiteral("fakepart2.desktop"))); - Q_FOREACH (const KService::Ptr &serv, services) { + for (const KService::Ptr &serv : qAsConst(services)) { QVERIFY(serv); } - Q_FOREACH (const KService::Ptr &serv, disabledServices) { + for (const KService::Ptr &serv : qAsConst(disabledServices)) { QVERIFY(serv); } @@ -727,7 +727,7 @@ true /* sort by generic name */); qDebug() << list.count(); - Q_FOREACH (KServiceGroup::SPtr s, list) { + for (KServiceGroup::SPtr s : list) { qDebug() << s->name() << s->entryPath(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/autotests/ksycoca_xdgdirstest.cpp new/kservice-5.57.0/autotests/ksycoca_xdgdirstest.cpp --- old/kservice-5.56.0/autotests/ksycoca_xdgdirstest.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/autotests/ksycoca_xdgdirstest.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -111,7 +111,7 @@ #if 0 // for debugging const KService::List lst = KService::allServices(); QVERIFY(!lst.isEmpty()); - Q_FOREACH (const KService::Ptr &serv, lst) { + for (const KService::Ptr &serv : lst) { qDebug() << serv->entryPath() << serv->storageId() /*<< serv->desktopEntryName()*/; } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/autotests/ksycocadicttest.cpp new/kservice-5.57.0/autotests/ksycocadicttest.cpp --- old/kservice-5.56.0/autotests/ksycocadicttest.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/autotests/ksycocadicttest.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -108,7 +108,7 @@ QByteArray buffer; { KSycocaDict dict; - foreach (const QString &str, serviceTypes) + for (const QString &str : qAsConst(serviceTypes)) { add(dict, str, str); } @@ -124,7 +124,7 @@ int offset = loadingDict.find_string(QStringLiteral("DictTestPluginType")); QVERIFY(offset > 0); QCOMPARE(offset, KServiceType::serviceType(QStringLiteral("DictTestPluginType"))->offset()); - foreach (const QString &str, serviceTypes) + for (const QString &str : qAsConst(serviceTypes)) { int offset = loadingDict.find_string(str); QVERIFY(offset > 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/autotests/ksycocathreadtest.cpp new/kservice-5.57.0/autotests/ksycocathreadtest.cpp --- old/kservice-5.56.0/autotests/ksycocathreadtest.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/autotests/ksycocathreadtest.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -303,7 +303,7 @@ QDateTime now; Q_FOREVER { now = QDateTime::currentDateTime(); - if (now.toTime_t() == ctime.toTime_t()) // truncate milliseconds + if (now.toSecsSinceEpoch() == ctime.toSecsSinceEpoch()) // truncate milliseconds { totalWait += 50; QTest::qWait(50); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/po/id/docs/desktoptojson/man-desktoptojson.8.docbook new/kservice-5.57.0/po/id/docs/desktoptojson/man-desktoptojson.8.docbook --- old/kservice-5.56.0/po/id/docs/desktoptojson/man-desktoptojson.8.docbook 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/po/id/docs/desktoptojson/man-desktoptojson.8.docbook 1970-01-01 01:00:00.000000000 +0100 @@ -1,233 +0,0 @@ -<?xml version="1.0" ?> -<!DOCTYPE refentry PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [ - <!ENTITY % English "INCLUDE" -><!-- change language only here --> -]> - -<refentry lang="&language;"> - -<refentryinfo> -<title ->&kde; Framework: KService</title> -<author -><firstname ->Scarlett</firstname -> <surname ->Clark</surname -> <contrib ->Menulis dokumen asli.</contrib> -<affiliation> -<address -><email ->[email protected]</email -></address> -</affiliation> -</author> -<author -><firstname ->Alex</firstname -> <surname ->Merry</surname -> <contrib ->Mengedit dokumentasi.</contrib> -<affiliation> -<address -><email ->[email protected]</email -></address> -</affiliation> -</author> - -<date ->02-04-2014</date> -<releaseinfo ->Frameworks 5.0</releaseinfo> -<productname ->KDE Frameworks</productname> - -</refentryinfo> - - -<refmeta> -<refentrytitle -><command ->desktoptojson</command -></refentrytitle> -<manvolnum ->8</manvolnum> -</refmeta> - -<refnamediv> -<refname -><command ->desktoptojson</command -></refname> -<refpurpose ->Mengkonversi sebuah file <filename class="extension" ->.desktop</filename -> ke sebuah file <filename class="extension" ->.json</filename ->.</refpurpose> -</refnamediv> - -<refsynopsisdiv> -<title ->Sinopsis</title> - -<cmdsynopsis -><command ->desktoptojson</command -> <arg choice="plain" ->--input <replaceable ->DESKTOP-FILE</replaceable -></arg -> <arg choice="plain" ->--output <replaceable ->JSON-FILE</replaceable -></arg -> </cmdsynopsis> -<cmdsynopsis -><command ->desktoptojson</command -> <group choice="req" -> <arg choice="plain" ->--version</arg -> <arg choice="plain" ->--help</arg -> </group -> </cmdsynopsis> - -</refsynopsisdiv> - - - - -<refsect1> -<title ->Deskripsi</title> - -<para ->Kerangka-kerja KService menggunakan informasi yang terisi di dalam file <filename class="extension" ->.desktop</filename -> untuk menempatkan layanan, termasuk plugin untuk pustaka lib dan aplikasi berbasis-Qt5. Sistem plugin Qt5, namun, menggunakan data JSON yang tertanam dalam plugin itu sendiri. <command ->desktoptojson</command -> memungkinkan informasi yang terisi dalam file <filename class="extension" ->.desktop</filename -> yang juga digunakan sebagai data tertanam untuk plugin Qt5 dengan mengkonversi seluruh file <filename class="extension" ->.desktop</filename -> ke dalam data JSON.</para> - -<para ->Data JSON yang dihasilkan adalah sebuah objek JSON yang memetakan keseluruhan dari grup <literal ->[Desktop Entry]</literal -> pada file <filename class="extension" ->.desktop</filename ->. Grup lain apa pun diabaikan. Banyak entri-entri yang hanya dikonversi ke string JSON, tapi entri tertentu (sepertihalnya <literal ->Hidden</literal -> dan <literal ->X-KDE-PluginInfo-EnabledByBaku</literal ->) telah diketahui menjadi nilai-nilai boolean dan dikonversi seperti itu, dan beberapa yang mirip (sepertihalnya <literal ->X-KDE-ServiceTypes</literal -> dan <literal ->X-KDE-PluginInfo-Depends</literal ->) yang selalu dikonversi untuk susunan string.</para> -</refsect1> - - - -<refsect1> -<title ->Opsi</title> -<variablelist> - -<varlistentry> - <term -><option ->--input <replaceable ->DESKTOP-FILE</replaceable -></option -></term> -<listitem> -<para ->File <filename class="extension" ->.desktop</filename -> untuk dikonversi.</para> -</listitem> -</varlistentry> - -<varlistentry> -<term -><option ->--output <replaceable ->JSON-FILE</replaceable -></option -></term> -<listitem> -<para ->File untuk penulisan yang dihasilkan data JSON ke.</para> -</listitem> -</varlistentry> - -<varlistentry> -<term -><option ->--help</option -></term> -<listitem> -<para ->Tampilkan sebuah teks bantuan yang singkat.</para> -</listitem> -</varlistentry> - -<varlistentry> -<term -><option ->--versi</option -></term> -<listitem> -<para ->Tampilkan informasi versi.</para> -</listitem> -</varlistentry> - -</variablelist> -</refsect1> - - - -<refsect1> -<title ->Penggunaan</title> -<para ->Beberapa penggunaan utilitas ini akan menggunakan macro CMake <function ->kservice_desktop_to_json</function -> sebagai bagian dari proses pembangunan sebuah plugin. <programlisting language="cmake"> -<![CDATA[ -add_library(myplugin MODULE ${myplugin_SRCS}) -kservice_desktop_to_json(myplugin myplugin.desktop) -]]> -</programlisting -> Ini akan menghasilkan file JSON <filename ->myplugin.json</filename ->, yang bisa direferensikan dari macros <function ->K_PLUGIN_FACTORY_WITH_JSON</function -> atau <function ->Q_PLUGIN_METADATA</function ->. </para> -</refsect1> - - - -<refsect1> -<title ->Bug</title> -<para ->Silakan gunakan <ulink url="http://bugs.kde.org" ->KDE's bugtracker</ulink -> untuk melaporkan bug.</para> -</refsect1> - -</refentry> - - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/po/id/kservice5.po new/kservice-5.57.0/po/id/kservice5.po --- old/kservice-5.56.0/po/id/kservice5.po 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/po/id/kservice5.po 2019-04-07 09:32:02.000000000 +0200 @@ -16,7 +16,7 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 2.0\n" #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/po/te/kservice5.po new/kservice-5.57.0/po/te/kservice5.po --- old/kservice-5.56.0/po/te/kservice5.po 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/po/te/kservice5.po 2019-04-07 09:32:02.000000000 +0200 @@ -22,8 +22,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.5\n" -"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : " -"4;\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" #, kde-format msgctxt "NAME OF TRANSLATORS" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/po/zh_CN/kservice5.po new/kservice-5.57.0/po/zh_CN/kservice5.po --- old/kservice-5.56.0/po/zh_CN/kservice5.po 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/po/zh_CN/kservice5.po 2019-04-07 09:32:02.000000000 +0200 @@ -16,7 +16,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2019-02-18 02:58+0100\n" -"PO-Revision-Date: 2019-02-20 23:16\n" +"PO-Revision-Date: 2019-03-07 09:22\n" "Last-Translator: guoyunhe <[email protected]>\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/kdeinit/ktoolinvocation_win.cpp new/kservice-5.57.0/src/kdeinit/ktoolinvocation_win.cpp --- old/kservice-5.56.0/src/kdeinit/ktoolinvocation_win.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/kdeinit/ktoolinvocation_win.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -61,7 +61,7 @@ query.addQueryItem(QStringLiteral("cc"), _cc); query.addQueryItem(QStringLiteral("bcc"), _bcc); query.addQueryItem(QStringLiteral("body"), body); - foreach (const QString &attachURL, attachURLs) { + for (const QString &attachURL : attachURLs) { query.addQueryItem(QStringLiteral("attach"), attachURL); } url.setQuery(query); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/kdeinit/ktoolinvocation_x11.cpp new/kservice-5.57.0/src/kdeinit/ktoolinvocation_x11.cpp --- old/kservice-5.56.0/src/kdeinit/ktoolinvocation_x11.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/kdeinit/ktoolinvocation_x11.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -231,7 +231,7 @@ const QString previousStr = cmdTokens.at(i-1); cmdTokens.removeAt(i); const int currentPos = i; - Q_FOREACH(const QString &url, attachURLs) { + for(const QString &url : attachURLs) { cmdTokens.insert(currentPos, previousStr); cmdTokens.insert(currentPos, url); i += 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/plugin/kplugintrader.h new/kservice-5.57.0/src/plugin/kplugintrader.h --- old/kservice-5.56.0/src/plugin/kplugintrader.h 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/plugin/kplugintrader.h 2019-04-07 09:32:02.000000000 +0200 @@ -230,7 +230,7 @@ } const KPluginInfo::List offers = self()->query(subDirectory, serviceType, constraint); - Q_FOREACH (const KPluginInfo &info, offers) { + for (const KPluginInfo &info : offers) { KPluginLoader loader(info.libraryPath()); const QVariantList argsWithMetaData = QVariantList() << loader.metaData().toVariantMap(); KPluginFactory *factory = loader.factory(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/services/application.desktop new/kservice-5.57.0/src/services/application.desktop --- old/kservice-5.56.0/src/services/application.desktop 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/services/application.desktop 2019-04-07 09:32:02.000000000 +0200 @@ -142,3 +142,5 @@ [PropertyDef::X-KDE-Protocols] Type=QStringList +[PropertyDef::X-GNOME-UsesNotifications] +Type=bool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/services/kmimetypetrader.h new/kservice-5.57.0/src/services/kmimetypetrader.h --- old/kservice-5.56.0/src/services/kmimetypetrader.h 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/services/kmimetypetrader.h 2019-04-07 09:32:02.000000000 +0200 @@ -130,7 +130,7 @@ QString *error = nullptr) { const KService::List offers = self()->query(mimeType, QStringLiteral("KParts/ReadOnlyPart"), constraint); - Q_FOREACH (const KService::Ptr &ptr, offers) { + for (const KService::Ptr &ptr : offers) { T *component = ptr->template createInstance<T>(parentWidget, parent, args, error); if (component) { if (error) { @@ -165,7 +165,7 @@ QString *error = nullptr) { const KService::List offers = self()->query(mimeType, serviceType, constraint); - Q_FOREACH (const KService::Ptr &ptr, offers) { + for (const KService::Ptr &ptr : offers) { T *component = ptr->template createInstance<T>(parent, args, error); if (component) { if (error) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/services/kplugininfo.cpp new/kservice-5.57.0/src/services/kplugininfo.cpp --- old/kservice-5.56.0/src/services/kplugininfo.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/services/kplugininfo.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -278,7 +278,7 @@ : d(new KPluginInfoPrivate) { const QString metaData = QStringLiteral("MetaData"); - foreach (const QVariant &v, args) { + for (const QVariant &v : args) { if (v.canConvert<QVariantMap>()) { const QVariantMap &m = v.toMap(); const QVariant &_metadata = m.value(metaData); @@ -315,7 +315,8 @@ KSycoca::self()->ensureCacheValid(); QJsonObject json; - foreach (const QString &key, service->propertyNames()) { + const auto propertyList = service->propertyNames(); + for (const QString &key : propertyList) { QVariant::Type t = KSycocaPrivate::self()->serviceTypeFactory()->findPropertyTypeByName(key); if (t == QVariant::Invalid) { t = QVariant::String; // default to string if the type is not known @@ -336,7 +337,7 @@ mimeTypes.reserve(services.size()); QStringList newServiceTypes; newServiceTypes.reserve(services.size()); - foreach (const QString& s, services) { + for (const QString& s : services) { if (db.mimeTypeForName(s).isValid()) { mimeTypes << s; } else { @@ -443,7 +444,7 @@ { QStringList files; const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, name + QStringLiteral("/kpartplugins"), QStandardPaths::LocateDirectory); - Q_FOREACH (const QString &dir, dirs) { + for (const QString &dir : dirs) { QDirIterator it(dir, QStringList() << QStringLiteral("*.desktop")); while (it.hasNext()) { files.append(it.next()); @@ -628,9 +629,9 @@ if (result.canConvert<QString>()) { result = KPluginInfoPrivate::deserializeList(result.toString()); } else if (result.canConvert<QVariantList>()) { - QVariantList list = result.toList(); + const QVariantList list = result.toList(); QStringList newResult; - foreach (const QVariant &value, list) { + for (const QVariant &value : list) { newResult += value.toString(); } result = newResult; @@ -749,7 +750,7 @@ { KPluginInfo::List ret; ret.reserve(list.size()); - foreach(const KPluginMetaData &md, list) { + for(const KPluginMetaData &md : list) { ret.append(KPluginInfo::fromMetaData(md)); } return ret; @@ -759,7 +760,7 @@ { QVector<KPluginMetaData> ret; ret.reserve(list.size()); - foreach(const KPluginInfo &info, list) { + for(const KPluginInfo &info : list) { ret.append(info.toMetaData()); } return ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/services/kservice.cpp new/kservice-5.57.0/src/services/kservice.cpp --- old/kservice-5.56.0/src/services/kservice.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/services/kservice.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -663,7 +663,7 @@ QMap<QString, QVariant>::ConstIterator it = d->m_mapProps.find(QStringLiteral("OnlyShowIn")); if ((it != d->m_mapProps.end()) && (it->isValid())) { const QStringList aList = it->toString().split(QLatin1Char(';')); - foreach (const QString &desktop, currentDesktops) { + for (const QString &desktop : qAsConst(currentDesktops)) { if (aList.contains(desktop)) { return true; } @@ -674,7 +674,7 @@ it = d->m_mapProps.find(QStringLiteral("NotShowIn")); if ((it != d->m_mapProps.end()) && (it->isValid())) { const QStringList aList = it->toString().split(QLatin1Char(';')); - foreach (const QString &desktop, currentDesktops) { + for (const QString &desktop : qAsConst(currentDesktops)) { if (aList.contains(desktop)) { return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/services/kservicegroup.cpp new/kservice-5.57.0/src/services/kservicegroup.cpp --- old/kservice-5.56.0/src/services/kservicegroup.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/services/kservicegroup.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -232,7 +232,7 @@ m_bAllowInline = (_allowInline != 0); if (m_bDeep) { - Q_FOREACH (const QString &path, groupList) { + for (const QString &path : qAsConst(groupList)) { if (path.endsWith(QLatin1Char('/'))) { KServiceGroup::Ptr serviceGroup; serviceGroup = KSycocaPrivate::self()->serviceGroupFactory()->findGroupByDesktopPath(path, false); @@ -261,7 +261,7 @@ KSycocaEntryPrivate::save(s); QStringList groupList; - Q_FOREACH (KSycocaEntry::Ptr p, m_serviceList) { + for (const KSycocaEntry::Ptr &p : qAsConst(m_serviceList)) { if (p->isType(KST_KService)) { KService::Ptr service(static_cast<KService*>(p.data())); groupList.append(service->entryPath()); @@ -291,8 +291,8 @@ Q_D(KServiceGroup); bool sort = options & SortEntries || options & AllowSeparators; QList<KServiceGroup::Ptr> list; - List tmp = d->entries(this, sort, options & ExcludeNoDisplay, options & AllowSeparators, options & SortByGenericName); - foreach (const SPtr &ptr, tmp) { + const List tmp = d->entries(this, sort, options & ExcludeNoDisplay, options & AllowSeparators, options & SortByGenericName); + for (const SPtr &ptr : tmp) { if (ptr->isType(KST_KServiceGroup)) { KServiceGroup::Ptr serviceGroup(static_cast<KServiceGroup*>(ptr.data())); list.append(serviceGroup); @@ -310,9 +310,9 @@ Q_D(KServiceGroup); bool sort = options & SortEntries || options & AllowSeparators; QList<KService::Ptr> list; - List tmp = d->entries(this, sort, options & ExcludeNoDisplay, options & AllowSeparators, options & SortByGenericName); + const List tmp = d->entries(this, sort, options & ExcludeNoDisplay, options & AllowSeparators, options & SortByGenericName); bool foundService = false; - foreach (const SPtr &ptr, tmp) { + for (const SPtr &ptr : tmp) { if (ptr->isType(KST_KService)) { list.append(KService::Ptr(static_cast<KService*>(ptr.data()))); foundService = true; @@ -383,7 +383,8 @@ typedef QMap<QByteArray, KServiceGroup::SPtr> SortedContainer; SortedContainer slist; SortedContainer glist; - Q_FOREACH (KSycocaEntry::Ptr p, group->d_func()->m_serviceList) { + const auto listService = group->d_func()->m_serviceList; + for (const KSycocaEntry::Ptr &p : listService) { bool noDisplay = p->isType(KST_KServiceGroup) ? static_cast<KServiceGroup *>(p.data())->noDisplay() : static_cast<KService *>(p.data())->noDisplay(); @@ -439,7 +440,7 @@ // Iterate through the sort spec list. // If an entry gets mentioned explicitly, we remove it from the sorted list - Q_FOREACH (const QString &item, sortOrder) { + for (const QString &item : qAsConst(sortOrder)) { if (item.isEmpty()) { continue; } @@ -575,7 +576,7 @@ bool bShowInlineHeader = false; bool bShowInlineAlias = false; int inlineValue = -1; - Q_FOREACH (const QString &opt_attr, optionAttribute) { + for (const QString &opt_attr : qAsConst(optionAttribute)) { parseAttribute(opt_attr, bShowEmptyMenu, bShowInline, bShowInlineHeader, bShowInlineAlias, inlineValue); group->setShowEmptyMenu(bShowEmptyMenu); group->setAllowInline(bShowInline); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/services/kservicetypeprofile.cpp new/kservice-5.57.0/src/services/kservicetypeprofile.cpp --- old/kservice-5.56.0/src/services/kservicetypeprofile.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/services/kservicetypeprofile.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -160,7 +160,7 @@ } } - qStableSort(offers); + std::stable_sort(offers.begin(), offers.end()); //qDebug() << "KServiceTypeProfile::offers returning " << offers.count() << " offers"; return offers; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/services/kservicetypetrader.h new/kservice-5.57.0/src/services/kservicetypetrader.h --- old/kservice-5.56.0/src/services/kservicetypetrader.h 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/services/kservicetypetrader.h 2019-04-07 09:32:02.000000000 +0200 @@ -187,7 +187,7 @@ if (error) { error->clear(); } - Q_FOREACH (const KService::Ptr &ptr, offers) { + for (const KService::Ptr &ptr : offers) { T *component = ptr->template createInstance<T>(parentWidget, parent, args, error); if (component) { return component; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/services/ktraderparsetree.cpp new/kservice-5.57.0/src/services/ktraderparsetree.cpp --- old/kservice-5.56.0/src/services/ktraderparsetree.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/services/ktraderparsetree.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -507,7 +507,7 @@ if (c1.type == ParseContext::T_STRING && c2.type == ParseContext::T_STR_SEQ) { if (false && m_substring) { _context->b = false; - foreach (const QString &string, c2.strSeq) { + for (const QString &string : qAsConst(c2.strSeq)) { if (string.contains(c1.str, m_cs)) { _context->b = true; break; @@ -727,7 +727,7 @@ } } - foreach (const QVariant &p, offerValues) { + for (const QVariant &p : qAsConst(offerValues)) { if (p.isValid()) { // Determine new maximum/minimum if (extrema.type == PreferencesMaxima::PM_INVALID_INT) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/sycoca/kbuildservicefactory.cpp new/kservice-5.57.0/src/sycoca/kbuildservicefactory.cpp --- old/kservice-5.56.0/src/sycoca/kbuildservicefactory.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/sycoca/kbuildservicefactory.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -159,7 +159,8 @@ // We need to process parents before children, hence the recursive call in // collectInheritedServices(mime) and the QSet to process a given parent only once. QSet<QString> visitedMimes; - Q_FOREACH (const QString &mimeType, m_mimeTypeFactory->allMimeTypes()) { + const auto lst = m_mimeTypeFactory->allMimeTypes(); + for (const QString &mimeType : lst) { collectInheritedServices(mimeType, visitedMimes); } } @@ -177,8 +178,9 @@ int mimeTypeInheritanceLevel = 0; QMimeDatabase db; - QMimeType qmime = db.mimeTypeForName(mimeTypeName); - Q_FOREACH (QString parentMimeType, qmime.parentMimeTypes()) { + const QMimeType qmime = db.mimeTypeForName(mimeTypeName); + const auto lst = qmime.parentMimeTypes(); + for (QString parentMimeType : lst) { // Workaround issue in shared-mime-info and/or Qt, which sometimes return an alias as parent parentMimeType = db.mimeTypeForName(parentMimeType).name(); @@ -299,7 +301,8 @@ } } else { bool shouldAdd = true; - foreach (const QString &otherType, service->serviceTypes()) { + const auto lst = service->serviceTypes(); + for (const QString &otherType : lst) { // Skip derived types if the base class is listed (#321706) if (stName != otherType && mime.inherits(otherType)) { // But don't skip aliases (they got resolved into mime->name() already, but don't let two aliases cancel out) @@ -374,7 +377,7 @@ const QString stName = it.key(); const ServiceTypeOffersData offersData = it.value(); QList<KServiceOffer> offers = offersData.offers; - qStableSort(offers); // by initial preference + std::stable_sort(offers.begin(), offers.end()); // by initial preference int offset = -1; KServiceType::Ptr serviceType = m_serviceTypeFactory->findServiceTypeByName(stName); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/sycoca/kbuildsycoca.cpp new/kservice-5.57.0/src/sycoca/kbuildsycoca.cpp --- old/kservice-5.56.0/src/sycoca/kbuildsycoca.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/sycoca/kbuildsycoca.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -148,10 +148,11 @@ entryDictList.reserve(factories()->size()); int i = 0; // For each factory - Q_FOREACH (KSycocaFactory* factory, *factories()) { + auto list = *factories(); + for (KSycocaFactory* factory : qAsConst(list)) { KBSEntryDict *entryDict = new KBSEntryDict; if (m_allEntries) { // incremental build - Q_FOREACH (const KSycocaEntry::Ptr &entry, (*m_allEntries)[i++]) { + for (const KSycocaEntry::Ptr &entry : qAsConst((*m_allEntries)[i++])) { //if (entry->entryPath().contains("fake")) // qCDebug(SYCOCA) << "inserting into entryDict:" << entry->entryPath() << entry; entryDict->insert(entry->entryPath(), entry); @@ -167,7 +168,8 @@ // Save the mtime of each dir, just before we list them // ## should we convert to UTC to avoid surprises when summer time kicks in? - Q_FOREACH (const QString &dir, factoryResourceDirs()) { + const auto lstDirs = factoryResourceDirs(); + for (const QString &dir : lstDirs) { qint64 stamp = 0; KSycocaUtilsPrivate::visitResourceDirectory(dir, [&stamp] (const QFileInfo &info) { stamp = qMax(stamp, info.lastModified().toMSecsSinceEpoch()); @@ -178,13 +180,14 @@ QMap<QString, QByteArray> allResourcesSubDirs; // dirs, kstandarddirs-resource-name // For each factory - Q_FOREACH (KSycocaFactory* factory, *factories()) { + list = *factories(); + for (KSycocaFactory* factory : qAsConst(list)) { // For each resource the factory deals with const KSycocaResourceList *list = factory->resourceList(); if (!list) { continue; } - Q_FOREACH (const KSycocaResource &res, *list) { + for (const KSycocaResource &res : qAsConst(*list)) { // With this we would get dirs, but not a unique list of relative files (for global+local merging to work) //const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, res.subdir, QStandardPaths::LocateDirectory); //allResourcesSubDirs[res.resource] += dirs; @@ -203,7 +206,7 @@ QSet<QString> relFiles; const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, m_resourceSubdir, QStandardPaths::LocateDirectory); qCDebug(SYCOCA) << "Looking for subdir" << m_resourceSubdir << "=>" << dirs; - Q_FOREACH (const QString &dir, dirs) { + for (const QString &dir : dirs) { QDirIterator it(dir, QDirIterator::Subdirectories); while (it.hasNext()) { const QString filePath = it.next(); @@ -228,7 +231,7 @@ continue; } - Q_FOREACH (const KSycocaResource &res, *list) { + for (const KSycocaResource &res : qAsConst(*list)) { if (res.resource != (*it1)) { continue; } @@ -272,7 +275,8 @@ // Storing the mtime *after* looking at these dirs is a tiny race condition, // but I'm not sure how to get the vfolder dirs upfront... - Q_FOREACH (QString dir, m_vfolder->allDirectories()) { + const auto allDirectories = m_vfolder->allDirectories(); + for (QString dir : allDirectories) { if (dir.endsWith(QLatin1Char('/'))) { dir.chop(1); // remove trailing slash, to avoid having ~/.local/share/applications twice } @@ -313,7 +317,7 @@ { QString caption = caption_; QString name = name_; - foreach (VFolderMenu::SubMenu *subMenu, menu->subMenus) { + for (VFolderMenu::SubMenu *subMenu : qAsConst(menu->subMenus)) { QString subName = name + subMenu->name + QLatin1Char('/'); QString directoryFile = subMenu->directoryFile; @@ -355,7 +359,7 @@ if (name.isEmpty()) { name += QLatin1Char('/'); } - foreach (const KService::Ptr &p, menu->items) { + for (const KService::Ptr &p : qAsConst(menu->items)) { if (m_menuTest) { if (!menu->isDeleted && !p->noDisplay()) printf("%s\t%s\t%s\n", qPrintable(caption), qPrintable(p->menuId()), @@ -513,7 +517,8 @@ //KSycocaFactory * servicetypeFactory = 0; //KBuildMimeTypeFactory * mimeTypeFactory = 0; KBuildServiceFactory *serviceFactory = nullptr; - Q_FOREACH (KSycocaFactory* factory, *factories()) { + auto lst = *factories(); + for (KSycocaFactory* factory : qAsConst(lst)) { qint32 aId; qint32 aOffset; aId = factory->factoryId(); @@ -547,7 +552,8 @@ qCDebug(SYCOCA) << "Saving"; // Write factory data.... - Q_FOREACH (KSycocaFactory* factory, *factories()) { + lst = *factories(); + for (KSycocaFactory* factory : qAsConst(lst)) { factory->save(*str); if (str->status() != QDataStream::Ok) { // ######## TODO: does this detect write errors, e.g. disk full? return; // error @@ -560,7 +566,8 @@ str->device()->seek(0); (*str) << qint32(KSycoca::version()); - Q_FOREACH (KSycocaFactory* factory, *factories()) { + lst = *factories(); + for (KSycocaFactory* factory : qAsConst(lst)) { qint32 aId; qint32 aOffset; aId = factory->factoryId(); @@ -615,7 +622,7 @@ if (fi.isReadable() && fi.isFile()) { // This was using buff.st_ctime (in Waldo's initial commit to kstandarddirs.cpp in 2001), but that looks wrong? // Surely we want to catch manual editing, while a chmod doesn't matter much? - hash += fi.lastModified().toTime_t(); + hash += fi.lastModified().toSecsSinceEpoch(); } return hash; } @@ -627,7 +634,7 @@ return updateHash(filename, hash); } const QStringList files = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, resourceSubDir + QLatin1Char('/') + filename); - Q_FOREACH (const QString &file, files) { + for (const QString &file : files) { hash = updateHash(file, hash); } if (hash == 0 && !filename.endsWith(QLatin1String("update_ksycoca")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/sycoca/kmimeassociations.cpp new/kservice-5.57.0/src/sycoca/kmimeassociations.cpp --- old/kservice-5.56.0/src/sycoca/kmimeassociations.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/sycoca/kmimeassociations.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -54,7 +54,8 @@ QStringList mimeappsFileNames; // make the list of possible filenames from the spec ($desktop-mimeapps.list, then mimeapps.list) const QString desktops = QString::fromLocal8Bit(qgetenv("XDG_CURRENT_DESKTOP")); - foreach (const QString &desktop, desktops.split(QLatin1Char(':'), QString::SkipEmptyParts)) { + const auto list = desktops.split(QLatin1Char(':'), QString::SkipEmptyParts); + for (const QString &desktop : list) { mimeappsFileNames.append(desktop.toLower() + QLatin1String("-mimeapps.list")); } mimeappsFileNames.append(QStringLiteral("mimeapps.list")); @@ -63,8 +64,8 @@ + QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation); QStringList mimeappsFiles; // collect existing files - foreach (const QString &dir, mimeappsDirs) { - foreach (const QString &file, mimeappsFileNames) { + for (const QString &dir : mimeappsDirs) { + for (const QString &file : qAsConst(mimeappsFileNames)) { const QString filePath = dir + QLatin1Char('/') + file; if (QFile::exists(filePath)) { mimeappsFiles.append(filePath); @@ -105,14 +106,15 @@ { Q_UNUSED(file) // except in debug statements QMimeDatabase db; - Q_FOREACH (const QString &mimeName, group.keyList()) { + const auto keyList = group.keyList(); + for (const QString &mimeName : keyList) { const QStringList services = group.readXdgListEntry(mimeName); const QString resolvedMimeName = mimeName.startsWith(QLatin1String("x-scheme-handler/")) ? mimeName : db.mimeTypeForName(mimeName).name(); if (resolvedMimeName.isEmpty()) { qCDebug(SYCOCA) << file << "specifies unknown mimeType" << mimeName << "in" << group.name(); } else { int pref = basePreference; - Q_FOREACH (const QString &service, services) { + for (const QString &service : services) { KService::Ptr pService = m_serviceFactory->findServiceByStorageId(service); if (!pService) { qCDebug(SYCOCA) << file << "specifies unknown service" << service << "in" << group.name(); @@ -129,9 +131,10 @@ void KMimeAssociations::parseRemovedAssociations(const KConfigGroup &group, const QString &file) { Q_UNUSED(file) // except in debug statements - Q_FOREACH (const QString &mime, group.keyList()) { + const auto keyList = group.keyList(); + for (const QString &mime : keyList) { const QStringList services = group.readXdgListEntry(mime); - Q_FOREACH (const QString &service, services) { + for (const QString &service : services) { KService::Ptr pService = m_serviceFactory->findServiceByStorageId(service); if (!pService) { //qDebug() << file << "specifies unknown service" << service << "in" << group.name(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/sycoca/ksycocadict.cpp new/kservice-5.57.0/src/sycoca/ksycocadict.cpp --- old/kservice-5.56.0/src/sycoca/ksycocadict.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/sycoca/ksycocadict.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -514,7 +514,7 @@ /*qCDebug(SYCOCA) << QString("Duplicate lists: Offset = %1 list_size = %2") .arg(hashTable[i].duplicate_offset,8,16).arg(dups->count()); */ - Q_FOREACH (string_entry* dup, *dups) { + for (string_entry* dup : qAsConst(*dups)) { const qint32 offset = dup->payload->offset(); if (!offset) { const QString storageId = dup->payload->storageId(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/sycoca/ksycocafactory.cpp new/kservice-5.57.0/src/sycoca/ksycocafactory.cpp --- old/kservice-5.56.0/src/sycoca/ksycocafactory.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/sycoca/ksycocafactory.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -112,7 +112,7 @@ // Write all entries. int entryCount = 0; - Q_FOREACH(KSycocaEntry::Ptr entry, *m_entryDict) { + for(KSycocaEntry::Ptr entry : qAsConst(*m_entryDict)) { entry->d_ptr->save(str); entryCount++; } @@ -122,7 +122,7 @@ // Write indices... // Linear index str << qint32(entryCount); - Q_FOREACH(KSycocaEntry::Ptr entry, *m_entryDict) { + for(KSycocaEntry::Ptr entry : qAsConst(*m_entryDict)) { str << qint32(entry.data()->offset()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/sycoca/ksycocautils_p.h new/kservice-5.57.0/src/sycoca/ksycocautils_p.h --- old/kservice-5.56.0/src/sycoca/ksycocautils_p.h 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/sycoca/ksycocautils_p.h 2019-04-07 09:32:02.000000000 +0200 @@ -37,7 +37,7 @@ { QDir dir(dirname); const QFileInfoList list = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs, QDir::Unsorted); - foreach (const QFileInfo &fi, list) { + for (const QFileInfo &fi : list) { if (fi.isDir() && !fi.isSymLink() && !fi.isBundle()) { // same check as in vfolder_menu.cpp if (!visitor(fi)) { return false; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/src/sycoca/vfolder_menu.cpp new/kservice-5.57.0/src/sycoca/vfolder_menu.cpp --- old/kservice-5.56.0/src/sycoca/vfolder_menu.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/src/sycoca/vfolder_menu.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -114,7 +114,7 @@ void VFolderMenu::includeItems(QHash<QString, KService::Ptr> &items1, const QHash<QString, KService::Ptr> &items2) { - foreach (const KService::Ptr &p, items2) { + for (const KService::Ptr &p : items2) { items1.insert(p->menuId(), p); } } @@ -122,7 +122,8 @@ void VFolderMenu::matchItems(QHash<QString, KService::Ptr> &items1, const QHash<QString, KService::Ptr> &items2) { - foreach (const KService::Ptr &p, items1) { + const QHash<QString, KService::Ptr> tmpItems1 = items1; + for (const KService::Ptr &p : tmpItems1) { QString id = p->menuId(); if (!items2.contains(id)) { items1.remove(id); @@ -133,7 +134,7 @@ void VFolderMenu::excludeItems(QHash<QString, KService::Ptr> &items1, const QHash<QString, KService::Ptr> &items2) { - foreach (const KService::Ptr &p, items2) { + for (const KService::Ptr &p : items2) { items1.remove(p->menuId()); } } @@ -226,7 +227,7 @@ const QString s2 = menuName.mid(i + 1); // Look up menu - foreach (SubMenu *menu, parentMenu->subMenus) { + for (SubMenu *menu : qAsConst(parentMenu->subMenus)) { if (menu->name == s1) { if (i == -1) { mergeMenu(menu, newMenu, reversePriority); @@ -264,7 +265,7 @@ QString s2 = name.mid(i + 1); // Look up menu - foreach (SubMenu *menu, parentMenu->subMenus) { + for (SubMenu *menu : qAsConst(parentMenu->subMenus)) { if (menu->name == s1) { insertService(menu, s2, newService); return; @@ -296,7 +297,7 @@ } #define FOR_ALL_APPLICATIONS(it) \ - foreach (AppsInfo *info, m_appsInfoStack) \ + for (AppsInfo *info : qAsConst(m_appsInfoStack)) \ { \ QHashIterator<QString,KService::Ptr> it = info->applications; \ while (it.hasNext()) \ @@ -305,7 +306,7 @@ #define FOR_ALL_APPLICATIONS_END } } #define FOR_CATEGORY(category, it) \ - foreach (AppsInfo *info, m_appsInfoStack) \ + for (AppsInfo *info : qAsConst(m_appsInfoStack)) \ { \ const KService::List list = info->dictCategories.value(category); \ for(KService::List::ConstIterator it = list.constBegin(); \ @@ -316,7 +317,7 @@ KService::Ptr VFolderMenu::findApplication(const QString &relPath) { - foreach (AppsInfo *info, m_appsInfoStack) { + for (AppsInfo *info : qAsConst(m_appsInfoStack)) { if (info->applications.contains(relPath)) { KService::Ptr s = info->applications[relPath]; if (s) { @@ -338,7 +339,7 @@ void VFolderMenu::buildApplicationIndex(bool unusedOnly) { - foreach (AppsInfo *info, m_appsInfoList) { + for (AppsInfo *info : qAsConst(m_appsInfoList)) { info->dictCategories.clear(); QMutableHashIterator<QString, KService::Ptr> it = info->applications; while (it.hasNext()) { @@ -349,7 +350,8 @@ continue; } - Q_FOREACH (const QString &cat, s->categories()) { + const auto categories = s->categories(); + for (const QString &cat : categories) { info->dictCategories[cat].append(s); // find or insert entry in hash } } @@ -605,14 +607,14 @@ const bool relative = QDir::isRelativePath(dir); const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericConfigLocation, QStringLiteral("menus/") + dir, QStandardPaths::LocateDirectory); - Q_FOREACH (const QString &menuDir, dirs) { + for (const QString &menuDir : dirs) { registerDirectory(menuDir); } QStringList fileList; - Q_FOREACH (const QString &menuDir, dirs) { + for (const QString &menuDir : dirs) { const QStringList fileNames = QDir(menuDir).entryList(QStringList() << QStringLiteral("*.menu")); - Q_FOREACH (const QString &file, fileNames) { + for (const QString &file : fileNames) { const QString fileToAdd = relative ? dir + file : menuDir + file; if (!fileList.contains(fileToAdd)) { fileList.append(fileToAdd); @@ -620,7 +622,7 @@ } } - Q_FOREACH (const QString &file, fileList) { + for (const QString &file : qAsConst(fileList)) { pushDocInfo(file); mergeFile(docElem, n); popDocInfo(); @@ -651,7 +653,8 @@ static QString makeRelative(const QString &dir) { const QString canonical = QDir(dir).canonicalPath(); - Q_FOREACH (const QString &base, QStandardPaths::locateAll(QStandardPaths::GenericConfigLocation, QStringLiteral("menus"), QStandardPaths::LocateDirectory)) { + const auto list = QStandardPaths::locateAll(QStandardPaths::GenericConfigLocation, QStringLiteral("menus"), QStandardPaths::LocateDirectory); + for (const QString &base : list) { if (canonical.startsWith(base)) { return canonical.mid(base.length() + 1); } @@ -1044,7 +1047,7 @@ m_currentMenu = nullptr; // Look up menu if (parentMenu) { - foreach (SubMenu *menu, parentMenu->subMenus) { + for (SubMenu *menu : qAsConst(parentMenu->subMenus)) { if (menu->name == name) { m_currentMenu = menu; break; @@ -1079,7 +1082,7 @@ } else { // Look up menu if (parentMenu) { - foreach (SubMenu *menu, parentMenu->subMenus) { + for (SubMenu *menu : qAsConst(parentMenu->subMenus)) { if (menu->name == name) { m_currentMenu = menu; break; @@ -1366,7 +1369,7 @@ } } - foreach (VFolderMenu::SubMenu *subMenu, menu->subMenus) { + for (VFolderMenu::SubMenu *subMenu : qAsConst(menu->subMenus)) { layoutMenu(subMenu, defaultLayout); } } @@ -1374,7 +1377,7 @@ void VFolderMenu::markUsedApplications(const QHash<QString, KService::Ptr> &items) { - foreach (const KService::Ptr &p, items) { + for (const KService::Ptr &p : items) { m_usedAppsDict.insert(p->menuId()); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/tests/kmimeassociations_dumper.cpp new/kservice-5.57.0/tests/kmimeassociations_dumper.cpp --- old/kservice-5.56.0/tests/kmimeassociations_dumper.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/tests/kmimeassociations_dumper.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -55,7 +55,8 @@ mimeAppsParser.parseAllMimeAppsList(); QTextStream output(stdout); - foreach (const KServiceOffer &offer, offers.offersFor(mime)) { + const auto list = offers.offersFor(mime); + for (const KServiceOffer &offer : list) { output << offer.service()->desktopEntryName() << " " << offer.service()->entryPath() << "\n"; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.56.0/tests/pluginlocator/plugintest.cpp new/kservice-5.57.0/tests/pluginlocator/plugintest.cpp --- old/kservice-5.56.0/tests/pluginlocator/plugintest.cpp 2019-03-02 14:47:31.000000000 +0100 +++ new/kservice-5.57.0/tests/pluginlocator/plugintest.cpp 2019-04-07 09:32:02.000000000 +0200 @@ -106,7 +106,7 @@ int unitDiv = 1000; QString unit = QStringLiteral("microsec"); int i = 0; - foreach (qint64 t, timings) { + for (qint64 t : timings) { int msec = t / 1000000; qDebug() << " Run " << i << ": " << msec << " msec"; totalTime += t; @@ -146,10 +146,10 @@ bool ok = false; QString pluginName("time"); QString constraint = QStringLiteral("[X-KDE-PluginInfo-Name] == '%1'").arg(pluginName); - KPluginInfo::List res = KPluginTrader::self()->query(QStringLiteral("kf5"), serviceType, QString()); + const KPluginInfo::List res = KPluginTrader::self()->query(QStringLiteral("kf5"), serviceType, QString()); qDebug() << "----------- Found " << res.count() << " Plugins" << constraint; ok = res.count() > 0; - foreach (const KPluginInfo &info, res) { + for (const KPluginInfo &info : res) { qDebug() << " file: " << info.libraryPath(); } @@ -180,10 +180,10 @@ << QStringLiteral("5000"); QStringList datadirs; - foreach (const QString &_s, sizes) { + for (const QString &_s : sizes) { datadirs << pluginDir + _s; } - foreach (const QString &subdir, datadirs) { + for (const QString &subdir : qAsConst(datadirs)) { const QString pluginName; const QString constraint; const QString serviceType;
