Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kservice for openSUSE:Factory checked in at 2022-12-12 17:38:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kservice (Old) and /work/SRC/openSUSE:Factory/.kservice.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kservice" Mon Dec 12 17:38:45 2022 rev:114 rq:1042151 version:5.101.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kservice/kservice.changes 2022-11-15 13:19:58.492351446 +0100 +++ /work/SRC/openSUSE:Factory/.kservice.new.1835/kservice.changes 2022-12-12 17:40:39.341469401 +0100 @@ -1,0 +2,11 @@ +Tue Dec 6 20:10:58 UTC 2022 - Christophe Marin <christo...@krop.fr> + +- Update to 5.101.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.101.0 +- Changes since 5.100.0: + * KApplicationTrader: New method setPreferredService + * Perform initialization in initialization list + +------------------------------------------------------------------- Old: ---- kservice-5.100.0.tar.xz kservice-5.100.0.tar.xz.sig New: ---- kservice-5.101.0.tar.xz kservice-5.101.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kservice.spec ++++++ --- /var/tmp/diff_new_pack.RFZmyS/_old 2022-12-12 17:40:39.829471863 +0100 +++ /var/tmp/diff_new_pack.RFZmyS/_new 2022-12-12 17:40:39.833471883 +0100 @@ -16,18 +16,17 @@ # -%define _tar_path 5.100 +%define _tar_path 5.101 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} %bcond_without released Name: kservice -Version: 5.100.0 +Version: 5.101.0 Release: 0 Summary: Plugin framework for desktop services License: LGPL-2.1-or-later -Group: System/GUI/KDE URL: https://www.kde.org Source: %{name}-%{version}.tar.xz %if %{with released} @@ -62,7 +61,6 @@ %package devel Summary: Plugin framework for desktop services: Build Environment -Group: Development/Libraries/KDE Requires: %{name} = %{version} Requires: extra-cmake-modules Requires: cmake(KF5Config) >= %{_kf5_bugfix_version} ++++++ kservice-5.100.0.tar.xz -> kservice-5.101.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.100.0/CMakeLists.txt new/kservice-5.101.0/CMakeLists.txt --- old/kservice-5.100.0/CMakeLists.txt 2022-11-05 13:31:35.000000000 +0100 +++ new/kservice-5.101.0/CMakeLists.txt 2022-12-03 10:51:18.000000000 +0100 @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) -set(KF_VERSION "5.100.0") # handled by release scripts -set(KF_DEP_VERSION "5.100.0") # handled by release scripts +set(KF_VERSION "5.101.0") # handled by release scripts +set(KF_DEP_VERSION "5.101.0") # handled by release scripts project(KService VERSION ${KF_VERSION}) # Disallow in-source build @@ -11,7 +11,7 @@ # ECM setup include(FeatureSummary) -find_package(ECM 5.100.0 NO_MODULE) +find_package(ECM 5.101.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) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.100.0/autotests/kapplicationtradertest.cpp new/kservice-5.101.0/autotests/kapplicationtradertest.cpp --- old/kservice-5.100.0/autotests/kapplicationtradertest.cpp 2022-11-05 13:31:35.000000000 +0100 +++ new/kservice-5.101.0/autotests/kapplicationtradertest.cpp 2022-12-03 10:51:18.000000000 +0100 @@ -50,6 +50,7 @@ void testQueryByMimeType(); void testThreads(); void testTraderQueryMustRebuildSycoca(); + void testSetPreferredService(); void cleanupTestCase(); private: @@ -344,4 +345,14 @@ QCOMPARE(offers.count(), 1); } +void KApplicationTraderTest::testSetPreferredService() +{ + const KService::Ptr oldPref = KApplicationTrader::preferredService(QLatin1String("text/plain")); + const KService::Ptr newPref = KService::serviceByDesktopPath(m_fakeApplication); + KApplicationTrader::setPreferredService(QLatin1String("text/plain"), newPref); + QCOMPARE(KApplicationTrader::preferredService(QLatin1String("text/plain"))->entryPath(), m_fakeApplication); + KApplicationTrader::setPreferredService(QLatin1String("text/plain"), oldPref); + QCOMPARE(KApplicationTrader::preferredService(QLatin1String("text/plain"))->storageId(), oldPref->storageId()); +} + #include "kapplicationtradertest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.100.0/autotests/ksycocathreadtest.cpp new/kservice-5.101.0/autotests/ksycocathreadtest.cpp --- old/kservice-5.100.0/autotests/ksycocathreadtest.cpp 2022-11-05 13:31:35.000000000 +0100 +++ new/kservice-5.101.0/autotests/ksycocathreadtest.cpp 2022-12-03 10:51:18.000000000 +0100 @@ -147,8 +147,8 @@ public: WorkerThread() : QThread() + , m_stop(false) { - m_stop = false; } void run() override { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.100.0/po/nb/kservice5.po new/kservice-5.101.0/po/nb/kservice5.po --- old/kservice-5.100.0/po/nb/kservice5.po 2022-11-05 13:31:35.000000000 +0100 +++ new/kservice-5.101.0/po/nb/kservice5.po 2022-12-03 10:51:18.000000000 +0100 @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: kdelibs4\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" -"POT-Creation-Date: 2022-06-22 00:41+0000\n" +"POT-Creation-Date: 2022-11-02 00:44+0000\n" "PO-Revision-Date: 2014-11-05 13:40+0100\n" "Last-Translator: Bjørn Steensrud <bjor...@skogkatt.homelinux.org>\n" "Language-Team: Norwegian BokmÃ¥l <l10n...@lister.huftis.org>\n" @@ -202,12 +202,12 @@ msgid "No service implementing %1" msgstr "Ingen tjeneste som implementerer %1" -#: services/kservice.cpp:1076 +#: services/kservice.cpp:1082 #, kde-format msgid "The provided service is not valid" msgstr "Den oppgitte tjenesten er ikke gyldig" -#: services/kservice.cpp:1080 +#: services/kservice.cpp:1086 #, kde-format msgid "The service '%1' provides no library or the Library key is missing" msgstr "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.100.0/po/se/kservice5.po new/kservice-5.101.0/po/se/kservice5.po --- old/kservice-5.100.0/po/se/kservice5.po 2022-11-05 13:31:35.000000000 +0100 +++ new/kservice-5.101.0/po/se/kservice5.po 2022-12-03 10:51:18.000000000 +0100 @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: kdelibs4\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" -"POT-Creation-Date: 2022-06-22 00:41+0000\n" +"POT-Creation-Date: 2022-11-02 00:44+0000\n" "PO-Revision-Date: 2012-05-30 23:19+0200\n" "Last-Translator: Børre Gaup <boe...@skolelinux.no>\n" "Language-Team: Northern Sami <l10n...@lister.huftis.org>\n" @@ -196,12 +196,12 @@ msgid "No service implementing %1" msgstr "Ii gávdno bálvalus %1 várás" -#: services/kservice.cpp:1076 +#: services/kservice.cpp:1082 #, kde-format msgid "The provided service is not valid" msgstr "Addon bálvalus ii gusto" -#: services/kservice.cpp:1080 +#: services/kservice.cpp:1086 #, kde-format msgid "The service '%1' provides no library or the Library key is missing" msgstr "«%1»-bálvalusas ii leat bibliotehka dahje «Library»-Äoavdda ii gávdno " diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.100.0/po/zh_CN/kservice5.po new/kservice-5.101.0/po/zh_CN/kservice5.po --- old/kservice-5.100.0/po/zh_CN/kservice5.po 2022-11-05 13:31:35.000000000 +0100 +++ new/kservice-5.101.0/po/zh_CN/kservice5.po 2022-12-03 10:51:18.000000000 +0100 @@ -3,7 +3,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2022-11-02 00:44+0000\n" -"PO-Revision-Date: 2022-10-30 07:48\n" +"PO-Revision-Date: 2022-12-01 06:52\n" "Last-Translator: \n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.100.0/src/services/kapplicationtrader.cpp new/kservice-5.101.0/src/services/kapplicationtrader.cpp --- old/kservice-5.100.0/src/services/kapplicationtrader.cpp 2022-11-05 13:31:35.000000000 +0100 +++ new/kservice-5.101.0/src/services/kapplicationtrader.cpp 2022-12-03 10:51:18.000000000 +0100 @@ -17,6 +17,9 @@ #include <QMimeDatabase> +#include <KConfigGroup> +#include <KSharedConfig> + static KService::List mimeTypeSycocaServiceOffers(const QString &mimeType) { KService::List lst; @@ -112,6 +115,31 @@ return KService::Ptr(); } +void KApplicationTrader::setPreferredService(const QString &mimeType, const KService::Ptr service) +{ + if (mimeType.isEmpty() || !(service && service->isValid())) { + return; + } + KSharedConfig::Ptr profile = KSharedConfig::openConfig(QStringLiteral("mimeapps.list"), KConfig::NoGlobals, QStandardPaths::GenericConfigLocation); + + // Save the default application according to mime-apps-spec 1.0 + KConfigGroup defaultApp(profile, "Default Applications"); + defaultApp.writeXdgListEntry(mimeType, QStringList(service->storageId())); + + KConfigGroup addedApps(profile, "Added Associations"); + QStringList apps = addedApps.readXdgListEntry(mimeType); + apps.removeAll(service->storageId()); + apps.prepend(service->storageId()); // make it the preferred app + addedApps.writeXdgListEntry(mimeType, apps); + + profile->sync(); + + // Also make sure the "auto embed" setting for this MIME type is off + KSharedConfig::Ptr fileTypesConfig = KSharedConfig::openConfig(QStringLiteral("filetypesrc"), KConfig::NoGlobals); + fileTypesConfig->group("EmbedSettings").writeEntry(QStringLiteral("embed-") + mimeType, false); + fileTypesConfig->sync(); +} + bool KApplicationTrader::isSubsequence(const QString &pattern, const QString &text, Qt::CaseSensitivity cs) { if (pattern.isEmpty()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.100.0/src/services/kapplicationtrader.h new/kservice-5.101.0/src/services/kapplicationtrader.h --- old/kservice-5.100.0/src/services/kapplicationtrader.h 2022-11-05 13:31:35.000000000 +0100 +++ new/kservice-5.101.0/src/services/kapplicationtrader.h 2022-12-03 10:51:18.000000000 +0100 @@ -76,6 +76,17 @@ KSERVICE_EXPORT KService::Ptr preferredService(const QString &mimeType); /** + * Changes the preferred service for @p mimeType to @p service + * + * You may need to rebuild KSyCoca for the change to be reflected + * + * @param mimeType the MIME type + * @param service the service to set as the preferred one + * @since 5.101 + */ +KSERVICE_EXPORT void setPreferredService(const QString &mimeType, const KService::Ptr service); + +/** * Returns true if @p pattern matches a subsequence of the string @p text. * For instance the pattern "libremath" matches the text "LibreOffice Math", assuming * @p cs is Qt::CaseInsensitive. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.100.0/src/services/ktraderparsetree_p.h new/kservice-5.101.0/src/services/ktraderparsetree_p.h --- old/kservice-5.100.0/src/services/ktraderparsetree_p.h 2022-11-05 13:31:35.000000000 +0100 +++ new/kservice-5.101.0/src/services/ktraderparsetree_p.h 2022-12-03 10:51:18.000000000 +0100 @@ -146,9 +146,9 @@ { public: ParseTreeOR(ParseTreeBase *_ptr1, ParseTreeBase *_ptr2) + : m_pLeft(_ptr1) + , m_pRight(_ptr2) { - m_pLeft = _ptr1; - m_pRight = _ptr2; } bool eval(ParseContext *_context) const override; @@ -165,9 +165,9 @@ { public: ParseTreeAND(ParseTreeBase *_ptr1, ParseTreeBase *_ptr2) + : m_pLeft(_ptr1) + , m_pRight(_ptr2) { - m_pLeft = _ptr1; - m_pRight = _ptr2; } bool eval(ParseContext *_context) const override; @@ -184,10 +184,10 @@ { public: ParseTreeCMP(ParseTreeBase *_ptr1, ParseTreeBase *_ptr2, int _i) + : m_pLeft(_ptr1) + , m_pRight(_ptr2) + , m_cmd(_i) { - m_pLeft = _ptr1; - m_pRight = _ptr2; - m_cmd = _i; } bool eval(ParseContext *_context) const override; @@ -228,10 +228,10 @@ { public: ParseTreeMATCH(ParseTreeBase *_ptr1, ParseTreeBase *_ptr2, Qt::CaseSensitivity cs) + : m_pLeft(_ptr1) + , m_pRight(_ptr2) + , m_cs(cs) { - m_pLeft = _ptr1; - m_pRight = _ptr2; - m_cs = cs; } bool eval(ParseContext *_context) const override; @@ -261,10 +261,10 @@ { public: ParseTreeSubsequenceMATCH(ParseTreeBase *_ptr1, ParseTreeBase *_ptr2, Qt::CaseSensitivity cs) + : m_pLeft(_ptr1) + , m_pRight(_ptr2) + , m_cs(cs) { - m_pLeft = _ptr1; - m_pRight = _ptr2; - m_cs = cs; } bool eval(ParseContext *_context) const override; @@ -282,10 +282,10 @@ { public: ParseTreeCALC(ParseTreeBase *_ptr1, ParseTreeBase *_ptr2, int _i) + : m_pLeft(_ptr1) + , m_pRight(_ptr2) + , m_cmd(_i) { - m_pLeft = _ptr1; - m_pRight = _ptr2; - m_cmd = _i; } bool eval(ParseContext *_context) const override; @@ -303,8 +303,8 @@ { public: explicit ParseTreeBRACKETS(ParseTreeBase *_ptr) + : m_pLeft(_ptr) { - m_pLeft = _ptr; } bool eval(ParseContext *_context) const override; @@ -320,8 +320,8 @@ { public: explicit ParseTreeNOT(ParseTreeBase *_ptr) + : m_pLeft(_ptr) { - m_pLeft = _ptr; } bool eval(ParseContext *_context) const override; @@ -337,8 +337,8 @@ { public: explicit ParseTreeEXIST(const char *_id) + : m_id(QString::fromUtf8(_id)) { - m_id = QString::fromUtf8(_id); } bool eval(ParseContext *_context) const override; @@ -354,8 +354,8 @@ { public: explicit ParseTreeID(const char *arg) + : m_str(QString::fromUtf8(arg)) { - m_str = QString::fromUtf8(arg); } bool eval(ParseContext *_context) const override; @@ -371,8 +371,8 @@ { public: explicit ParseTreeSTRING(const char *arg) + : m_str(QString::fromUtf8(arg)) { - m_str = QString::fromUtf8(arg); } bool eval(ParseContext *_context) const override; @@ -439,8 +439,8 @@ { public: explicit ParseTreeMAX2(const char *_id) + : m_strId(QString::fromUtf8(_id)) { - m_strId = QString::fromUtf8(_id); } bool eval(ParseContext *_context) const override; @@ -456,8 +456,8 @@ { public: explicit ParseTreeMIN2(const char *_id) + : m_strId(QString::fromUtf8(_id)) { - m_strId = QString::fromUtf8(_id); } bool eval(ParseContext *_context) const override;