Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package krunner for openSUSE:Factory checked in at 2022-06-17 21:19:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/krunner (Old) and /work/SRC/openSUSE:Factory/.krunner.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "krunner" Fri Jun 17 21:19:29 2022 rev:101 rq:982291 version:5.95.0 Changes: -------- --- /work/SRC/openSUSE:Factory/krunner/krunner.changes 2022-05-16 18:09:12.437311100 +0200 +++ /work/SRC/openSUSE:Factory/.krunner.new.1548/krunner.changes 2022-06-17 21:21:33.290742201 +0200 @@ -1,0 +2,18 @@ +Fri Jun 10 14:12:42 UTC 2022 - Christophe Giboudeaux <[email protected]> + +- Update to 5.95.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.95.0 +- Changes since 5.94.0: + * autotests: Clean up unneeded includes + * RunnerContext: Call addMatch(QList<QueryMatch) internally when addMatch(QueryMatch) is called + * RunnerContext::addMatch: Fix broken handling of relevance for often launched entries + * Fix Qt6 build with KF 5.94 deprecation level + * Port away from deprecated KPluginMetaData::fromDesktopFile + * Bump version for disabled KF deprecations + * port to standard C++ smart pointers where possible + * DBusRunner: Avoid double lookup of match properties + * DBusRunner: Add multiline value to property map of RemoteMatch + +------------------------------------------------------------------- Old: ---- krunner-5.94.0.tar.xz krunner-5.94.0.tar.xz.sig New: ---- krunner-5.95.0.tar.xz krunner-5.95.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ krunner.spec ++++++ --- /var/tmp/diff_new_pack.8B594E/_old 2022-06-17 21:21:33.694742419 +0200 +++ /var/tmp/diff_new_pack.8B594E/_new 2022-06-17 21:21:33.698742422 +0200 @@ -17,7 +17,7 @@ %define lname libKF5Runner5 -%define _tar_path 5.94 +%define _tar_path 5.95 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) @@ -25,7 +25,7 @@ # Only needed for the package signature condition %bcond_without released Name: krunner -Version: 5.94.0 +Version: 5.95.0 Release: 0 Summary: KDE Framework for providing different actions given a string query License: LGPL-2.1-or-later ++++++ krunner-5.94.0.tar.xz -> krunner-5.95.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/CMakeLists.txt new/krunner-5.95.0/CMakeLists.txt --- old/krunner-5.94.0/CMakeLists.txt 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/CMakeLists.txt 2022-06-07 04:02:12.000000000 +0200 @@ -3,13 +3,13 @@ cmake_minimum_required(VERSION 3.16) -set(KF_VERSION "5.94.0") # handled by release scripts -set(KF_DEP_VERSION "5.93.0") # handled by release scripts +set(KF_VERSION "5.95.0") # handled by release scripts +set(KF_DEP_VERSION "5.95.0") # handled by release scripts project(KRunner VERSION ${KF_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.93.0 NO_MODULE) +find_package(ECM 5.95.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) @@ -49,7 +49,7 @@ ecm_set_disabled_deprecation_versions( QT ${REQUIRED_QT_VERSION} - KF 5.89.0 + KF 5.94.0 PLASMA 5.0.0 # needed because we use Plasma::Package in the API KSERVICE 5.89.0 # needed because we use KPluginInfo, KServiceTypeTrader in the API ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/CMakeLists.txt new/krunner-5.95.0/autotests/CMakeLists.txt --- old/krunner-5.94.0/autotests/CMakeLists.txt 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/autotests/CMakeLists.txt 2022-06-07 04:02:12.000000000 +0200 @@ -11,17 +11,17 @@ AND NOT WIN32) ecm_add_tests( runnercontexttest.cpp - LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::KIOCore KF5Runner + LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::KIOCore KF5Runner KF5::ConfigCore ) endif() ecm_add_tests( dbusrunnertest.cpp - LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner Qt${QT_MAJOR_VERSION}::Widgets Qt${QT_MAJOR_VERSION}::DBus + LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner Qt${QT_MAJOR_VERSION}::Widgets Qt${QT_MAJOR_VERSION}::DBus KF5::ConfigCore ) ecm_add_tests( runnermatchmethodstest.cpp - LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner Qt${QT_MAJOR_VERSION}::Widgets + LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner Qt${QT_MAJOR_VERSION}::Widgets KF5::ConfigCore ) @@ -30,7 +30,7 @@ kcoreaddons_desktop_to_json(fakerunnerplugin metadatafile1.desktop) ecm_add_tests( runnermanagerhistorytest.cpp - LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner Qt${QT_MAJOR_VERSION}::Widgets + LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner Qt${QT_MAJOR_VERSION}::Widgets KF5::ConfigCore ) kcoreaddons_target_static_plugins(runnermanagerhistorytest krunnertest) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/dbusrunnertest.cpp new/krunner-5.95.0/autotests/dbusrunnertest.cpp --- old/krunner-5.94.0/autotests/dbusrunnertest.cpp 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/autotests/dbusrunnertest.cpp 2022-06-07 04:02:12.000000000 +0200 @@ -30,6 +30,7 @@ #endif #include "abstractrunnertest.h" +#include "kpluginmetadata_utils_p.h" using namespace Plasma; @@ -102,6 +103,7 @@ QCOMPARE(result.text(), QStringLiteral("Match 1")); QCOMPARE(result.iconName(), QStringLiteral("icon1")); QCOMPARE(result.type(), Plasma::QueryMatch::ExactMatch); + QCOMPARE(result.isMultiLine(), true); // relevance can't be compared easily because RunnerContext meddles with it // verify actions @@ -147,7 +149,7 @@ manager->loadRunner(s); } else { #endif - auto md = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop"), {QStringLiteral("plasma-runner.desktop")}); + auto md = parseMetaDataFromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop")); QVERIFY(md.isValid()); manager->loadRunner(md); #if WITH_KSERVICE @@ -246,7 +248,7 @@ { QProcess *process = startDBusRunnerProcess({QStringLiteral("net.krunnertests.dave"), QString()}); manager.reset(new RunnerManager()); // This case is special, because we want to load the runners manually - auto md = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("dbusrunnertestruntimeconfig.desktop"), {QStringLiteral("plasma-runner.desktop")}); + auto md = parseMetaDataFromDesktopFile(QFINDTESTDATA("dbusrunnertestruntimeconfig.desktop")); manager->loadRunner(md); QCOMPARE(manager->runners().count(), 1); // Match session should be set up automatically @@ -277,7 +279,7 @@ { initProperties(); manager.reset(new RunnerManager()); // This case is special, because we want to load the runners manually - auto md = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop"), {QStringLiteral("plasma-runner.desktop")}); + auto md = parseMetaDataFromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop")); QVERIFY(md.isValid()); manager->loadRunner(md); QCOMPARE(manager->runners().count(), 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/fakerunner.h new/krunner-5.95.0/autotests/fakerunner.h --- old/krunner-5.94.0/autotests/fakerunner.h 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/autotests/fakerunner.h 2022-06-07 04:02:12.000000000 +0200 @@ -18,4 +18,22 @@ : FakeRunner(nullptr, metadata, {}) { } + + void match(RunnerContext &context) override + { + if (context.query() == QLatin1String("foo")) { + context.addMatch(createDummyMatch(QStringLiteral("foo"), 0.1)); + context.addMatch(createDummyMatch(QStringLiteral("bar"), 0.2)); + } + } + +private: + QueryMatch createDummyMatch(const QString &text, qreal relevance) + { + QueryMatch match(this); + match.setId(text); + match.setText(text); + match.setRelevance(relevance); + return match; + } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/metadatafile1.json new/krunner-5.95.0/autotests/metadatafile1.json --- old/krunner-5.94.0/autotests/metadatafile1.json 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.95.0/autotests/metadatafile1.json 2022-06-07 04:02:12.000000000 +0200 @@ -0,0 +1,11 @@ +{ + "KPlugin": { + "EnabledByDefault": true, + "Name": "DBus runner test", + "ServiceTypes": [ + "Plasma/Runner" + ] + }, + "X-Plasma-Runner-Unique-Results": true, + "X-Plasma-Runner-Weak-Results": true +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/metadatafile1.json.license new/krunner-5.95.0/autotests/metadatafile1.json.license --- old/krunner-5.94.0/autotests/metadatafile1.json.license 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.95.0/autotests/metadatafile1.json.license 2022-06-07 04:02:12.000000000 +0200 @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: none +SPDX-License-Identifier: CC0-1.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/runnermanagerhistorytest.cpp new/krunner-5.95.0/autotests/runnermanagerhistorytest.cpp --- old/krunner-5.94.0/autotests/runnermanagerhistorytest.cpp 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/autotests/runnermanagerhistorytest.cpp 2022-06-07 04:02:12.000000000 +0200 @@ -3,12 +3,15 @@ SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "fakerunner.h" #include "runnermanager.h" +#include <KConfig> +#include <KConfigGroup> +#include <KSharedConfig> #include <QAction> #include <QObject> #include <QProcess> +#include <QSignalSpy> #include <QStandardPaths> #include <QTest> @@ -17,8 +20,15 @@ class RunnerManagerHistoryTest : public QObject { Q_OBJECT +public: + RunnerManagerHistoryTest() + { + QStandardPaths::setTestModeEnabled(true); + stateConfigFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QDir::separator() + "krunnerstaterc"; + } private: + QString stateConfigFile; void addToHistory(const QStringList &queries, RunnerManager &manager) { QCOMPARE(manager.runners().count(), 1); @@ -30,19 +40,24 @@ manager.runMatch(match); } } + void launchQuery(const QString &query, RunnerManager *manager) + { + QSignalSpy spy(manager, &Plasma::RunnerManager::queryFinished); + manager->launchQuery(query); + QVERIFY2(spy.wait(), "RunnerManager did not emit the queryFinished signal"); + } private Q_SLOTS: void init() { - QStandardPaths::setTestModeEnabled(true); - QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QDir::separator() + "krunnerstaterc"; - if (QFileInfo::exists(path)) { - QFile::remove(path); + if (QFileInfo::exists(stateConfigFile)) { + QFile::remove(stateConfigFile); } } void testRunnerHistory(); void testRunnerHistory_data(); void testHistorySuggestionsAndRemoving(); + void testRelevanceForOftenLaunched(); }; void RunnerManagerHistoryTest::testRunnerHistory() @@ -88,6 +103,43 @@ QCOMPARE(manager.getHistorySuggestion("t"), "test2"); } +void RunnerManagerHistoryTest::testRelevanceForOftenLaunched() +{ + { + KConfig cfg(stateConfigFile); + cfg.group("PlasmaRunnerManager").writeEntry("LaunchCounts", "5 foo"); + cfg.sync(); + } + std::unique_ptr<RunnerManager> manager(new RunnerManager()); + manager->setAllowedRunners({QStringLiteral("fakerunnerplugin")}); + manager->loadRunner(KPluginMetaData::findPluginById(QStringLiteral("krunnertest"), QStringLiteral("fakerunnerplugin"))); + + launchQuery(QStringLiteral("foo"), manager.get()); + + const auto matches = manager->matches(); + QCOMPARE(matches.size(), 2); + QCOMPARE(matches.at(0).id(), QStringLiteral("foo")); + QCOMPARE(matches.at(1).id(), QStringLiteral("bar")); + QCOMPARE(matches.at(1).relevance(), 0.2); + + QVERIFY(matches.at(0).relevance() > matches.at(1).relevance()); + QVERIFY(matches.at(0).relevance() < 0.6); // 0.5 is the max we add as a bonus, 0.1 comes from the runner + { + KConfig cfg(stateConfigFile); + cfg.group("PlasmaRunnerManager").writeEntry("LaunchCounts", QStringList{"5 foo", "5 bar"}); + cfg.sync(); + KSharedConfig::openConfig(QStringLiteral("krunnerstaterc"), KConfig::NoGlobals, QStandardPaths::GenericDataLocation)->reparseConfiguration(); + } + manager.reset(new RunnerManager()); + manager->setAllowedRunners({QStringLiteral("fakerunnerplugin")}); + manager->loadRunner(KPluginMetaData::findPluginById(QStringLiteral("krunnertest"), QStringLiteral("fakerunnerplugin"))); + + launchQuery(QStringLiteral("foo"), manager.get()); + const auto newMatches = manager->matches(); + QCOMPARE(newMatches.size(), 2); + QVERIFY(newMatches.at(0).relevance() < newMatches.at(1).relevance()); +} + QTEST_MAIN(RunnerManagerHistoryTest) #include "runnermanagerhistorytest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/runnermanagersinglerunnermodetest.cpp new/krunner-5.95.0/autotests/runnermanagersinglerunnermodetest.cpp --- old/krunner-5.94.0/autotests/runnermanagersinglerunnermodetest.cpp 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/autotests/runnermanagersinglerunnermodetest.cpp 2022-06-07 04:02:12.000000000 +0200 @@ -3,7 +3,6 @@ SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "fakerunner.h" #include "runnermanager.h" #include <KConfigGroup> @@ -16,6 +15,7 @@ #include <QTest> #include "abstractrunnertest.h" +#include "kpluginmetadata_utils_p.h" using namespace Plasma; @@ -30,7 +30,7 @@ qputenv("XDG_DATA_DIRS", QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation).toLocal8Bit()); QCoreApplication::setLibraryPaths(QStringList()); initProperties(); - auto md = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop"), {QStringLiteral("plasma-runner.desktop")}); + auto md = parseMetaDataFromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop")); QVERIFY(md.isValid()); manager->loadRunner(md); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/runnermanagertest.cpp new/krunner-5.95.0/autotests/runnermanagertest.cpp --- old/krunner-5.94.0/autotests/runnermanagertest.cpp 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/autotests/runnermanagertest.cpp 2022-06-07 04:02:12.000000000 +0200 @@ -4,7 +4,6 @@ */ #include "runnermanager.h" -#include "fakerunner.h" #include <KSharedConfig> #include <QAction> @@ -15,6 +14,7 @@ #include <QTest> #include "abstractrunnertest.h" +#include "kpluginmetadata_utils_p.h" Q_DECLARE_METATYPE(Plasma::QueryMatch) Q_DECLARE_METATYPE(QList<Plasma::QueryMatch>) @@ -31,7 +31,7 @@ qputenv("XDG_DATA_DIRS", QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation).toLocal8Bit()); QCoreApplication::setLibraryPaths(QStringList()); initProperties(); - auto md = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop"), {QStringLiteral("plasma-runner.desktop")}); + auto md = parseMetaDataFromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop")); QVERIFY(md.isValid()); manager->loadRunner(md); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/runnermatchmethodstest.cpp new/krunner-5.95.0/autotests/runnermatchmethodstest.cpp --- old/krunner-5.94.0/autotests/runnermatchmethodstest.cpp 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/autotests/runnermatchmethodstest.cpp 2022-06-07 04:02:12.000000000 +0200 @@ -13,6 +13,8 @@ #include <QStandardPaths> #include <QTest> +#include "kpluginmetadata_utils_p.h" + using namespace Plasma; namespace @@ -60,8 +62,8 @@ const QByteArray defaultDataDirs = qEnvironmentVariableIsSet("XDG_DATA_DIRS") ? qgetenv("XDG_DATA_DIRS") : QByteArray("/usr/local:/usr"); const QByteArray modifiedDataDirs = QFile::encodeName(QCoreApplication::applicationDirPath()) + QByteArrayLiteral("/data:") + defaultDataDirs; qputenv("XDG_DATA_DIRS", modifiedDataDirs); - KPluginMetaData data1 = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("metadatafile1.desktop")); - KPluginMetaData data2 = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("metadatafile2.desktop")); + KPluginMetaData data1 = parseMetaDataFromDesktopFile(QFINDTESTDATA("metadatafile1.desktop")); + KPluginMetaData data2 = parseMetaDataFromDesktopFile(QFINDTESTDATA("metadatafile2.desktop")); QVERIFY(data1.isValid()); QVERIFY(data2.isValid()); runner1 = new FakeRunner(data1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/autotests/testremoterunner.cpp new/krunner-5.95.0/autotests/testremoterunner.cpp --- old/krunner-5.94.0/autotests/testremoterunner.cpp 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/autotests/testremoterunner.cpp 2022-06-07 04:02:12.000000000 +0200 @@ -80,6 +80,7 @@ m.type = Plasma::QueryMatch::ExactMatch; m.relevance = 0.8; m.properties[QStringLiteral("actions")] = QStringList(QStringLiteral("action1")); + m.properties[QStringLiteral("multiline")] = true; ms << m; } return ms; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/src/abstractrunnertest.h new/krunner-5.95.0/src/abstractrunnertest.h --- old/krunner-5.94.0/src/abstractrunnertest.h 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/src/abstractrunnertest.h 2022-06-07 04:02:12.000000000 +0200 @@ -41,7 +41,7 @@ manager.reset(new Plasma::RunnerManager()); #if KRUNNER_DBUS_RUNNER_TESTING - auto md = KPluginMetaData::fromDesktopFile(QStringLiteral(KRUNNER_TEST_DESKTOP_FILE), {QStringLiteral("plasma-runner.desktop")}); + auto md = manager->convertDBusRunnerToJson(QStringLiteral(KRUNNER_TEST_DESKTOP_FILE)); QVERIFY(md.isValid()); manager->loadRunner(md); #else @@ -81,7 +81,7 @@ { qputenv("LC_ALL", "C.utf-8"); QProcess *process = new QProcess(); - auto md = KPluginMetaData::fromDesktopFile(QStringLiteral(KRUNNER_TEST_DESKTOP_FILE), {QStringLiteral("plasma-runner.desktop")}); + auto md = manager->convertDBusRunnerToJson(QStringLiteral(KRUNNER_TEST_DESKTOP_FILE)); QString serviceToWatch = waitForService; if (serviceToWatch.isEmpty()) { serviceToWatch = md.value(QStringLiteral("X-Plasma-DBusRunner-Service")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/src/data/org.kde.krunner1.xml new/krunner-5.95.0/src/data/org.kde.krunner1.xml --- old/krunner-5.94.0/src/data/org.kde.krunner1.xml 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/src/data/org.kde.krunner1.xml 2022-06-07 04:02:12.000000000 +0200 @@ -78,16 +78,17 @@ - Type (see PlasmaQuery::Type) - Relevance - Properties (VariantMap) - - Urls (StringList) - - Category - - Subtext - - Action Ids (StringList). In case you don't want to display any actions set this to an empty list. + - urls (StringList) + - category + - subtext + - actions (StringList of RemoteAction's IDs). In case you don't want to display any actions set this to an empty list. Otherwise all the actions will be shown for compatibility with the previous versions of the D-Bus API. When the actions only need to be fetched once you can set the X-Plasma-Request-Actions-Once property of the service file to true. - icon-data (iiibiiay). Custom icon pixmap. Icon name should be preferred, if available. Format is the same as org.freedesktop.Notifications icon-data, in order: width, height, row stride, has alpha, bits per sample, number of channels, pixmap data. + - multiline (boolean). If the text should be displayed as styled multiline text. --> <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="RemoteMatches"/> <arg name="matches" type="a(sssida{sv})" direction="out"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/src/data/servicetypes/plasma-runner.desktop new/krunner-5.95.0/src/data/servicetypes/plasma-runner.desktop --- old/krunner-5.94.0/src/data/servicetypes/plasma-runner.desktop 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/src/data/servicetypes/plasma-runner.desktop 2022-06-07 04:02:12.000000000 +0200 @@ -10,7 +10,7 @@ Comment[az]=KRunner uzant??s?? Comment[bs]=Priklju??ak za KRunner Comment[ca]=Connector del KRunner -Comment[ca@valencia]=Connector de KRunner +Comment[ca@valencia]=Conector de KRunner Comment[cs]=Modul KRunneru Comment[da]=KRunner-plugin Comment[de]=KRunner-Modul @@ -28,6 +28,7 @@ Comment[ia]=Plugin de KRunner Comment[id]=Plugin KRunner Comment[it]=Estensione di KRunner +Comment[ka]=KRunner-?????? ???????????????????????? Comment[ko]=KRunner ???????????? Comment[lt]=KRunner papildinys Comment[mr]=KRunner ?????????????????? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/src/dbusrunner.cpp new/krunner-5.95.0/src/dbusrunner.cpp --- old/krunner-5.94.0/src/dbusrunner.cpp 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/src/dbusrunner.cpp 2022-06-07 04:02:12.000000000 +0200 @@ -217,17 +217,16 @@ } } // we scope watchers to make sure the lambda that captures context by reference definitely gets disconnected when this function ends - QList<QSharedPointer<QDBusPendingCallWatcher>> watchers; + std::vector<std::unique_ptr<QDBusPendingCallWatcher>> watchers; for (const QString &service : std::as_const(services)) { auto matchMethod = QDBusMessage::createMethodCall(service, m_path, QStringLiteral(IFACE_NAME), QStringLiteral("Match")); matchMethod.setArguments(QList<QVariant>({context.query()})); QDBusPendingReply<RemoteMatches> reply = QDBusConnection::sessionBus().asyncCall(matchMethod); - auto watcher = new QDBusPendingCallWatcher(reply); - watchers << QSharedPointer<QDBusPendingCallWatcher>(watcher); + watchers.push_back(std::make_unique<QDBusPendingCallWatcher>(reply)); connect( - watcher, + watchers.back().get(), &QDBusPendingCallWatcher::finished, this, [this, service, &context, reply]() { @@ -248,12 +247,14 @@ m.setUrls(QUrl::fromStringList(match.properties.value(QStringLiteral("urls")).toStringList())); m.setMatchCategory(match.properties.value(QStringLiteral("category")).toString()); m.setSubtext(match.properties.value(QStringLiteral("subtext")).toString()); - if (match.properties.contains(QStringLiteral("actions"))) { - m.setData(QVariantList({service, match.properties.value(QStringLiteral("actions"))})); - } else { + const auto actionsIt = match.properties.find(QStringLiteral("actions")); + if (actionsIt == match.properties.cend()) { m.setData(QVariantList({service})); + } else { + m.setData(QVariantList({service, actionsIt.value().toStringList()})); } m.setId(match.id); + m.setMultiLine(match.properties.value(QStringLiteral("multiline")).toBool()); const QVariant iconData = match.properties.value(QStringLiteral("icon-data")); if (iconData.isValid()) { @@ -280,7 +281,7 @@ Qt::DirectConnection); // process reply in the watcher's thread (aka the one running ::match not the one owning the runner) } // we're done matching when every service replies - for (auto w : std::as_const(watchers)) { + for (auto &w : watchers) { w->waitForFinished(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/src/kpluginmetadata_utils_p.h new/krunner-5.95.0/src/kpluginmetadata_utils_p.h --- old/krunner-5.94.0/src/kpluginmetadata_utils_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.95.0/src/kpluginmetadata_utils_p.h 2022-06-07 04:02:12.000000000 +0200 @@ -0,0 +1,61 @@ +/* + SPDX-FileCopyrightText: 2022 Alexander Lohnau <[email protected]> + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include <KAboutData> +#include <KConfigGroup> +#include <KDesktopFile> +#include <KPluginMetaData> +#include <QJsonArray> +#include <QJsonObject> +#include <QString> + +template<class T = QString> +inline void copyIfExists(const KConfigGroup &grp, QJsonObject &obj, const char *key, const T &t = QString()) +{ + copyAndRenameIfExists(grp, obj, key, key, t); +} + +template<class T> +inline void copyAndRenameIfExists(const KConfigGroup &grp, QJsonObject &obj, const char *oldKey, const char *key, const T &t) +{ + if (grp.hasKey(oldKey)) { + obj.insert(QLatin1String(key), grp.readEntry(oldKey, t)); + } +} +inline KPluginMetaData parseMetaDataFromDesktopFile(const QString &fileName) +{ + KDesktopFile file(fileName); + const KConfigGroup grp = file.desktopGroup(); + + QJsonObject kplugin; + copyIfExists(grp, kplugin, "Name"); + copyIfExists(grp, kplugin, "Icon"); + copyIfExists(grp, kplugin, "X-KDE-PluginInfo-Name", "Id"); + copyIfExists(grp, kplugin, "Description"); + copyIfExists(grp, kplugin, "Comment", "Description"); + copyAndRenameIfExists(grp, kplugin, "X-KDE-PluginInfo-EnabledByDefault", "EnabledByDefault", false); + QJsonObject root; + root.insert(QLatin1String("KPlugin"), kplugin); + + copyIfExists(grp, root, "X-Plasma-DBusRunner-Service"); + copyIfExists(grp, root, "X-Plasma-DBusRunner-Path"); + copyIfExists(grp, root, "X-Plasma-Runner-Unique-Results", false); + copyIfExists(grp, root, "X-Plasma-Runner-Weak-Results", false); + copyIfExists(grp, root, "X-Plasma-API"); + copyIfExists(grp, root, "X-Plasma-Request-Actions-Once", false); + copyIfExists(grp, root, "X-Plasma-AdvertiseSingleRunnerQueryMode", false); + copyIfExists(grp, root, "X-Plasma-Runner-Min-Letter-Count", 0); + copyIfExists(grp, root, "X-Plasma-Runner-Match-Regex"); + root.insert(QLatin1String("X-Plasma-Runner-Syntaxes"), QJsonArray::fromStringList(grp.readEntry("X-Plasma-Runner-Syntaxes", QStringList()))); + root.insert(QLatin1String("X-Plasma-Runner-Syntax-Descriptions"), + QJsonArray::fromStringList(grp.readEntry("X-Plasma-Runner-Syntax-Descriptions", QStringList()))); + QJsonObject author; + author.insert(QLatin1String("Name"), grp.readEntry("X-KDE-PluginInfo-Author")); + author.insert(QLatin1String("Email"), grp.readEntry("X-KDE-PluginInfo-Email")); + author.insert(QLatin1String("Website"), grp.readEntry("X-KDE-PluginInfo-Website")); + + return KPluginMetaData(root, fileName); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/src/runnercontext.cpp new/krunner-5.95.0/src/runnercontext.cpp --- old/krunner-5.94.0/src/runnercontext.cpp 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/src/runnercontext.cpp 2022-06-07 04:02:12.000000000 +0200 @@ -337,23 +337,7 @@ bool RunnerContext::addMatch(const QueryMatch &match) { - if (!isValid()) { - // Bail out if the qptr is dirty - return false; - } - - QueryMatch m(match); // match must be non-const to modify relevance - - LOCK_FOR_WRITE(d) - - if (int count = d->launchCounts.value(m.id())) { - m.setRelevance(m.relevance() + 0.05 * count); - } - d->addMatch(match); - UNLOCK(d); - Q_EMIT d->q->matchesChanged(); - - return true; + return addMatches({match}); } #if KRUNNER_BUILD_DEPRECATED_SINCE(5, 81) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/src/runnermanager.cpp new/krunner-5.95.0/src/runnermanager.cpp --- old/krunner-5.94.0/src/runnermanager.cpp 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/src/runnermanager.cpp 2022-06-07 04:02:12.000000000 +0200 @@ -39,6 +39,7 @@ #endif #include "dbusrunner_p.h" +#include "kpluginmetadata_utils_p.h" #include "krunner_debug.h" #include "querymatch.h" #include "runnerjobs_p.h" @@ -820,7 +821,7 @@ QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("krunner/dbusplugins"), QStandardPaths::LocateDirectory); const QStringList dbusRunnerFiles = KFileUtils::findAllUniqueFiles(dBusPlugindirs, QStringList(QStringLiteral("*.desktop"))); for (const QString &dbusRunnerFile : dbusRunnerFiles) { - KPluginMetaData pluginMetaData = KPluginMetaData::fromDesktopFile(dbusRunnerFile, QStringList(QStringLiteral("plasma-runner.desktop"))); + KPluginMetaData pluginMetaData = parseMetaDataFromDesktopFile(dbusRunnerFile); if (pluginMetaData.isValid() && !knownRunnerIds.contains(pluginMetaData.pluginId())) { pluginMetaDatas.append(pluginMetaData); knownRunnerIds.insert(pluginMetaData.pluginId()); @@ -863,7 +864,7 @@ QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("krunner/dbusplugins"), QStandardPaths::LocateDirectory); const QStringList dbusRunnerFiles = KFileUtils::findAllUniqueFiles(dBusPlugindirs, QStringList(QStringLiteral("*.desktop"))); for (const QString &dbusRunnerFile : dbusRunnerFiles) { - KPluginMetaData pluginMetaData = KPluginMetaData::fromDesktopFile(dbusRunnerFile, QStringList(QStringLiteral("plasma-runner.desktop"))); + KPluginMetaData pluginMetaData = parseMetaDataFromDesktopFile(dbusRunnerFile); if (pluginMetaData.isValid() && !knownRunnerIds.contains(pluginMetaData.pluginId())) { pluginMetaDatas.append(pluginMetaData); knownRunnerIds.insert(pluginMetaData.pluginId()); @@ -1066,6 +1067,11 @@ Q_EMIT queryFinished(); } +KPluginMetaData RunnerManager::convertDBusRunnerToJson(const QString &filename) const +{ + return parseMetaDataFromDesktopFile(filename); +} + void RunnerManager::enableKNotifyPluginWatcher() { if (!d->watcher) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/src/runnermanager.h new/krunner-5.95.0/src/runnermanager.h --- old/krunner-5.94.0/src/runnermanager.h 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/src/runnermanager.h 2022-06-07 04:02:12.000000000 +0200 @@ -25,6 +25,10 @@ class QAction; class KConfigGroup; +namespace +{ +class AbstractRunnerTest; +} namespace Plasma { @@ -462,10 +466,12 @@ private: Q_PRIVATE_SLOT(d, void jobDone(ThreadWeaver::JobPointer)) + KPluginMetaData convertDBusRunnerToJson(const QString &filename) const; std::unique_ptr<RunnerManagerPrivate> const d; friend class RunnerManagerPrivate; + friend AbstractRunnerTest; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/templates/runner/runner.kdevtemplate new/krunner-5.95.0/templates/runner/runner.kdevtemplate --- old/krunner-5.94.0/templates/runner/runner.kdevtemplate 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/templates/runner/runner.kdevtemplate 2022-06-07 04:02:12.000000000 +0200 @@ -21,6 +21,7 @@ Name[ia]=C++ Name[id]=C++ Name[it]=C++ +Name[ka]=C++ Name[ko]=C++ Name[nb]=C++ Name[nl]=C++ @@ -65,6 +66,7 @@ Comment[ia]=Patrono de executor (runner) de Plasma. Un patrono de executor de Plasma Comment[id]=Plasma Runner Template. Sebuah template pejalan plasma Comment[it]=Modello di esecutore di Plasma. Un modello di esecutore di Plasma +Comment[ka]=Plasma-?????? ???????????????????????? ???????????????????????? ?????????????????????. Plasma-?????? ???????????????????????? ???????????????????????? ????????????????????? Comment[ko]=Plasma ????????? ?????????. Plasma ????????? ????????? Comment[nb]=Plasma kj??rermal. En Plasma-kj??rermal Comment[nl]=Sjabloon voor Plasma-runner. Een plasma-starter sjabloon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.94.0/templates/runnerpython/runnerpy.kdevtemplate new/krunner-5.95.0/templates/runnerpython/runnerpy.kdevtemplate --- old/krunner-5.94.0/templates/runnerpython/runnerpy.kdevtemplate 2022-05-04 21:27:45.000000000 +0200 +++ new/krunner-5.95.0/templates/runnerpython/runnerpy.kdevtemplate 2022-06-07 04:02:12.000000000 +0200 @@ -3,7 +3,7 @@ Name[ar]=?????????? ???????????? ?????????????? Name[az]=Python KRunner qo??mas?? Name[ca]=Connector Python del KRunner -Name[ca@valencia]=Connector Python de KRunner +Name[ca@valencia]=Conector Python de KRunner Name[cs]=Modul KRunneru pr Python Name[da]=Python-plugin til KRunner Name[de]=KRunner-Modul f??r Python @@ -19,6 +19,7 @@ Name[ia]=Plugin de KRunner de Python Name[id]=Plugin KRunner Python Name[it]=Estensione Python di KRunner +Name[ka]=KRunner-?????? Python-?????? ???????????????????????? Name[ko]=Python KRunner ???????????? Name[nl]=Python KRunner-plug-in Name[nn]=Python KRunner-tillegg @@ -40,7 +41,7 @@ Comment[ar]=???????? ?????????? ???????????? ???????????? ???????????????? D-Bus Comment[az]=D-Bus il?? istifad?? olunan KRunner Python Qo??mas?? ??????n n??mun?? Comment[ca]=Plantilla per a un connector Python del KRunner usant D-Bus -Comment[ca@valencia]=Plantilla per a un connector Python de KRunner usant D-Bus +Comment[ca@valencia]=Plantilla per a un conector Python de KRunner utilisant D-Bus Comment[da]=Skabelon til et KRunner Python-plugin med brug af D-Bus Comment[de]=Vorlage f??r ein KRunner-Modul f??r Python, das D-Bus verwendet Comment[el]=?????????????? ?????? ?????? Python ???????????????? ?????? KRunner ???? ?????????? D-Bus @@ -55,6 +56,7 @@ Comment[ia]=Patrono per un Plugin de Python de KRunner usante D-Bus Comment[id]=Templat untuk sebuah Plugin Python KRunner menggunakan D-Bus Comment[it]=Modello per un'estensione Python di KRunner che usa D-Bus +Comment[ka]=KRunner-?????? Python-?????? ??????????????????????????? ????????????????????? D-Bus-?????? ????????????????????????????????? Comment[ko]=D-Bus??? ???????????? KRunner Python ???????????? ????????? Comment[nl]=Sjabloon voor een Python-plug-in van KRunner met gebruik van D-Bus Comment[nn]=Mal for eit Python-basert KRunner-tillegg som brukar D-Bus
