Hello community, here is the log from the commit of package krunner for openSUSE:Factory checked in at 2020-07-14 07:54:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/krunner (Old) and /work/SRC/openSUSE:Factory/.krunner.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "krunner" Tue Jul 14 07:54:14 2020 rev:78 rq:820391 version:5.72.0 Changes: -------- --- /work/SRC/openSUSE:Factory/krunner/krunner.changes 2020-06-16 13:44:03.497381051 +0200 +++ /work/SRC/openSUSE:Factory/.krunner.new.3060/krunner.changes 2020-07-14 07:55:29.865052973 +0200 @@ -1,0 +2,12 @@ +Sun Jul 5 07:55:43 UTC 2020 - Christophe Giboudeaux <christo...@krop.fr> + +- Update to 5.72.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/kde-frameworks-5.72.0 +- Changes since 5.71.0: + * Fix RunnerContextTest to not assume presence of .bashrc + * Use embedded JSON metadata for binary plugins & custom for D-Bus plugins + * Emit queryFinished when all jobs for current query have finished (kde#422579) + +------------------------------------------------------------------- Old: ---- krunner-5.71.0.tar.xz krunner-5.71.0.tar.xz.sig New: ---- krunner-5.72.0.tar.xz krunner-5.72.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ krunner.spec ++++++ --- /var/tmp/diff_new_pack.EMBTxb/_old 2020-07-14 07:55:34.045066507 +0200 +++ /var/tmp/diff_new_pack.EMBTxb/_new 2020-07-14 07:55:34.045066507 +0200 @@ -17,7 +17,7 @@ %define lname libKF5Runner5 -%define _tar_path 5.71 +%define _tar_path 5.72 # 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,9 +25,9 @@ # Only needed for the package signature condition %bcond_without lang Name: krunner -Version: 5.71.0 +Version: 5.72.0 Release: 0 -Summary: Plugins responsible for better integration of Qt applications in KDE Workspace +Summary: KDE Framework for providing different actions given a string query License: LGPL-2.1-or-later Group: System/GUI/KDE URL: https://www.kde.org @@ -37,7 +37,6 @@ Source2: frameworks.keyring %endif Source99: baselibs.conf -BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: fdupes BuildRequires: kf5-filesystem @@ -55,25 +54,17 @@ BuildRequires: cmake(Qt5Test) >= 5.12.0 %description -Framework Integration is a set of plugins responsible for better -integration of Qt applications when running on a -KDE Plasma workspace. - -Applications do not need to link to this directly. +KDE Framework for providing different actions given a string query. %package -n %{lname} -Summary: Plugins responsible for better integration of Qt applications in KDE Workspace +Summary: KDE Framework for providing different actions given a string query Group: System/GUI/KDE %description -n %{lname} -Framework Integration is a set of plugins responsible for better -integration of Qt applications when running on a -KDE Plasma workspace. - -Applications do not need to link to this directly. +KDE Framework for providing different actions given a string query. %package devel -Summary: Plugins responsible for better integration of Qt applications in KDE Workspace +Summary: KDE Framework for providing different actions given a string query Group: Development/Libraries/KDE Requires: %{lname} = %{version} Requires: extra-cmake-modules @@ -82,11 +73,7 @@ Conflicts: kapptemplate <= 16.03.80 %description devel -Framework Integration is a set of plugins responsible for better -integration of Qt applications when running on a -KDE Plasma workspace. - -Applications do not need to link to this directly. Development files +Files needed for developing custom runners or frontends. %prep %setup -q ++++++ krunner-5.71.0.tar.xz -> krunner-5.72.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/CMakeLists.txt new/krunner-5.72.0/CMakeLists.txt --- old/krunner-5.71.0/CMakeLists.txt 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/CMakeLists.txt 2020-07-04 11:56:08.000000000 +0200 @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.71.0") # handled by release scripts -set(KF5_DEP_VERSION "5.71.0") # handled by release scripts +set(KF5_VERSION "5.72.0") # handled by release scripts +set(KF5_DEP_VERSION "5.72.0") # handled by release scripts project(KRunner VERSION ${KF5_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.71.0 NO_MODULE) +find_package(ECM 5.72.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) @@ -53,6 +53,8 @@ JSON_NONE "K_EXPORT_PLASMA_RUNNER" "K_EXPORT_RUNNER_CONFIG" + JSON_ARG2 + "K_EXPORT_PLASMA_RUNNER_WITH_JSON" CONFIG_CODE_VARIABLE PACKAGE_SETUP_AUTOMOC_VARIABLES ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/autotests/dbusrunnertest.cpp new/krunner-5.72.0/autotests/dbusrunnertest.cpp --- old/krunner-5.71.0/autotests/dbusrunnertest.cpp 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/autotests/dbusrunnertest.cpp 2020-07-04 11:56:08.000000000 +0200 @@ -16,18 +16,26 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "runnermanager.h" + +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) +#define WITH_KSERVICE 1 +#else +#define WITH_KSERVICE 0 +#endif + #include <QObject> #include <QAction> #include <QTest> #include <QStandardPaths> - -#include "runnermanager.h" #include <QSignalSpy> #include <QProcess> #include <QTime> #include <QTimer> +#if WITH_KSERVICE #include <KSycoca> +#endif using namespace Plasma; @@ -43,12 +51,19 @@ private Q_SLOTS: void initTestCase(); +#if WITH_KSERVICE void cleanupTestCase(); +#endif void testMatch(); void testMulti(); void testRequestActionsOnce(); +#if WITH_KSERVICE + void testMatch_data(); + void testMulti_data(); + void testRequestActionsOnce_data(); private: QStringList m_filesForCleanup; +#endif }; DBusRunnerTest::DBusRunnerTest() @@ -63,12 +78,13 @@ void DBusRunnerTest::initTestCase() { - // Set up a layer in the bin dir so ksycoca finds the Plasma/Runner service type + // Set up a layer in the bin dir so ksycoca & KPluginMetaData find the Plasma/Runner service type 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); QStandardPaths::setTestModeEnabled(true); +#if WITH_KSERVICE QDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)).mkpath(QStringLiteral("kservices5")); { const QString fakeServicePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/kservices5/dbusrunnertest.desktop"); @@ -82,17 +98,34 @@ m_filesForCleanup << fakeServicePath; } KSycoca::self()->ensureCacheValid(); +#endif } +#if WITH_KSERVICE void DBusRunnerTest::cleanupTestCase() { for(const QString &path: qAsConst(m_filesForCleanup)) { QFile::remove(path); } } +#endif + +#if WITH_KSERVICE +void DBusRunnerTest::testMatch_data() +{ + QTest::addColumn<bool>("useKService"); + + QTest::newRow("deprecated") << true; + QTest::newRow("non-deprecated") << false; +} +#endif void DBusRunnerTest::testMatch() { +#if WITH_KSERVICE + QFETCH(bool, useKService); +#endif + QProcess process; process.start(QFINDTESTDATA("testremoterunner"), QStringList({QStringLiteral("net.krunnertests.dave")})); QVERIFY(process.waitForStarted()); @@ -100,9 +133,19 @@ QTest::qSleep(500); RunnerManager m; - auto s = KService::serviceByDesktopPath(QStringLiteral("dbusrunnertest.desktop")); - QVERIFY(s); - m.loadRunner(s); +#if WITH_KSERVICE + if (useKService) { + auto s = KService::serviceByDesktopPath(QStringLiteral("dbusrunnertest.desktop")); + QVERIFY(s); + m.loadRunner(s); + } else { +#endif + auto md = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("dbusrunnertest.desktop"), {QStringLiteral("plasma-runner.desktop")}); + QVERIFY(md.isValid()); + m.loadRunner(md); +#if WITH_KSERVICE + } +#endif m.launchQuery(QStringLiteral("foo")); QSignalSpy spy(&m, &RunnerManager::matchesChanged); @@ -140,8 +183,22 @@ process.waitForFinished(); } +#if WITH_KSERVICE +void DBusRunnerTest::testMulti_data() +{ + QTest::addColumn<bool>("useKService"); + + QTest::newRow("deprecated") << true; + QTest::newRow("non-deprecated") << false; +} +#endif + void DBusRunnerTest::testMulti() { +#if WITH_KSERVICE + QFETCH(bool, useKService); +#endif + QProcess process1; process1.start(QFINDTESTDATA("testremoterunner"), QStringList({QStringLiteral("net.krunnertests.multi.a1")})); QVERIFY(process1.waitForStarted()); @@ -153,9 +210,19 @@ QTest::qSleep(500); RunnerManager m; - auto s = KService::serviceByDesktopPath(QStringLiteral("dbusrunnertestmulti.desktop")); - QVERIFY(s); - m.loadRunner(s); +#if WITH_KSERVICE + if (useKService) { + auto s = KService::serviceByDesktopPath(QStringLiteral("dbusrunnertestmulti.desktop")); + QVERIFY(s); + m.loadRunner(s); + } else { +#endif + auto md = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop"), {QStringLiteral("plasma-runner.desktop")}); + QVERIFY(md.isValid()); + m.loadRunner(md); +#if WITH_KSERVICE + } +#endif m.launchQuery(QStringLiteral("foo")); QSignalSpy spy(&m, &RunnerManager::matchesChanged); @@ -176,17 +243,41 @@ process2.waitForFinished(); } +#if WITH_KSERVICE +void DBusRunnerTest::testRequestActionsOnce_data() +{ + QTest::addColumn<bool>("useKService"); + + QTest::newRow("deprecated") << true; + QTest::newRow("non-deprecated") << false; +} +#endif + void DBusRunnerTest::testRequestActionsOnce() { +#if WITH_KSERVICE + QFETCH(bool, useKService); +#endif + QProcess process; process.start(QFINDTESTDATA("testremoterunner"), QStringList({QStringLiteral("net.krunnertests.dave")})); QVERIFY(process.waitForStarted()); QTest::qSleep(500); RunnerManager m; - auto s = KService::serviceByDesktopPath(QStringLiteral("dbusrunnertest.desktop")); - QVERIFY(s); - m.loadRunner(s); +#if WITH_KSERVICE + if (useKService) { + auto s = KService::serviceByDesktopPath(QStringLiteral("dbusrunnertest.desktop")); + QVERIFY(s); + m.loadRunner(s); + } else { +#endif + auto md = KPluginMetaData::fromDesktopFile(QFINDTESTDATA("dbusrunnertest.desktop"), {QStringLiteral("plasma-runner.desktop")}); + QVERIFY(md.isValid()); + m.loadRunner(md); +#if WITH_KSERVICE + } +#endif // Wait because dbus signal is async QEventLoop loop; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/autotests/runnercontexttest.cpp new/krunner-5.72.0/autotests/runnercontexttest.cpp --- old/krunner-5.71.0/autotests/runnercontexttest.cpp 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/autotests/runnercontexttest.cpp 2020-07-04 11:56:08.000000000 +0200 @@ -22,8 +22,17 @@ #include <kprotocolinfo.h> #include "runnercontext.h" +#include <QDir> + Q_DECLARE_METATYPE(Plasma::RunnerContext::Type) +static QString getSomeExistingFileInHomeDir() +{ + QDir home = QDir::home(); + const auto files = QDir::home().entryList(QDir::Files|QDir::Hidden); + return !files.isEmpty() ? files.first() : QString(); +} + void RunnerContextTest::typeDetection_data() { QTest::addColumn<QString>("url"); @@ -47,7 +56,10 @@ QTest::newRow("full path executable with params") << "/bin/ls -R" << Plasma::RunnerContext::ShellCommand; QTest::newRow("protocol-less path") << "/home" << Plasma::RunnerContext::Directory; QTest::newRow("protocol-less tilded") << "~" << Plasma::RunnerContext::Directory; - QTest::newRow("protocol-less file starting with tilded") << "~/.bashrc" << Plasma::RunnerContext::File; + const QString file = getSomeExistingFileInHomeDir(); + if (!file.isEmpty()) { + QTest::newRow("protocol-less file starting with tilded") << QLatin1String("~/")+file << Plasma::RunnerContext::File; + } QTest::newRow("invalid protocol-less path") << "/bad/path" << Plasma::RunnerContext::UnknownType; QTest::newRow("calculation") << "5*4" << Plasma::RunnerContext::UnknownType; QTest::newRow("calculation (float)") << "5.2*4" << Plasma::RunnerContext::UnknownType; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/docs/Doxyfile.local new/krunner-5.72.0/docs/Doxyfile.local --- old/krunner-5.71.0/docs/Doxyfile.local 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/docs/Doxyfile.local 2020-07-04 11:56:08.000000000 +0200 @@ -2,6 +2,7 @@ # define so that deprecated API is not skipped PREDEFINED += \ + "KSERVICE_BUILD_DEPRECATED_SINCE(x, y)=1" \ "PLASMA_ENABLE_DEPRECATED_SINCE(x, y)=1" \ "KRUNNER_ENABLE_DEPRECATED_SINCE(x, y)=1" \ "KRUNNER_BUILD_DEPRECATED_SINCE(x, y)=1" \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/src/CMakeLists.txt new/krunner-5.72.0/src/CMakeLists.txt --- old/krunner-5.71.0/src/CMakeLists.txt 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/src/CMakeLists.txt 2020-07-04 11:56:08.000000000 +0200 @@ -1,4 +1,10 @@ -add_subdirectory(declarative) +# TODO: merge QML plugin from Milou into this instead and provide a plugin again officially, +# named "org.kde.krunner" to follow naming pattern for QML plugins from KF modules +if(NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND + EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.0.0) + # deprecated plugin org.kde.runnermodel, no users known + add_subdirectory(declarative) +endif() set (KF5Runner_SRCS abstractrunner.cpp @@ -25,7 +31,7 @@ GROUP_BASE_NAME KF VERSION ${KF5_VERSION} DEPRECATED_BASE_VERSION 0 - DEPRECATION_VERSIONS 5.28 5.71 + DEPRECATION_VERSIONS 5.28 5.71 5.72 EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} ) @@ -124,6 +130,7 @@ "KRUNNER_DEPRECATED_VERSION(x, y, t)" "KRUNNER_DEPRECATED_VERSION_BELATED(x, y, xt, yt, t)" PREDEFINED_MACROS + "KSERVICE_BUILD_DEPRECATED_SINCE(x, y)=1" "PLASMA_ENABLE_DEPRECATED_SINCE(x, y)=1" TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/src/abstractrunner.cpp new/krunner-5.72.0/src/abstractrunner.cpp --- old/krunner-5.71.0/src/abstractrunner.cpp 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/src/abstractrunner.cpp 2020-07-04 11:56:08.000000000 +0200 @@ -27,9 +27,7 @@ #include <QMutex> #include "krunner_debug.h" -#include <kplugininfo.h> #include <ksharedconfig.h> -#include <kservicetypetrader.h> #include <klocalizedstring.h> #if KRUNNER_BUILD_DEPRECATED_SINCE(5, 65) #include <Plasma/Package> @@ -49,22 +47,47 @@ d->init(path); } +AbstractRunner::AbstractRunner(const KPluginMetaData &pluginMetaData, QObject *parent) + : QObject(parent), + d(new AbstractRunnerPrivate(this)) +{ + d->init(pluginMetaData); +} + +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) AbstractRunner::AbstractRunner(const KService::Ptr service, QObject *parent) : QObject(parent), d(new AbstractRunnerPrivate(this)) { d->init(service); } +#endif AbstractRunner::AbstractRunner(QObject *parent, const QVariantList &args) : QObject(parent), d(new AbstractRunnerPrivate(this)) { if (!args.isEmpty()) { +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) + // backward-compatible support has metadata only as second argument + // which we prefer of course + if (args.size() > 1) { + const KPluginMetaData metaData = args[1].value<KPluginMetaData>(); +#else + const KPluginMetaData metaData = args[0].value<KPluginMetaData>(); +#endif + if (metaData.isValid()) { + d->init(metaData); + return; + } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) + } + KService::Ptr service = KService::serviceByStorageId(args[0].toString()); if (service) { d->init(service); } +#endif } } @@ -302,7 +325,7 @@ QIcon AbstractRunner::icon() const { if (d->runnerDescription.isValid()) { - return QIcon::fromTheme(d->runnerDescription.icon()); + return QIcon::fromTheme(d->runnerDescription.iconName()); } return QIcon(); @@ -311,7 +334,7 @@ QString AbstractRunner::id() const { if (d->runnerDescription.isValid()) { - return d->runnerDescription.pluginName(); + return d->runnerDescription.pluginId(); } return objectName(); @@ -320,14 +343,21 @@ QString AbstractRunner::description() const { if (d->runnerDescription.isValid()) { - return d->runnerDescription.property(QStringLiteral("Comment")).toString(); + return d->runnerDescription.description(); } return objectName(); } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) KPluginInfo AbstractRunner::metadata() const { + return KPluginInfo::fromMetaData(d->runnerDescription); +} +#endif + +KPluginMetaData AbstractRunner::metadata(RunnerReturnPluginMetaDataConstant) const +{ return d->runnerDescription; } @@ -383,19 +413,27 @@ { } +void AbstractRunnerPrivate::init(const KPluginMetaData &pluginMetaData) +{ + runnerDescription = pluginMetaData; +} + +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) void AbstractRunnerPrivate::init(const KService::Ptr service) { QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations") QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations") - runnerDescription = KPluginInfo(service); + const KPluginInfo pluginInfo(service); + runnerDescription = pluginInfo.isValid() ? pluginInfo.toMetaData() : KPluginMetaData(); QT_WARNING_POP } +#endif void AbstractRunnerPrivate::init(const QString &path) { - runnerDescription = KPluginInfo(path + QStringLiteral("/metadata.desktop")); - const QString api = runnerDescription.property(QStringLiteral("X-Plasma-API")).toString(); + runnerDescription = KPluginMetaData(path + QStringLiteral("/metadata.desktop")); + const QString api = runnerDescription.value(QStringLiteral("X-Plasma-API")); } } // Plasma namespace diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/src/abstractrunner.h new/krunner-5.72.0/src/abstractrunner.h --- old/krunner-5.71.0/src/abstractrunner.h 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/src/abstractrunner.h 2020-07-04 11:56:08.000000000 +0200 @@ -27,6 +27,7 @@ #include <kconfiggroup.h> #include <kservice.h> #include <kplugininfo.h> +#include <kpluginmetadata.h> #include "krunner_export.h" #include "querymatch.h" @@ -46,6 +47,8 @@ class QueryMatch; class AbstractRunnerPrivate; +enum RunnerReturnPluginMetaDataConstant { RunnerReturnPluginMetaData }; // KF6: remove again + /** * @class AbstractRunner abstractrunner.h <KRunner/AbstractRunner> * @@ -240,12 +243,36 @@ */ QString description() const; +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 72) /** * @return the plugin info for this runner + * @deprecated since 5.72, use metaData(Plasma::RunnerReturnPluginMetaDataConstant) instead, see its API docs */ + KRUNNER_DEPRECATED_VERSION(5, 72, "Use metaData(Plasma::RunnerReturnPluginMetaDataConstant) instead, see its API docs") KPluginInfo metadata() const; +#endif /** + * @return the plugin metadata for this runner + * + * Overload to get non-deprecated metadata format. Use like this: + * @code + * KPluginMetaData md = runner->metadata(Plasma::RunnerReturnPluginMetaData); + * @endcode + * If you disable the deprecated version using the KRUNNER_DISABLE_DEPRECATED_BEFORE_AND_AT macro, + * then you can omit Plasma::RunnerReturnPluginMetaDataConstant and use it like this: + * @code + * KPluginMetaData md = runner->metadata(); + * @endcode + * + * @since 5.72 + */ +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 72) + KPluginMetaData metadata(RunnerReturnPluginMetaDataConstant) const; +#else + KPluginMetaData metadata(RunnerReturnPluginMetaDataConstant = RunnerReturnPluginMetaData) const; +#endif + /** * @return the icon for this Runner */ QIcon icon() const; @@ -323,7 +350,15 @@ friend class RunnerManagerPrivate; explicit AbstractRunner(QObject *parent = nullptr, const QString &path = QString()); +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 72) +#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) + /// @deprecated Since 5.72, use AbstractRunner(const KPluginMetaData &, QObject *) + KRUNNER_DEPRECATED_VERSION(5, 72, "use AbstractRunner(const KPluginMetaData &, QObject *)") explicit AbstractRunner(const KService::Ptr service, QObject *parent = nullptr); +#endif +#endif + /// @since 5.72 + explicit AbstractRunner(const KPluginMetaData &pluginMetaData, QObject *parent = nullptr); AbstractRunner(QObject *parent, const QVariantList &args); @@ -494,9 +529,45 @@ } // Plasma namespace + +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 72) +// Boilerplate to emit a version-controlled warning about the deprecated macro at leats with GCC +#if KRUNNER_DEPRECATED_WARNINGS_SINCE >= 0x054800 // 5.72.0 +# if defined(__GNUC__) +# define K_EXPORT_PLASMA_RUNNER_DO_PRAGMA(x) _Pragma (#x) +# define K_EXPORT_PLASMA_RUNNER_WARNING(x) K_EXPORT_PLASMA_RUNNER_DO_PRAGMA(message(#x)) +# else +# define K_EXPORT_PLASMA_RUNNER_WARNING(x) +# endif +#else +# define K_EXPORT_PLASMA_RUNNER_WARNING(x) +#endif +/** + * @relates Plasma::AbstractRunner + * + * Registers a runner plugin. + * + * @deprecated Since 5.72, use K_EXPORT_PLASMA_RUNNER_WITH_JSON(classname, jsonFile) instead + */ #define K_EXPORT_PLASMA_RUNNER( libname, classname ) \ +K_EXPORT_PLASMA_RUNNER_WARNING("Deprecated. Since 5.72, use K_EXPORT_PLASMA_RUNNER_WITH_JSON(classname, jsonFile) instead") \ K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \ K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) +#endif + +/** + * @relates Plasma::AbstractRunner + * + * Registers a runner plugin with JSON metadata. + * + * @param classname name of the AbstractRunner derived class. + * @param jsonFile name of the JSON file to be compiled into the plugin as metadata + * + * @since 5.72 + */ +#define K_EXPORT_PLASMA_RUNNER_WITH_JSON(classname, jsonFile) \ + K_PLUGIN_FACTORY_WITH_JSON(classname ## Factory, jsonFile, registerPlugin<classname>();) \ + K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) /** * These plugins are Used by the plugin selector dialog to show diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/src/abstractrunner_p.h new/krunner-5.72.0/src/abstractrunner_p.h --- old/krunner-5.71.0/src/abstractrunner_p.h 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/src/abstractrunner_p.h 2020-07-04 11:56:08.000000000 +0200 @@ -22,6 +22,8 @@ #include <QReadWriteLock> +#include <KPluginMetaData> + #include "plasma/dataengineconsumer.h" namespace Plasma @@ -34,13 +36,16 @@ public: AbstractRunnerPrivate(AbstractRunner *r); ~AbstractRunnerPrivate(); + void init(const KPluginMetaData &pluginMetaData); +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) void init(const KService::Ptr service); +#endif void init(const QString &path); AbstractRunner::Priority priority; AbstractRunner::Speed speed; RunnerContext::Types blackListed; - KPluginInfo runnerDescription; + KPluginMetaData runnerDescription; AbstractRunner *runner; int fastRuns; QReadWriteLock speedLock; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/src/dbusrunner.cpp new/krunner-5.72.0/src/dbusrunner.cpp --- old/krunner-5.71.0/src/dbusrunner.cpp 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/src/dbusrunner.cpp 2020-07-04 11:56:08.000000000 +0200 @@ -33,8 +33,8 @@ #define IFACE_NAME "org.kde.krunner1" -DBusRunner::DBusRunner(const KService::Ptr service, QObject *parent) - : Plasma::AbstractRunner(service, parent) +DBusRunner::DBusRunner(const KPluginMetaData &pluginMetaData, QObject *parent) + : Plasma::AbstractRunner(pluginMetaData, parent) , m_mutex(QMutex::NonRecursive) { qDBusRegisterMetaType<RemoteMatch>(); @@ -42,11 +42,11 @@ qDBusRegisterMetaType<RemoteAction>(); qDBusRegisterMetaType<RemoteActions>(); - QString requestedServiceName = service->property(QStringLiteral("X-Plasma-DBusRunner-Service")).toString(); - m_path = service->property(QStringLiteral("X-Plasma-DBusRunner-Path")).toString(); + QString requestedServiceName = pluginMetaData.value(QStringLiteral("X-Plasma-DBusRunner-Service")); + m_path = pluginMetaData.value(QStringLiteral("X-Plasma-DBusRunner-Path")); if (requestedServiceName.isEmpty() || m_path.isEmpty()) { - qCWarning(KRUNNER) << "Invalid entry:" << service->name(); + qCWarning(KRUNNER) << "Invalid entry:" << pluginMetaData.name(); return; } @@ -84,7 +84,7 @@ //don't check when not wildcarded, as it could be used with DBus-activation m_matchingServices << requestedServiceName; } - if (service->property(QStringLiteral("X-Plasma-Request-Actions-Once")).toBool()) { + if (pluginMetaData.rawData().value(QStringLiteral("X-Plasma-Request-Actions-Once")).toVariant().toBool()) { requestActions(); } else { connect(this, &AbstractRunner::prepare, this, &DBusRunner::requestActions); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/src/dbusrunner_p.h new/krunner-5.72.0/src/dbusrunner_p.h --- old/krunner-5.71.0/src/dbusrunner_p.h 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/src/dbusrunner_p.h 2020-07-04 11:56:08.000000000 +0200 @@ -32,7 +32,7 @@ Q_OBJECT public: - explicit DBusRunner(const KService::Ptr service, QObject *parent = nullptr); + explicit DBusRunner(const KPluginMetaData &pluginMetaData, QObject *parent = nullptr); ~DBusRunner() override; void match(Plasma::RunnerContext &context) override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/src/declarative/runnermodelplugin.cpp new/krunner-5.72.0/src/declarative/runnermodelplugin.cpp --- old/krunner-5.71.0/src/declarative/runnermodelplugin.cpp 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/src/declarative/runnermodelplugin.cpp 2020-07-04 11:56:08.000000000 +0200 @@ -32,7 +32,16 @@ qCWarning(KRUNNER) << "Using deprecated import org.kde.runnermodel, please port to org.kde.plasma.core"; Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.runnermodel")); qmlRegisterType<RunnerModel>(uri, 2, 0, "RunnerModel"); + // to port this to Qt5.15-non-deprecated variant + // qmlRegisterInterface<Plasma::QueryMatch>(uri, 1); + // QueryMatch would need to get a Q_GAGDET added just for this + // As this plugin is deprecated, this is not worth it, + // so we just disable the deprecation warning +QT_WARNING_PUSH +QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations") +QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations") qmlRegisterInterface<Plasma::QueryMatch>("QueryMatch"); +QT_WARNING_POP qRegisterMetaType<Plasma::QueryMatch *>("QueryMatch"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/src/runnermanager.cpp new/krunner-5.72.0/src/runnermanager.cpp --- old/krunner-5.71.0/src/runnermanager.cpp 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/src/runnermanager.cpp 2020-07-04 11:56:08.000000000 +0200 @@ -24,12 +24,14 @@ #include <QElapsedTimer> #include <QTimer> #include <QCoreApplication> -#include <qstandardpaths.h> +#include <QStandardPaths> +#include <QDir> #include "krunner_debug.h" #include <ksharedconfig.h> #include <kplugininfo.h> #include <kservicetypetrader.h> +#include <KPluginMetaData> #include <ThreadWeaver/DebuggingAids> #include <ThreadWeaver/Queue> @@ -49,6 +51,39 @@ namespace Plasma { +void forEachDBusPlugin(std::function<void(const KPluginMetaData &, bool *)> callback) +{ + const QStringList dBusPlugindirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("krunner/dbusplugins"), QStandardPaths::LocateDirectory); + const QStringList serviceTypeFiles(QStringLiteral("plasma-runner.desktop")); + for (const QString &dir : dBusPlugindirs) { + const QStringList desktopFiles = QDir(dir).entryList(QStringList(QStringLiteral("*.desktop"))); + for (const QString &file : desktopFiles) { + const QString desktopFilePath = dir + QLatin1Char('/') + file; + KPluginMetaData pluginMetaData = KPluginMetaData::fromDesktopFile(desktopFilePath, serviceTypeFiles); + if (pluginMetaData.isValid()) { + bool cancel = false; + callback(pluginMetaData, &cancel); + if (cancel) { + return; + } + } + } + } +} + +#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) +void warnAboutDeprecatedMetaData(const KPluginInfo &pluginInfo) +{ + if (!pluginInfo.libraryPath().isEmpty()) { + qCWarning(KRUNNER).nospace() << "KRunner plugin " << pluginInfo.pluginName() << " still uses a .desktop file (" + << pluginInfo.entryPath() << "). Please port it to JSON metadata."; + } else { + qCWarning(KRUNNER).nospace() << "KRunner D-Bus plugin " << pluginInfo.pluginName() << " installs the .desktop file (" + << pluginInfo.entryPath() << ") still in the kservices5 folder. Please install it to ${KDE_INSTALL_DATAROOTDIR}/krunner/dbusplugins."; + } +} +#endif + /***************************************************** * RunnerManager::Private class * @@ -149,10 +184,38 @@ return; } - KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"), QStringLiteral("[X-KDE-PluginInfo-Name] == '%1'").arg(singleModeRunnerId)); - if (!offers.isEmpty()) { - const KService::Ptr &service = offers[0]; - currentSingleRunner = loadInstalledRunner(service); + KPluginMetaData pluginMetaData; + // binary plugins + const auto plugins = KPluginLoader::findPluginsById(QStringLiteral("kf5/krunner"), singleModeRunnerId); + if (!plugins.isEmpty()) { + pluginMetaData = plugins[0]; + } else { + // get D-Bus plugins + forEachDBusPlugin([&](const KPluginMetaData &md, bool *cancel) { + if (md.pluginId() == singleModeRunnerId) { + pluginMetaData = md; + *cancel = true; + } + }); + } + +#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) + // also search for deprecated kservice-based KRunner plugins metadata + if (!pluginMetaData.isValid()) { + const KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"), QStringLiteral("[X-KDE-PluginInfo-Name] == '%1'").arg(singleModeRunnerId)); + if (!offers.isEmpty()) { +QT_WARNING_PUSH +QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations") +QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations") + const KPluginInfo pluginInfo(offers[0]); + warnAboutDeprecatedMetaData(pluginInfo); + pluginMetaData = pluginInfo.toMetaData(); +QT_WARNING_POP + } + } +#endif + if (pluginMetaData.isValid()) { + currentSingleRunner = loadInstalledRunner(pluginMetaData); if (currentSingleRunner) { emit currentSingleRunner->prepare(); @@ -164,7 +227,7 @@ void loadRunners() { KConfigGroup config = configGroup(); - KPluginInfo::List offers = RunnerManager::listRunnerInfo(); + QVector<KPluginMetaData> offers = RunnerManager::runnerMetaDataList(); const bool loadAll = config.readEntry("loadAll", false); const bool noWhiteList = whiteList.isEmpty(); @@ -179,24 +242,23 @@ QStringList allCategories; QSet<AbstractRunner *> deadRunners; - QMutableListIterator<KPluginInfo> it(offers); + QMutableVectorIterator<KPluginMetaData> it(offers); while (it.hasNext()) { - KPluginInfo &description = it.next(); - qCDebug(KRUNNER) << "Loading runner: " << description.pluginName(); + KPluginMetaData &description = it.next(); + qCDebug(KRUNNER) << "Loading runner: " << description.pluginId(); - QString tryExec = description.property(QStringLiteral("TryExec")).toString(); + const QString tryExec = description.value(QStringLiteral("TryExec")); if (!tryExec.isEmpty() && QStandardPaths::findExecutable(tryExec).isEmpty()) { // we don't actually have this application! continue; } - const QString runnerName = description.pluginName(); - description.load(pluginConf); - + const QString runnerName = description.pluginId(); + const bool isPluginEnabled = pluginConf.readEntry(runnerName + QLatin1String("Enabled"), description.isEnabledByDefault()); const bool loaded = runners.contains(runnerName); - const bool selected = loadAll || (description.isPluginEnabled() && (noWhiteList || whiteList.contains(runnerName))); + const bool selected = loadAll || (isPluginEnabled && (noWhiteList || whiteList.contains(runnerName))); - const bool singleQueryModeEnabled = description.property(QStringLiteral("X-Plasma-AdvertiseSingleRunnerQueryMode")).toBool(); + const bool singleQueryModeEnabled = description.rawData().value(QStringLiteral("X-Plasma-AdvertiseSingleRunnerQueryMode")).toVariant().toBool(); if (singleQueryModeEnabled) { advertiseSingleRunnerIds.insert(runnerName, description.name()); @@ -205,11 +267,7 @@ if (selected) { AbstractRunner *runner = nullptr; if (!loaded) { -QT_WARNING_PUSH -QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations") -QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations") - runner = loadInstalledRunner(description.service()); -QT_WARNING_POP + runner = loadInstalledRunner(description); } else { runner = runners.value(runnerName); runner->reloadConfiguration(); @@ -289,43 +347,53 @@ #endif } - AbstractRunner *loadInstalledRunner(const KService::Ptr service) + AbstractRunner *loadInstalledRunner(const KPluginMetaData &pluginMetaData) { - if (!service) { + if (!pluginMetaData.isValid()) { return nullptr; } AbstractRunner *runner = nullptr; - const QString api = service->property(QStringLiteral("X-Plasma-API")).toString(); + const QString api = pluginMetaData.value(QStringLiteral("X-Plasma-API")); if (api.isEmpty()) { - QVariantList args; - args << service->storageId(); - const quint64 pluginVersion = KPluginLoader(*service).pluginVersion(); + KPluginLoader pluginLoader(pluginMetaData.fileName()); + const quint64 pluginVersion = pluginLoader.pluginVersion(); if (Plasma::isPluginVersionCompatible(pluginVersion)) { - QString error; - runner = service->createInstance<AbstractRunner>(q, args, &error); - if (!runner) { + KPluginFactory *factory = pluginLoader.factory(); + if (factory) { + const QVariantList args { +#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) + pluginMetaData.metaDataFileName(), +#endif + QVariant::fromValue(pluginMetaData), + }; + runner = factory->create<AbstractRunner>(q, args); + if (!runner) { #ifndef NDEBUG - // qCDebug(KRUNNER) << "Failed to load runner:" << service->name() << ". error reported:" << error; + // qCDebug(KRUNNER) << "Failed to load runner:" << pluginInfo.name() << ". error reported:" << pluginLoader.errorString(); #endif + } + } else { + qCWarning(KRUNNER).nospace() << "Could not load runner " << pluginMetaData.name() << ":" + << pluginLoader.errorString() << " (library path was:" << pluginMetaData.fileName() << ")"; } } else { const QString runnerVersion = QStringLiteral("%1.%2.%3").arg(pluginVersion >> 16).arg((pluginVersion >> 8) & 0x00ff).arg(pluginVersion & 0x0000ff); - qCWarning(KRUNNER) << "Cannot load runner" << service->name() <<"- versions mismatch: KRunner" - << Plasma::versionString()<< "," << service->name() << runnerVersion; + qCWarning(KRUNNER) << "Cannot load runner" << pluginMetaData.name() <<"- versions mismatch: KRunner" + << Plasma::versionString()<< "," << pluginMetaData.name() << runnerVersion; } } else if (api == QLatin1String("DBus")){ - runner = new DBusRunner(service, q); + runner = new DBusRunner(pluginMetaData, q); } else { //qCDebug(KRUNNER) << "got a script runner known as" << api; - runner = new AbstractRunner(service, q); + runner = new AbstractRunner(pluginMetaData, q); } if (runner) { #ifndef NDEBUG - // qCDebug(KRUNNER) << "================= loading runner:" << service->name() << "================="; + // qCDebug(KRUNNER) << "================= loading runner:" << pluginInfo.name() << "================="; #endif QObject::connect(runner, SIGNAL(matchingSuspended(bool)), q, SLOT(runnerMatchingSuspended(bool))); runner->init(); @@ -361,6 +429,9 @@ // ourselves here emit q->matchesChanged(context.matches()); } + if (searchJobs.isEmpty()) { + emit q->queryFinished(); + } } void checkTearDown() @@ -393,8 +464,6 @@ singleRunnerPrepped = false; } - emit q->queryFinished(); - prepped = false; teardownRequested = false; } @@ -543,6 +612,7 @@ return list; } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) void RunnerManager::loadRunner(const KService::Ptr service) { QT_WARNING_PUSH @@ -550,9 +620,15 @@ QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations") KPluginInfo description(service); QT_WARNING_POP - const QString runnerName = description.pluginName(); + loadRunner(description.toMetaData()); +} +#endif + +void RunnerManager::loadRunner(const KPluginMetaData &pluginMetaData) +{ + const QString runnerName = pluginMetaData.pluginId(); if (!runnerName.isEmpty() && !d->runners.contains(runnerName)) { - AbstractRunner *runner = d->loadInstalledRunner(service); + AbstractRunner *runner = d->loadInstalledRunner(pluginMetaData); if (runner) { d->runners.insert(runnerName, runner); } @@ -708,22 +784,57 @@ return nullptr; } -KPluginInfo::List RunnerManager::listRunnerInfo(const QString &parentApp) +QVector<KPluginMetaData> RunnerManager::runnerMetaDataList(const QString &parentApp) { - QString constraint; - if (parentApp.isEmpty()) { - constraint.append(QStringLiteral("not exist [X-KDE-ParentApp]")); - } else { - constraint.append(QStringLiteral("[X-KDE-ParentApp] == '")).append(parentApp).append(QLatin1Char('\'')); - } + // get binary plugins + // filter rule also covers parentApp.isEmpty() + auto filterParentApp = [&parentApp](const KPluginMetaData &md) -> bool { + return md.value(QStringLiteral("X-KDE-ParentApp")) == parentApp; + }; + + QVector<KPluginMetaData> pluginMetaDatas = KPluginLoader::findPlugins(QStringLiteral("kf5/krunner"), filterParentApp); + QSet<QString> knownRunnerIds; + knownRunnerIds.reserve(pluginMetaDatas.size()); + for (const KPluginMetaData &pluginMetaData : qAsConst(pluginMetaDatas)) { + knownRunnerIds.insert(pluginMetaData.pluginId()); + } + + // get D-Bus plugins + forEachDBusPlugin([&](const KPluginMetaData &pluginMetaData, bool *) { + pluginMetaDatas.append(pluginMetaData); + knownRunnerIds.insert(pluginMetaData.pluginId()); + }); + +#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) + // also search for deprecated kservice-based KRunner plugins metadata + const QString constraint = parentApp.isEmpty() ? + QStringLiteral("not exist [X-KDE-ParentApp] or [X-KDE-ParentApp] == ''") : + QStringLiteral("[X-KDE-ParentApp] == '") + parentApp + QLatin1Char('\''); - KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"), constraint); + const KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"), constraint); QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations") QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations") - return KPluginInfo::fromServices(offers); + const KPluginInfo::List backwardCompatPluginInfos = KPluginInfo::fromServices(offers); QT_WARNING_POP + + for (const KPluginInfo &pluginInfo : backwardCompatPluginInfos) { + if (!knownRunnerIds.contains(pluginInfo.pluginName())) { + warnAboutDeprecatedMetaData(pluginInfo); + pluginMetaDatas.append(pluginInfo.toMetaData()); + } + } +#endif + + return pluginMetaDatas; +} + +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) +KPluginInfo::List RunnerManager::listRunnerInfo(const QString &parentApp) +{ + return KPluginInfo::fromMetaData(runnerMetaDataList(parentApp)); } +#endif void RunnerManager::setupMatchSession() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/src/runnermanager.h new/krunner-5.72.0/src/runnermanager.h --- old/krunner-5.71.0/src/runnermanager.h 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/src/runnermanager.h 2020-07-04 11:56:08.000000000 +0200 @@ -26,6 +26,7 @@ #include <QObject> #include <kplugininfo.h> +#include <kpluginmetadata.h> #include "krunner_export.h" #include "abstractrunner.h" @@ -171,6 +172,8 @@ */ void setEnabledCategories(const QStringList &categories); +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 72) +#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) /** * Attempts to add the AbstractRunner plugin represented * by the KService passed in. Usually one can simply let @@ -180,8 +183,24 @@ * * @param service the service to use to load the plugin * @since 4.5 + * @deprecated Since 5.72, use loadRunner(const KPluginMetaData &) */ + KRUNNER_DEPRECATED_VERSION(5, 72, "use loadRunner(const KPluginMetaData &)") void loadRunner(const KService::Ptr service); +#endif +#endif + + /** + * Attempts to add the AbstractRunner plugin represented + * by the plugin info passed in. Usually one can simply let + * the configuration of plugins handle loading Runner plugins, + * but in cases where specific runners should be loaded this + * allows for that to take place + * + * @param pluginMetaData the metaData to use to load the plugin + * @since 5.72 + */ + void loadRunner(const KPluginMetaData &pluginMetaData); /** * Attempts to add the AbstractRunner from a Plasma::Package on disk. @@ -220,6 +239,20 @@ /** * Returns a list of all known Runner implementations * + * @param parentApp the application to filter runners on. Uses the + * X-KDE-ParentApp entry (if any) in the plugin metadata. + * The default value of QString() will result in a + * list containing only runners not specifically + * registered to an application. + * @return list of metadata of known runners + * @since 5.72 + **/ + static QVector<KPluginMetaData> runnerMetaDataList(const QString &parentApp = QString()); + +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 72) + /** + * Returns a list of all known Runner implementations + * * @param parentApp the application to filter applets on. Uses the * X-KDE-ParentApp entry (if any) in the plugin info. * The default value of QString() will result in a @@ -227,8 +260,11 @@ * registered to an application. * @return list of AbstractRunners * @since 4.6 + * @deprecated since 5.72, use runnerMetaDataList() instead **/ + KRUNNER_DEPRECATED_VERSION(5, 72, "Use runnerMetaDataList() instead") static KPluginInfo::List listRunnerInfo(const QString &parentApp = QString()); +#endif public Q_SLOTS: /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/templates/runner/CMakeLists.txt new/krunner-5.72.0/templates/runner/CMakeLists.txt --- old/krunner-5.71.0/templates/runner/CMakeLists.txt 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/templates/runner/CMakeLists.txt 2020-07-04 11:56:08.000000000 +0200 @@ -2,8 +2,8 @@ project(%{APPNAMELC}) -set(QT_MIN_VERSION "5.9.0") -set(KF5_MIN_VERSION "5.42.0") +set(QT_MIN_VERSION "5.12.0") +set(KF5_MIN_VERSION "5.72.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/templates/runner/src/%{APPNAMELC}.cpp new/krunner-5.72.0/templates/runner/src/%{APPNAMELC}.cpp --- old/krunner-5.71.0/templates/runner/src/%{APPNAMELC}.cpp 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/templates/runner/src/%{APPNAMELC}.cpp 2020-07-04 11:56:08.000000000 +0200 @@ -38,7 +38,7 @@ // TODO } -K_EXPORT_PLASMA_RUNNER(%{APPNAMELC}, %{APPNAME}) +K_EXPORT_PLASMA_RUNNER_WITH_JSON(%{APPNAME}, "plasma-runner-%{APPNAMELC}.json") -// needed for the QObject subclass declared as part of K_EXPORT_PLASMA_RUNNER +// needed for the QObject subclass declared as part of K_EXPORT_PLASMA_RUNNER_WITH_JSON #include "%{APPNAMELC}.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/templates/runner/src/CMakeLists.txt new/krunner-5.72.0/templates/runner/src/CMakeLists.txt --- old/krunner-5.71.0/templates/runner/src/CMakeLists.txt 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/templates/runner/src/CMakeLists.txt 2020-07-04 11:56:08.000000000 +0200 @@ -2,9 +2,10 @@ set(%{APPNAMELC}_SRCS %{APPNAMELC}.cpp) -add_library(krunner_%{APPNAMELC} MODULE ${%{APPNAMELC}_SRCS}) -target_link_libraries(krunner_%{APPNAMELC} KF5::Runner KF5::I18n) +add_library(%{APPNAMELC} MODULE ${%{APPNAMELC}_SRCS}) +kcoreaddons_desktop_to_json(%{APPNAMELC} plasma-runner-%{APPNAMELC}.desktop) +target_link_libraries(%{APPNAMELC} KF5::Runner KF5::I18n) -install(TARGETS krunner_%{APPNAMELC} DESTINATION ${KDE_INSTALL_PLUGINDIR}) +install(TARGETS %{APPNAMELC} DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/krunner) install(FILES plasma-runner-%{APPNAMELC}.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.71.0/templates/runner/src/plasma-runner-%{APPNAMELC}.desktop new/krunner-5.72.0/templates/runner/src/plasma-runner-%{APPNAMELC}.desktop --- old/krunner-5.71.0/templates/runner/src/plasma-runner-%{APPNAMELC}.desktop 2020-06-06 21:35:43.000000000 +0200 +++ new/krunner-5.72.0/templates/runner/src/plasma-runner-%{APPNAMELC}.desktop 2020-07-04 11:56:08.000000000 +0200 @@ -5,7 +5,7 @@ X-KDE-ServiceTypes=Plasma/Runner Type=Service -X-KDE-Library=krunner_%{APPNAMELC} + X-KDE-PluginInfo-Author=%{AUTHOR} X-KDE-PluginInfo-Email=%{EMAIL} X-KDE-PluginInfo-Name=%{APPNAMELC}