Hello community, here is the log from the commit of package krunner for openSUSE:Factory checked in at 2017-09-19 16:26:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/krunner (Old) and /work/SRC/openSUSE:Factory/.krunner.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "krunner" Tue Sep 19 16:26:33 2017 rev:43 rq:526670 version:5.38.0 Changes: -------- --- /work/SRC/openSUSE:Factory/krunner/krunner.changes 2017-08-24 17:58:11.235507756 +0200 +++ /work/SRC/openSUSE:Factory/.krunner.new/krunner.changes 2017-09-19 16:26:34.564278796 +0200 @@ -1,0 +2,12 @@ +Tue Sep 12 07:11:18 CEST 2017 - [email protected] + +- Update to 5.38.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.38.0.php +- Changes since 5.37.0: + * Clear previous actions on update + * Use QUrls from match to create mimeData in base implementation + * Add remote runners over DBus + +------------------------------------------------------------------- Old: ---- krunner-5.37.0.tar.xz New: ---- krunner-5.38.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ krunner.spec ++++++ --- /var/tmp/diff_new_pack.PllteF/_old 2017-09-19 16:26:35.072206819 +0200 +++ /var/tmp/diff_new_pack.PllteF/_new 2017-09-19 16:26:35.076206252 +0200 @@ -17,24 +17,28 @@ %define lname libKF5Runner5 -%define _tar_path 5.37 +%define _tar_path 5.38 +# 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: %global _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} Name: krunner -Version: 5.37.0 +Version: 5.38.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 3.0 -BuildRequires: extra-cmake-modules >= %{_tar_path} +BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: fdupes -BuildRequires: kconfig-devel >= %{_tar_path} -BuildRequires: kcoreaddons-devel >= %{_tar_path} +BuildRequires: kconfig-devel >= %{_kf5_bugfix_version} +BuildRequires: kcoreaddons-devel >= %{_kf5_bugfix_version} BuildRequires: kf5-filesystem -BuildRequires: ki18n-devel >= %{_tar_path} -BuildRequires: kio-devel >= %{_tar_path} -BuildRequires: kservice-devel >= %{_tar_path} -BuildRequires: kwindowsystem-devel >= %{_tar_path} -BuildRequires: plasma-framework-devel >= %{_tar_path} -BuildRequires: solid-devel >= %{_tar_path} -BuildRequires: threadweaver-devel >= %{_tar_path} +BuildRequires: ki18n-devel >= %{_kf5_bugfix_version} +BuildRequires: kio-devel >= %{_kf5_bugfix_version} +BuildRequires: kservice-devel >= %{_kf5_bugfix_version} +BuildRequires: kwindowsystem-devel >= %{_kf5_bugfix_version} +BuildRequires: plasma-framework-devel >= %{_kf5_bugfix_version} +BuildRequires: solid-devel >= %{_kf5_bugfix_version} +BuildRequires: threadweaver-devel >= %{_kf5_bugfix_version} BuildRequires: cmake(Qt5Gui) >= 5.6.0 BuildRequires: cmake(Qt5Quick) >= 5.6.0 BuildRequires: cmake(Qt5Test) >= 5.6.0 @@ -69,7 +73,7 @@ Group: Development/Libraries/KDE Requires: %lname = %{version} Requires: extra-cmake-modules -Requires: plasma-framework-devel >= %{_tar_path} +Requires: plasma-framework-devel >= %{_kf5_bugfix_version} Requires: cmake(Qt5Core) >= 5.6.0 Conflicts: kapptemplate <= 16.03.80 @@ -113,5 +117,6 @@ %{_kf5_includedir}/*.h %{_kf5_mkspecsdir}/qt_KRunner.pri %{_kf5_sharedir}/kdevappwizard +%{_kf5_dbusinterfacesdir}/kf5_org.kde.krunner1.xml %changelog ++++++ krunner-5.37.0.tar.xz -> krunner-5.38.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/CMakeLists.txt new/krunner-5.38.0/CMakeLists.txt --- old/krunner-5.37.0/CMakeLists.txt 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/CMakeLists.txt 2017-09-03 10:13:37.000000000 +0200 @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.0) -set(KF5_VERSION "5.37.0") # handled by release scripts -set(KF5_DEP_VERSION "5.37.0") # handled by release scripts +set(KF5_VERSION "5.38.0") # handled by release scripts +set(KF5_DEP_VERSION "5.38.0") # handled by release scripts project(KRunner VERSION ${KF5_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.37.0 NO_MODULE) +find_package(ECM 5.38.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/autotests/CMakeLists.txt new/krunner-5.38.0/autotests/CMakeLists.txt --- old/krunner-5.37.0/autotests/CMakeLists.txt 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/autotests/CMakeLists.txt 2017-09-03 10:13:37.000000000 +0200 @@ -6,3 +6,16 @@ runnercontexttest.cpp LINK_LIBRARIES Qt5::Test KF5::KIOCore KF5Runner ) + +ecm_add_tests( + dbusrunnertest.cpp + LINK_LIBRARIES Qt5::Test KF5::KIOCore KF5Runner Qt5::Widgets +) + +set(demoapp_SRCS testremoterunner.cpp) +qt5_add_dbus_adaptor(demoapp_SRCS "../src/data/org.kde.krunner1.xml" testremoterunner.h TestRemoteRunner) +add_executable(testremoterunner ${demoapp_SRCS}) +target_link_libraries(testremoterunner + Qt5::DBus + KF5::Runner +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/autotests/dbusrunnertest.cpp new/krunner-5.38.0/autotests/dbusrunnertest.cpp --- old/krunner-5.37.0/autotests/dbusrunnertest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.38.0/autotests/dbusrunnertest.cpp 2017-09-03 10:13:37.000000000 +0200 @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2017 David Edmundson <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License version 2 as + * published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <QObject> +#include <QAction> +#include <QtTest/QtTest> + +#include "runnermanager.h" +#include <QSignalSpy> +#include <QDebug> +#include <QProcess> + +#include <KSycoca> + +using namespace Plasma; + +Q_DECLARE_METATYPE(Plasma::QueryMatch); +Q_DECLARE_METATYPE(QList<Plasma::QueryMatch>); + +class DBusRunnerTest : public QObject +{ + Q_OBJECT +public: + DBusRunnerTest(); + ~DBusRunnerTest(); + +private Q_SLOTS: + void initTestCase(); + void testMatch(); +private: + QProcess *m_process; +}; + +DBusRunnerTest::DBusRunnerTest() + : QObject(), + m_process(new QProcess(this)) +{ + m_process->start(QFINDTESTDATA("testremoterunner")); + QVERIFY(m_process->waitForStarted()); + qRegisterMetaType<QList<Plasma::QueryMatch> >(); +} + +DBusRunnerTest::~DBusRunnerTest() +{ + m_process->kill(); + m_process->waitForFinished(); +} + +void DBusRunnerTest::initTestCase() +{ + QStandardPaths::setTestModeEnabled(true); + QDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)).mkpath("kservices5"); + const QString fakeServicePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/dbusrunnertest.desktop"); + QFile::copy(QFINDTESTDATA("dbusrunnertest.desktop"), fakeServicePath); + KSycoca::self()->ensureCacheValid(); +} + +void DBusRunnerTest::testMatch() +{ + RunnerManager m; + auto s = KService::serviceByDesktopPath("dbusrunnertest.desktop"); + QVERIFY(s); + m.loadRunner(s); + m.launchQuery("foo"); + + QSignalSpy spy(&m, &RunnerManager::matchesChanged); + QVERIFY(spy.wait()); + + //verify matches + QCOMPARE(m.matches().count(), 1); + auto result = m.matches().first(); + + //see testremoterunner.cpp + QCOMPARE(result.id(), QStringLiteral("dbusrunnertest_id1")); //note the runner name is prepended + QCOMPARE(result.text(), QStringLiteral("Match 1")); + QCOMPARE(result.iconName(), QStringLiteral("icon1")); + QCOMPARE(result.type(), Plasma::QueryMatch::ExactMatch); + //relevance can't be compared easily becuase RunnerContext meddles with it + + //verify actions + auto actions = m.actionsForMatch(result); + QCOMPARE(actions.count(), 1); + auto action = actions.first(); + + QCOMPARE(action->text(), QStringLiteral("Action 1")); + + QSignalSpy processSpy(m_process, &QProcess::readyRead); + m.run(result); + processSpy.wait(); + QCOMPARE(m_process->readAllStandardOutput().trimmed(), QByteArray("Running:id1:")); + + result.setSelectedAction(action); + m.run(result); + processSpy.wait(); + QCOMPARE(m_process->readAllStandardOutput().trimmed(), QByteArray("Running:id1:action1")); +} + + + +QTEST_MAIN(DBusRunnerTest) + + +#include "dbusrunnertest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/autotests/dbusrunnertest.desktop new/krunner-5.38.0/autotests/dbusrunnertest.desktop --- old/krunner-5.37.0/autotests/dbusrunnertest.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.38.0/autotests/dbusrunnertest.desktop 2017-09-03 10:13:37.000000000 +0200 @@ -0,0 +1,15 @@ +[Desktop Entry] +Name=DBus runner test +Comment=DBus runner test +X-KDE-ServiceTypes=Plasma/Runner +Type=Service +Icon=internet-web-browser +X-KDE-PluginInfo-Author=Some Developer [email protected] +X-KDE-PluginInfo-Name=dbusrunnertest +X-KDE-PluginInfo-Version=1.0 +X-KDE-PluginInfo-License=LGPL +X-KDE-PluginInfo-EnabledByDefault=true +X-Plasma-API=DBus +X-Plasma-DBusRunner-Service=net.dave +X-Plasma-DBusRunner-Path=/dave diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/autotests/testremoterunner.cpp new/krunner-5.38.0/autotests/testremoterunner.cpp --- old/krunner-5.37.0/autotests/testremoterunner.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.38.0/autotests/testremoterunner.cpp 2017-09-03 10:13:37.000000000 +0200 @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2017 David Edmundson <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License version 2 as + * published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <QCoreApplication> +#include <QDBusConnection> + +#include <iostream> + +#include "testremoterunner.h" +#include "krunner1adaptor.h" + +//Test DBus runner, if the search term contains "foo" it returns a match, otherwise nothing +//Run prints a line to stdout + +TestRemoteRunner::TestRemoteRunner() +{ + new Krunner1Adaptor(this); + qDBusRegisterMetaType<RemoteMatch>(); + qDBusRegisterMetaType<RemoteMatches>(); + qDBusRegisterMetaType<RemoteAction>(); + qDBusRegisterMetaType<RemoteActions>(); + QDBusConnection::sessionBus().registerService("net.dave"); + QDBusConnection::sessionBus().registerObject("/dave", this); +} + +RemoteMatches TestRemoteRunner::Match(const QString& searchTerm) +{ + RemoteMatches ms; + if (searchTerm.contains("foo")) { + RemoteMatch m; + m.id = "id1"; + m.text = "Match 1"; + m.iconName = "icon1"; + m.type = Plasma::QueryMatch::ExactMatch; + m.relevance = 0.8; + ms << m; + } + return ms; + +} + +RemoteActions TestRemoteRunner::Actions() +{ + RemoteAction action; + action.id = "action1"; + action.text = "Action 1"; + action.iconName = "document-browser"; + + return RemoteActions({action}); +} + +void TestRemoteRunner::Run(const QString &id, const QString &actionId) +{ + std::cout << "Running:" << qPrintable(id) << ":" << qPrintable(actionId) << std::endl; + std::cout.flush(); +} + +int main(int argc, char ** argv) +{ + QCoreApplication app(argc, argv); + TestRemoteRunner r; + app.exec(); +} + +#include "testremoterunner.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/autotests/testremoterunner.h new/krunner-5.38.0/autotests/testremoterunner.h --- old/krunner-5.37.0/autotests/testremoterunner.h 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.38.0/autotests/testremoterunner.h 2017-09-03 10:13:37.000000000 +0200 @@ -0,0 +1,16 @@ +#pragma once + +#include <QObject> +#include "../src/dbusutils_p.h" + +class TestRemoteRunner : public QObject +{ + Q_OBJECT +public: + TestRemoteRunner(); + +public Q_SLOTS: + RemoteActions Actions(); + RemoteMatches Match(const QString &searchTerm); + void Run(const QString &id, const QString &actionId); +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/examples/runner/plasma-runner-example-homefiles.desktop new/krunner-5.38.0/examples/runner/plasma-runner-example-homefiles.desktop --- old/krunner-5.37.0/examples/runner/plasma-runner-example-homefiles.desktop 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/examples/runner/plasma-runner-example-homefiles.desktop 2017-09-03 10:13:37.000000000 +0200 @@ -12,6 +12,7 @@ Name[en_GB]=Home Files Name[es]=Archivos personales Name[et]=Kodu failid +Name[eu]=Etxeko fitxategiak Name[fi]=Kodin tiedostot Name[fr]=Fichiers personnels Name[gd]=Faidhlichean dachaigh @@ -56,6 +57,7 @@ Comment[en_GB]=Part of a tutorial demonstrating how to create Runner plugins Comment[es]=Parte de un tutorial que demuestra cómo crear complementos de Runner Comment[et]=Õppematerjal käivitamispluginate loomise kohta +Comment[eu]=Runner pluginak nola sortu erakusten duen tutorial baten zatia Comment[fi]=Osa tutoriaalia, joka näyttää, miten suoritusohjelmaliitännäisiä tehdään Comment[fr]=Éléments d'un tutoriel montrant comment créer des modules « Runner » Comment[gd]=Seo pàirt dhe dh'oideachadh gus sealltainn dhut mar a chruthaicheas tu plugan Runner diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/po/gl/plasma_runner_example_homefiles.po new/krunner-5.38.0/po/gl/plasma_runner_example_homefiles.po --- old/krunner-5.37.0/po/gl/plasma_runner_example_homefiles.po 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/po/gl/plasma_runner_example_homefiles.po 2017-09-03 10:13:37.000000000 +0200 @@ -2,25 +2,26 @@ # This file is distributed under the same license as the PACKAGE package. # # Marce Villarino <[email protected]>, 2014. +# Adrián Chaves (Gallaecio) <[email protected]>, 2017. msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2016-11-19 20:12+0100\n" -"PO-Revision-Date: 2014-05-12 23:23+0200\n" -"Last-Translator: Marce Villarino <[email protected]>\n" +"PO-Revision-Date: 2017-08-13 09:20+0100\n" +"Last-Translator: Adrián Chaves (Gallaecio) <[email protected]>\n" "Language-Team: Galician <[email protected]>\n" "Language: gl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Lokalize 1.5\n" +"X-Generator: Lokalize 2.0\n" #: homefilesrunner.cpp:71 #, kde-format msgid "Finds files matching :q: in the %1 folder" -msgstr "Busca ficheiros que casen con :q: no cartafol %1" +msgstr "Atopa ficheiros que casen con :q: no cartafol %1" #: homefilesrunner.cpp:116 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/po/zh_CN/plasma_runner_example_homefiles.po new/krunner-5.38.0/po/zh_CN/plasma_runner_example_homefiles.po --- old/krunner-5.37.0/po/zh_CN/plasma_runner_example_homefiles.po 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/po/zh_CN/plasma_runner_example_homefiles.po 2017-09-03 10:13:37.000000000 +0200 @@ -3,7 +3,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2016-11-19 20:12+0100\n" -"PO-Revision-Date: 2017-08-05 09:29-0400\n" +"PO-Revision-Date: 2017-08-31 05:10-0400\n" "Last-Translator: guoyunhebrave <[email protected]>\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/CMakeLists.txt new/krunner-5.38.0/src/CMakeLists.txt --- old/krunner-5.37.0/src/CMakeLists.txt 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/src/CMakeLists.txt 2017-09-03 10:13:37.000000000 +0200 @@ -1,13 +1,19 @@ add_subdirectory(declarative) -add_library(KF5Runner +set (KF5Runner_SRCS abstractrunner.cpp + dbusrunner.cpp runnerjobs.cpp querymatch.cpp runnercontext.cpp runnermanager.cpp runnersyntax.cpp krunner_debug.cpp) +set_property(SOURCE "data/org.kde.krunner1.xml" PROPERTY INCLUDE dbusutils_p.h) +qt5_add_dbus_interface(KF5Runner_SRCS "data/org.kde.krunner1.xml" krunner_iface) + +add_library(KF5Runner + ${KF5Runner_SRCS}) generate_export_header(KF5Runner BASE_NAME KRunner) add_library(KF5::Runner ALIAS KF5Runner) @@ -21,6 +27,7 @@ Qt5::Core KF5::Plasma # Must be public because abstractrunner.h needs plasma/version.h PRIVATE + Qt5::DBus Qt5::Gui Qt5::Widgets KF5::ConfigCore @@ -96,3 +103,8 @@ ecm_generate_pri_file(BASE_NAME KRunner LIB_NAME KF5Runner DEPS "core" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KF5_INCLUDE_INSTALL_DIR}/KRunner) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) + +install(FILES + "data/org.kde.krunner1.xml" + DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} + RENAME kf5_org.kde.krunner1.xml) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/abstractrunner.cpp new/krunner-5.38.0/src/abstractrunner.cpp --- old/krunner-5.37.0/src/abstractrunner.cpp 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/src/abstractrunner.cpp 2017-09-03 10:13:37.000000000 +0200 @@ -19,7 +19,7 @@ #include "abstractrunner.h" -#include <QtWidgets/QAction> +#include <QAction> #include <QHash> #include <QMenu> #include <QMimeData> @@ -201,8 +201,12 @@ QMimeData *AbstractRunner::mimeDataForMatch(const QueryMatch &match) { - Q_UNUSED(match) - return nullptr; + if (match.urls().isEmpty()) { + return nullptr; + } + QMimeData *result = new QMimeData(); + result->setUrls(match.urls()); + return result; } bool AbstractRunner::hasRunOptions() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/data/org.kde.krunner1.xml new/krunner-5.38.0/src/data/org.kde.krunner1.xml --- old/krunner-5.37.0/src/data/org.kde.krunner1.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.38.0/src/data/org.kde.krunner1.xml 2017-09-03 10:13:37.000000000 +0200 @@ -0,0 +1,55 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.kde.krunner1"> + + <!-- + Returns a list of actions supported by this runner. + For example, a song match returned by a music player runner can be queued, added to the playlist, or played. + This should be constant + Structure is: + - ID + - Text + - IconName + --> + <method name="Actions"> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="RemoteActions" /> + <arg name="matches" type="a(sss)" direction="out"> + </arg> + </method> + + <!-- + Execute an action + --> + <method name="Run"> + <!-- + The Unique ID from Match. + --> + <arg name="matchId" type="s" direction="in"/> + <!-- + The action ID to run. For the default action this will be empty. + --> + <arg name="actionId" type="s" direction="in"/> + </method> + <!-- + Fetch matching results for a given query. + + Note: Multiple Match calls may be made with new queries before a call has returned + has returned. + --> + <method name="Match"> + <arg name="query" type="s" direction="in"/> + <!-- + Return a list of items that match the + Structure is: + - Id + - Text + - IconName + - Type (see PlasmaQuery::Type) + - Relevance + - Properties (VariantMap) + --> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="RemoteMatches"/> + <arg name="matches" type="a(sssuda{sv})" direction="out"/> + </method> + </interface> +</node> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/data/servicetypes/plasma-runner.desktop new/krunner-5.38.0/src/data/servicetypes/plasma-runner.desktop --- old/krunner-5.37.0/src/data/servicetypes/plasma-runner.desktop 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/src/data/servicetypes/plasma-runner.desktop 2017-09-03 10:13:37.000000000 +0200 @@ -15,6 +15,7 @@ Comment[en_GB]=KRunner plugin Comment[es]=Complemento para KRunner Comment[et]=KRunneri plugin +Comment[eu]=KRunner plugina Comment[fi]=KRunner-liitännäinen Comment[fr]=Module externe de KRunner Comment[gd]=Plugan KRunner @@ -58,3 +59,11 @@ [PropertyDef::X-Plasma-Args] Type=QStringList +[PropertyDef::X-Plasma-Api] +Type=QString + +[PropertyDef::X-Plasma-DBusRunner-Service] +Type=QString + +[PropertyDef::X-Plasma-DBusRunner-Path] +Type=QString diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/dbusrunner.cpp new/krunner-5.38.0/src/dbusrunner.cpp --- old/krunner-5.37.0/src/dbusrunner.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.38.0/src/dbusrunner.cpp 2017-09-03 10:13:37.000000000 +0200 @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2017 David Edmundson <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License version 2 as + * published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "dbusrunner_p.h" + +#include <QDBusArgument> +#include <QDBusConnection> +#include <QDBusConnectionInterface> +#include <QDBusMessage> +#include <QDBusError> +#include <QDBusPendingReply> +#include <QAction> +#include <QIcon> +#include <QVariantMap> + +#include <KPluginMetaData> + +#include "krunner_debug.h" +#include "krunner_iface.h" + +DBusRunner::DBusRunner(const KService::Ptr service, QObject *parent) + : Plasma::AbstractRunner(service, parent) +{ + qDBusRegisterMetaType<RemoteMatch>(); + qDBusRegisterMetaType<RemoteMatches>(); + qDBusRegisterMetaType<RemoteAction>(); + qDBusRegisterMetaType<RemoteActions>(); + + QString serviceName = service->property("X-Plasma-DBusRunner-Service").toString(); + QString path = service->property("X-Plasma-DBusRunner-Path").toString(); + + if (serviceName.isEmpty() || path.isEmpty()) { + qCWarning(KRUNNER) << "Invalid entry:" << service->name(); + return; + } + + m_interface = new OrgKdeKrunner1Interface(serviceName, path, QDBusConnection::sessionBus(), this); + + connect(this, &AbstractRunner::prepare, this, &DBusRunner::requestActions); +} + +DBusRunner::~DBusRunner() = default; + +void DBusRunner::requestActions() +{ + auto reply = m_interface->Actions(); + auto watcher = new QDBusPendingCallWatcher(reply); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher]() { + watcher->deleteLater(); + clearActions(); + QDBusReply<RemoteActions> reply = *watcher; + if (!reply.isValid()) { + return; + } + for(const RemoteAction &action: reply.value()) { + auto a = addAction(action.id, QIcon::fromTheme(action.iconName), action.text); + a->setData(action.id); + } + }); +} + +void DBusRunner::match(Plasma::RunnerContext &context) +{ + if (!m_interface) { + return; + } + + auto reply = m_interface->Match(context.query()); + reply.waitForFinished(); //AbstractRunner::match is called in a new thread, may as well block + if (reply.isError()) { + qCDebug(KRUNNER) << "Error calling" << m_interface->service() << " :" << reply.error().name() << reply.error().message(); + return; + } + for(const RemoteMatch &match: reply.value()) { + Plasma::QueryMatch m(this); + + m.setText(match.text); + m.setData(match.id); + m.setIconName(match.iconName); + m.setType(match.type); + m.setRelevance(match.relevance); + + //split is essential items are as native DBus types, optional extras are in the property map (which is obviously a lot slower to parse) + m.setUrls(QUrl::fromStringList(match.properties.value("urls").toStringList())); + m.setMatchCategory(match.properties.value("category").toString()); + m.setSubtext(match.properties.value("subtext").toString()); + + context.addMatch(m); + } +} + +QList<QAction*> DBusRunner::actionsForMatch(const Plasma::QueryMatch &match) +{ + Q_UNUSED(match) + return actions().values(); +} + +void DBusRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) +{ + Q_UNUSED(context); + if (!m_interface) { + return; + } + + QString actionId; + QString matchId = match.data().toString(); + + if (match.selectedAction()) { + actionId = match.selectedAction()->data().toString(); + } + + m_interface->Run(matchId, actionId); //don't wait for reply before returning to process +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/dbusrunner_p.h new/krunner-5.38.0/src/dbusrunner_p.h --- old/krunner-5.37.0/src/dbusrunner_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.38.0/src/dbusrunner_p.h 2017-09-03 10:13:37.000000000 +0200 @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2017 David Edmundson <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License version 2 as + * published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#pragma once + +#include <KRunner/AbstractRunner> + +#include "dbusutils_p.h" +class OrgKdeKrunner1Interface; + +class DBusRunner : public Plasma::AbstractRunner +{ + Q_OBJECT + +public: + explicit DBusRunner(const KService::Ptr service, QObject *parent = nullptr); + ~DBusRunner() override; + + void match(Plasma::RunnerContext &context) override; + void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &action) override; + QList<QAction*> actionsForMatch(const Plasma::QueryMatch &match) override; + +private: + void requestActions(); + void setActions(const RemoteActions &remoteActions); + OrgKdeKrunner1Interface *m_interface = nullptr; +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/dbusutils_p.h new/krunner-5.38.0/src/dbusutils_p.h --- old/krunner-5.37.0/src/dbusutils_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/krunner-5.38.0/src/dbusutils_p.h 2017-09-03 10:13:37.000000000 +0200 @@ -0,0 +1,81 @@ +#pragma once + +#include <QList> +#include <QString> +#include <QDBusArgument> +#include <QVariantMap> +#include <KRunner/QueryMatch> + +struct RemoteMatch +{ + //sssuda{sv} + QString id; + QString text; + QString iconName; + Plasma::QueryMatch::Type type = Plasma::QueryMatch::NoMatch; + qreal relevance = 0; + QVariantMap properties; +}; + +typedef QList<RemoteMatch> RemoteMatches; + +struct RemoteAction +{ + QString id; + QString text; + QString iconName; +}; + +typedef QList<RemoteAction> RemoteActions; + +inline QDBusArgument &operator<< (QDBusArgument &argument, const RemoteMatch &match) { + argument.beginStructure(); + argument << match.id; + argument << match.text; + argument << match.iconName; + argument << match.type; + argument << match.relevance; + argument << match.properties; + argument.endStructure(); + return argument; +} + +inline const QDBusArgument &operator>>(const QDBusArgument &argument, RemoteMatch &match) { + argument.beginStructure(); + argument >> match.id; + argument >> match.text; + argument >> match.iconName; + uint type; + argument >> type; + match.type = (Plasma::QueryMatch::Type)type; + argument >> match.relevance; + argument >> match.properties; + argument.endStructure(); + + return argument; +} + +inline QDBusArgument &operator<< (QDBusArgument &argument, const RemoteAction &action) +{ + argument.beginStructure(); + argument << action.id; + argument << action.text; + argument << action.iconName; + argument.endStructure(); + return argument; +} + +inline const QDBusArgument &operator>>(const QDBusArgument &argument, RemoteAction &action) { + argument.beginStructure(); + argument >> action.id; + argument >> action.text; + argument >> action.iconName; + argument.endStructure(); + return argument; +} + +Q_DECLARE_METATYPE(RemoteMatch); +Q_DECLARE_METATYPE(RemoteMatches); +Q_DECLARE_METATYPE(RemoteAction); +Q_DECLARE_METATYPE(RemoteActions); + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/querymatch.cpp new/krunner-5.38.0/src/querymatch.cpp --- old/krunner-5.37.0/src/querymatch.cpp 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/src/querymatch.cpp 2017-09-03 10:13:37.000000000 +0200 @@ -19,7 +19,7 @@ #include "querymatch.h" -#include <QtWidgets/QAction> +#include <QAction> #include <QIcon> #include <QReadWriteLock> #include <QSharedData> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/querymatch.h new/krunner-5.38.0/src/querymatch.h --- old/krunner-5.37.0/src/querymatch.h 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/src/querymatch.h 2017-09-03 10:13:37.000000000 +0200 @@ -74,7 +74,7 @@ * * @param runner the runner this match belongs to */ - explicit QueryMatch(AbstractRunner *runner); + explicit QueryMatch(AbstractRunner *runner = nullptr); /** * Copy constructor @@ -180,7 +180,7 @@ void setId(const QString &id); /** - * @ruetnr a string that can be used as an ID for this match, + * @return a string that can be used as an ID for this match, * even between different queries. It is based in part * on the source of the match (the AbstractRunner) and * distinguishing information provided by the runner, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/src/runnermanager.cpp new/krunner-5.38.0/src/runnermanager.cpp --- old/krunner-5.37.0/src/runnermanager.cpp 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/src/runnermanager.cpp 2017-09-03 10:13:37.000000000 +0200 @@ -39,6 +39,7 @@ #include <ThreadWeaver/Queue> #include <ThreadWeaver/Thread> +#include "dbusrunner_p.h" #include "runnerjobs_p.h" #include "plasma/pluginloader.h" #include <plasma/version.h> @@ -312,6 +313,8 @@ #endif } } + } else if (api == QLatin1String("DBus")){ + runner = new DBusRunner(service, q); } else { //qCDebug(KRUNNER) << "got a script runner known as" << api; runner = new AbstractRunner(service, q); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/templates/runner/%{APPNAMELC}.desktop new/krunner-5.38.0/templates/runner/%{APPNAMELC}.desktop --- old/krunner-5.37.0/templates/runner/%{APPNAMELC}.desktop 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/templates/runner/%{APPNAMELC}.desktop 2017-09-03 10:13:37.000000000 +0200 @@ -11,6 +11,7 @@ Name[en_GB]=%{APPNAME} Name[es]=%{APPNAME} Name[et]=%{APPNAME} +Name[eu]=%{APPNAME} Name[fi]=%{APPNAME} Name[fr]=%{APPNAME} Name[gd]=%{APPNAME} @@ -50,6 +51,7 @@ Comment[en_GB]=%{APPNAME} runner Comment[es]=Lanzador de %{APPNAME} Comment[et]=%{APPNAME} käivitaja +Comment[eu]=%{APPNAME} runner Comment[fi]=%{APPNAME}-suoritusohjelma Comment[fr]=Runner %{APPNAME} Comment[gd]=Ruithear %{APPNAME} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.37.0/templates/runner/runner.kdevtemplate new/krunner-5.38.0/templates/runner/runner.kdevtemplate --- old/krunner-5.37.0/templates/runner/runner.kdevtemplate 2017-08-06 20:09:44.000000000 +0200 +++ new/krunner-5.38.0/templates/runner/runner.kdevtemplate 2017-09-03 10:13:37.000000000 +0200 @@ -11,6 +11,7 @@ Name[el]=C++ Name[en_GB]=C++ Name[es]=C++ +Name[eu]=C++ Name[fi]=C++ Name[fr]=C++ Name[gl]=C++ @@ -45,6 +46,7 @@ Comment[el]=Plasma Runner Template. Ένα πρότυπο εκτελεστή plasma Comment[en_GB]=Plasma Runner Template. A plasma runner template Comment[es]=Plantilla para Plasma Runner. Una plantilla para Plasma Runner. +Comment[eu]=Plasma Runner txantiloia. Plasma runner txantiloi bat Comment[fi]=Plasma-suoritusohjelmamalli. Comment[fr]=Modèle de runner Plasma. Comment[gl]=Modelo de executor de Plasma. Un modelo de executor de Plasma.
