Purpose

job.cpp
1/*
2 SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#include "job.h"
8
9using namespace Purpose;
10
11class Purpose::JobPrivate
12{
13public:
14 QJsonObject m_data;
15 QJsonObject m_output = {{QStringLiteral("uninitialized"), QStringLiteral("true")}};
16};
17
18Job::Job(QObject *parent)
19 : KJob(parent)
20 , d_ptr(new JobPrivate)
21{
22}
23
24Job::~Job()
25{
26}
27
29{
30 Q_D(const Job);
31 return d->m_data;
32}
33
34void Job::setData(const QJsonObject &data)
35{
36 Q_D(Job);
37 d->m_data = data;
38}
39
41{
42 Q_D(const Job);
43 return d->m_output;
44}
45
46void Job::setOutput(const QJsonObject &output)
47{
48 Q_D(Job);
49 if (d->m_output != output) {
50 d->m_output = output;
51 Q_EMIT outputChanged(output);
52 }
53}
54
55#include "moc_job.cpp"
Job that will actually perform the sharing.
Definition job.h:34
QJsonObject output
Returns the output generated by the plugin.
Definition job.h:46
void setData(const QJsonObject &data)
Should only be called after constructing.
Definition job.cpp:34
QJsonObject data
Represents the data the job will have available to perform its task.
Definition job.h:39
Q_EMITQ_EMIT
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.