Commit 42068e17 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau Committed by Alexander Lohnau

Runners: port to KPluginMetaData argument using AbstractRunner constructor

parent 2a9100b5
......@@ -5,7 +5,7 @@ set(PROJECT_VERSION "5.20.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.74")
set(KF5_MIN_VERSION "5.77")
set(INSTALL_SDDM_THEME TRUE)
set(CMAKE_CXX_STANDARD 17)
......
......@@ -24,8 +24,8 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(ActivityRunner, "plasma-runner-activityrunner.json")
ActivityRunner::ActivityRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args),
ActivityRunner::ActivityRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args),
m_activities(new KActivities::Controller(this)),
m_consumer(new KActivities::Consumer(this)),
m_keywordi18n(i18nc("KRunner keyword", "activity")),
......
......@@ -30,7 +30,7 @@ class ActivityRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
ActivityRunner(QObject *parent, const QVariantList &args);
ActivityRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
~ActivityRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -35,8 +35,8 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(InstallerRunner, "plasma-runner-appstream.json")
InstallerRunner::InstallerRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
InstallerRunner::InstallerRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
{
setObjectName(QStringLiteral("Installation Suggestions"));
setPriority(AbstractRunner::HighestPriority);
......
......@@ -30,7 +30,7 @@ class InstallerRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
InstallerRunner(QObject *parent, const QVariantList &args);
InstallerRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
~InstallerRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -93,6 +93,7 @@ Type=Service
X-KDE-ServiceTypes=Plasma/Runner
X-KDE-PluginInfo-Author=Aleix Pol Gonzalez
X-KDE-PluginInfo-Email=aleixpol@blue-systems.com
X-KDE-PluginInfo-Name=appstream
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
......@@ -39,8 +39,10 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(BookmarksRunner, "plasma-runner-bookmarks.json")
BookmarksRunner::BookmarksRunner( QObject* parent, const QVariantList &args )
: Plasma::AbstractRunner(parent, args), m_browser(nullptr), m_browserFactory(new BrowserFactory(this))
BookmarksRunner::BookmarksRunner(QObject* parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
, m_browser(nullptr)
, m_browserFactory(new BrowserFactory(this))
{
setObjectName(QStringLiteral("Bookmarks"));
addSyntax(Plasma::RunnerSyntax(QStringLiteral(":q:"), i18n("Finds web browser bookmarks matching :q:.")));
......
......@@ -34,7 +34,7 @@ class BookmarksRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
BookmarksRunner(QObject* parent, const QVariantList &args);
BookmarksRunner(QObject* parent, const KPluginMetaData &metaData, const QVariantList &args);
~BookmarksRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -38,8 +38,8 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(CalculatorRunner, "plasma-runner-calculator.json")
CalculatorRunner::CalculatorRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
CalculatorRunner::CalculatorRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
{
#ifdef ENABLE_QALCULATE
m_engine = new QalculateEngine;
......
......@@ -36,7 +36,7 @@ class CalculatorRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
CalculatorRunner(QObject *parent, const QVariantList &args);
CalculatorRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
~CalculatorRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -33,8 +33,9 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(KillRunner, "plasma-runner-kill.json")
KillRunner::KillRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args), m_processes(nullptr)
KillRunner::KillRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
, m_processes(nullptr)
{
setObjectName(QStringLiteral("Kill Runner"));
......
......@@ -40,7 +40,7 @@ class KillRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
KillRunner(QObject *parent, const QVariantList &args);
KillRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
~KillRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -36,8 +36,8 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(LocationsRunner, "plasma-runner-locations.json")
LocationsRunner::LocationsRunner(QObject *parent, const QVariantList& args)
: Plasma::AbstractRunner(parent, args)
LocationsRunner::LocationsRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList& args)
: Plasma::AbstractRunner(parent, metaData, args)
{
// set the name shown after the result in krunner window
setObjectName(QStringLiteral("Locations"));
......
......@@ -26,7 +26,7 @@ class LocationsRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
LocationsRunner(QObject *parent, const QVariantList& args);
LocationsRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList& args);
~LocationsRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -33,8 +33,8 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(PlacesRunner, "plasma-runner-places.json")
//Q_DECLARE_METATYPE(Plasma::RunnerContext)
PlacesRunner::PlacesRunner(QObject* parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
PlacesRunner::PlacesRunner(QObject* parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
{
setObjectName(QStringLiteral("Places"));
Plasma::RunnerSyntax defaultSyntax(i18n("places"), i18n("Lists all file manager locations"));
......
......@@ -47,7 +47,7 @@ class PlacesRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
PlacesRunner(QObject* parent, const QVariantList &args);
PlacesRunner(QObject* parent, const KPluginMetaData &metaData, const QVariantList &args);
~PlacesRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -33,8 +33,8 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(PowerDevilRunner, "plasma-runner-powerdevil.json")
PowerDevilRunner::PowerDevilRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
PowerDevilRunner::PowerDevilRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
{
setObjectName(QStringLiteral("PowerDevil"));
updateStatus();
......
......@@ -27,7 +27,7 @@ class PowerDevilRunner : public Plasma::AbstractRunner
{
Q_OBJECT
public:
PowerDevilRunner( QObject *parent, const QVariantList &args );
PowerDevilRunner( QObject *parent, const KPluginMetaData &metaData, const QVariantList &args );
~PowerDevilRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -38,8 +38,8 @@ using namespace KActivities::Stats::Terms;
K_EXPORT_PLASMA_RUNNER_WITH_JSON(RecentDocuments, "plasma-runner-recentdocuments.json")
RecentDocuments::RecentDocuments(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
RecentDocuments::RecentDocuments(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
{
setObjectName(QStringLiteral("Recent Documents"));
......
......@@ -28,7 +28,7 @@ class RecentDocuments : public Plasma::AbstractRunner {
Q_OBJECT
public:
RecentDocuments( QObject *parent, const QVariantList& args );
RecentDocuments( QObject *parent, const KPluginMetaData &metaData, const QVariantList& args );
~RecentDocuments() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -81,7 +81,7 @@ void ServiceRunnerTest::cleanupTestCase()
void ServiceRunnerTest::testChromeAppsRelevance()
{
ServiceRunner runner(this, QVariantList());
ServiceRunner runner(this, KPluginMetaData(), QVariantList());
Plasma::RunnerContext context;
context.setQuery(QStringLiteral("chrome"));
......@@ -112,7 +112,7 @@ void ServiceRunnerTest::testChromeAppsRelevance()
void ServiceRunnerTest::testKonsoleVsYakuakeComment()
{
// Yakuake has konsole mentioned in comment, should be rated lower.
ServiceRunner runner(this, QVariantList());
ServiceRunner runner(this, KPluginMetaData(), QVariantList());
Plasma::RunnerContext context;
context.setQuery(QStringLiteral("kons"));
......@@ -147,7 +147,7 @@ void ServiceRunnerTest::testSystemSettings()
// first it will be added to the seen cache, however disqualification of already seen items
// may then also disqualify the KDE version of system settings on account of having already
// seen it. This test makes sure we find the right version.
ServiceRunner runner(this, QVariantList());
ServiceRunner runner(this, KPluginMetaData(), QVariantList());
Plasma::RunnerContext context;
context.setQuery(QStringLiteral("settings"));
......@@ -173,7 +173,7 @@ void ServiceRunnerTest::testForeignAppsOutscoreKCMs()
{
// Our software outscores other things, but foreign applications should still
// outscore our KCMs.
ServiceRunner runner(this, QVariantList());
ServiceRunner runner(this, KPluginMetaData(), QVariantList());
Plasma::RunnerContext context;
context.setQuery(QStringLiteral("virt"));
......@@ -227,7 +227,7 @@ void ServiceRunnerTest::testINotifyUsage()
// The expectation here is that this KDW instance is not persistently claiming an inotify instance.
bool inotifyCountCool = false;
auto thread = QThread::create([&] {
ServiceRunner runner(nullptr, QVariantList());
ServiceRunner runner(nullptr, KPluginMetaData(), QVariantList());
Plasma::RunnerContext context;
context.setQuery(QStringLiteral("settings"));
......
......@@ -414,8 +414,8 @@ private:
int weightedTermLength = -1;
};
ServiceRunner::ServiceRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
ServiceRunner::ServiceRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
{
setObjectName(QStringLiteral("Application"));
setPriority(AbstractRunner::HighestPriority);
......
......@@ -37,7 +37,7 @@ class ServiceRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
ServiceRunner(QObject *parent, const QVariantList &args);
ServiceRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
~ServiceRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -29,8 +29,8 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(SessionRunner, "plasma-runner-sessions.json")
SessionRunner::SessionRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
SessionRunner::SessionRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
{
setObjectName(QStringLiteral("Sessions"));
setPriority(LowPriority);
......
......@@ -33,7 +33,7 @@ class SessionRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
SessionRunner(QObject *parent, const QVariantList &args);
SessionRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
~SessionRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -31,8 +31,8 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(ShellRunner, "plasma-runner-shell.json")
ShellRunner::ShellRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
ShellRunner::ShellRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
{
setObjectName(QStringLiteral("Command"));
setPriority(AbstractRunner::HighestPriority);
......
......@@ -30,7 +30,7 @@ class ShellRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
ShellRunner(QObject *parent, const QVariantList &args);
ShellRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
~ShellRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -28,8 +28,8 @@
#include <KSycoca>
#include <KShell>
WebshortcutRunner::WebshortcutRunner(QObject *parent, const QVariantList& args)
: Plasma::AbstractRunner(parent, args),
WebshortcutRunner::WebshortcutRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args),
m_match(this), m_filterBeforeRun(false)
{
setObjectName(QStringLiteral("Web Shortcut"));
......
......@@ -26,7 +26,7 @@ class WebshortcutRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
WebshortcutRunner(QObject *parent, const QVariantList& args);
WebshortcutRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
~WebshortcutRunner() override;
void match(Plasma::RunnerContext &context) override;
......
......@@ -33,8 +33,8 @@
K_EXPORT_PLASMA_RUNNER_WITH_JSON(WindowedWidgetsRunner, "plasma-runner-windowedwidgets.json")
WindowedWidgetsRunner::WindowedWidgetsRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
WindowedWidgetsRunner::WindowedWidgetsRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
{
setObjectName(QStringLiteral("WindowedWidgets"));
setPriority(AbstractRunner::HighestPriority);
......
......@@ -38,7 +38,7 @@ class WindowedWidgetsRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
WindowedWidgetsRunner(QObject *parent, const QVariantList &args);
WindowedWidgetsRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
~WindowedWidgetsRunner() override;
void match(Plasma::RunnerContext &context) override;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment