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 | |
9 | using namespace Purpose; |
10 | |
11 | class Purpose::JobPrivate |
12 | { |
13 | public: |
14 | QJsonObject m_data; |
15 | QJsonObject m_output = {{QStringLiteral("uninitialized" ), QStringLiteral("true" )}}; |
16 | }; |
17 | |
18 | Job::Job(QObject *parent) |
19 | : KJob(parent) |
20 | , d_ptr(new JobPrivate) |
21 | { |
22 | } |
23 | |
24 | Job::~Job() |
25 | { |
26 | } |
27 | |
28 | QJsonObject Job::data() const |
29 | { |
30 | Q_D(const Job); |
31 | return d->m_data; |
32 | } |
33 | |
34 | void Job::setData(const QJsonObject &data) |
35 | { |
36 | Q_D(Job); |
37 | d->m_data = data; |
38 | } |
39 | |
40 | QJsonObject Job::output() const |
41 | { |
42 | Q_D(const Job); |
43 | return d->m_output; |
44 | } |
45 | |
46 | void 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" |
56 | |