mirror-kde-plasma-desktop/kcms/runners/plugininstaller/KRunnerPlugininstallerRcJob.h
Alexander Lohnau e170f15429 kcm/runners: Allow simpler installation of DBus runners
While the install.sh script that is part of the python templates worked
great, it still is visually annoying to have a terminal window open when we
just need to copy/generate two files.

With a krunner-plugininstallerrc file, consumers can provide instructions on
how to generate the dbus service and where to find the desktop file for
the runner.

This is intended for python runners, but can work with any other
language or even prebuild binaries.
In the future, we might want to add the possibility to add dependencies.
But for now, the current state should suffice.

Also, we could adjust the installation without having to edit the
KRunner template and lots of existing KRunner plugins that are already
published.

Since there are a few moving parts involved, an autotest was added to
ensure the files end up in the correct destination.
This also checks the dynamically generated content of the service and
tests the one given line of the desktop file
2023-07-12 18:12:10 +00:00

24 lines
630 B
C++

/*
SPDX-FileCopyrightText: 2023 Alexander Lohnau <alexander.lohnau@gmx.de>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
#include "AbstractJob.h"
struct InstallerInfo;
class KRunnerPluginInstallerRcJob : public AbstractJob
{
public:
explicit KRunnerPluginInstallerRcJob(bool skipConfigmDialog)
: m_skipConfirmDialog(skipConfigmDialog)
{
}
void executeOperation(const QFileInfo &fileInfo, const QString &mimeType, bool install) override;
private:
void doInstall(const InstallerInfo &info);
void doUninstall(const InstallerInfo &info);
const bool m_skipConfirmDialog;
};