Purpose::Configuration Class

This class will be in charge of figuring out the job configuration. More...

Header: #include <Configuration>
CMake: find_package(KF6 REQUIRED COMPONENTS Purpose)
target_link_libraries(mytarget PRIVATE KF6::Purpose)

Properties

Public Functions

Configuration(const QJsonObject &inputData, const QString &pluginTypeName, const KPluginMetaData &pluginInformation, QObject *parent = nullptr)
Configuration(const QJsonObject &inputData, const QString &pluginTypeName, const QJsonObject &pluginType, const KPluginMetaData &pluginInformation, QObject *parent = nullptr)
virtual ~Configuration() override
QUrl configSourceCode() const
Purpose::Job *createJob()
QJsonObject data() const
bool isReady() const
QJsonArray neededArguments() const
QString pluginName() const
QString pluginTypeName() const
void setData(const QJsonObject &data)
void setUseSeparateProcess(bool separate)
bool useSeparateProcess() const

Signals

void dataChanged()

Detailed Description

Once it's figured out, it can proceed to create the job.

The object will be destroyed as soon as the job finishes.

Property Documentation

[read-only] configSourceCode : const QUrl

Specifies the QML source code to be used, to configure the current job.

Access functions:

QUrl configSourceCode() const

data : QJsonObject

Represents the data the job will have available to perform its task.

Access functions:

QJsonObject data() const
void setData(const QJsonObject &data)

Notifier signal:

void dataChanged()

[read-only] isReady : const bool

Tells whether there's still information to be provided, to be able to run the job.

Access functions:

bool isReady() const

Notifier signal:

void dataChanged()

[read-only] neededArguments : const QJsonArray

Specifies the arguments the config file and the job will be sharing.

Access functions:

QJsonArray neededArguments() const

[read-only] pluginName : const QString

Returns the plugin name to display.

Access functions:

QString pluginName() const

[read-only] pluginTypeName : const QString

Returns the plugin type name to display.

Access functions:

QString pluginTypeName() const

Member Function Documentation

Configuration::Configuration(const QJsonObject &inputData, const QString &pluginTypeName, const KPluginMetaData &pluginInformation, QObject *parent = nullptr)

Constructs a new configuration.

Configuration::Configuration(const QJsonObject &inputData, const QString &pluginTypeName, const QJsonObject &pluginType, const KPluginMetaData &pluginInformation, QObject *parent = nullptr)

Constructs a new configuration.

[override virtual noexcept] Configuration::~Configuration()

Destroys the configuration.

Purpose::Job *Configuration::createJob()

Returns the configured job ready to be started.

Before calling it, make sure that all information has been filled by checking isReady().

void Configuration::setUseSeparateProcess(bool separate)

separate will specify whether the process will be forced to execute in-process or in a separate process.

See also useSeparateProcess().

bool Configuration::useSeparateProcess() const

Returns whether the job will be run in the same process.

By default it will be true, unless the environment variable KDE_PURPOSE_LOCAL_JOBS is defined.

See also setUseSeparateProcess().