1 | /* |
---|---|
2 | This file is part of KDE. |
3 | |
4 | SPDX-FileCopyrightText: 2010 Sebastian Kügler <sebas@kde.org> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
7 | */ |
8 | |
9 | #include "buildservicejob.h" |
10 | |
11 | using namespace Attica; |
12 | |
13 | class Q_DECL_HIDDEN BuildServiceJob::Private : public QSharedData |
14 | { |
15 | public: |
16 | QString id; |
17 | QString name; |
18 | int status; |
19 | qreal progress; |
20 | QString projectId; |
21 | QString target; |
22 | QString buildServiceId; |
23 | QString url; |
24 | QString message; |
25 | |
26 | Private() |
27 | { |
28 | } |
29 | }; |
30 | |
31 | BuildServiceJob::BuildServiceJob() |
32 | : d(new Private) |
33 | { |
34 | } |
35 | |
36 | BuildServiceJob::BuildServiceJob(const BuildServiceJob &other) |
37 | : d(other.d) |
38 | { |
39 | } |
40 | |
41 | BuildServiceJob &BuildServiceJob::operator=(const Attica::BuildServiceJob &other) |
42 | { |
43 | d = other.d; |
44 | return *this; |
45 | } |
46 | |
47 | BuildServiceJob::~BuildServiceJob() |
48 | { |
49 | } |
50 | |
51 | void BuildServiceJob::setId(const QString &u) |
52 | { |
53 | d->id = u; |
54 | } |
55 | |
56 | QString BuildServiceJob::id() const |
57 | { |
58 | return d->id; |
59 | } |
60 | |
61 | void BuildServiceJob::setName(const QString &u) |
62 | { |
63 | d->name = u; |
64 | } |
65 | |
66 | QString BuildServiceJob::name() const |
67 | { |
68 | return d->name; |
69 | } |
70 | |
71 | void BuildServiceJob::setProgress(const qreal p) |
72 | { |
73 | d->progress = p; |
74 | } |
75 | |
76 | qreal BuildServiceJob::progress() const |
77 | { |
78 | return d->progress; |
79 | } |
80 | |
81 | void BuildServiceJob::setStatus(const int status) |
82 | { |
83 | d->status = status; |
84 | } |
85 | |
86 | bool BuildServiceJob::isRunning() const |
87 | { |
88 | return d->status == 1; |
89 | } |
90 | |
91 | bool BuildServiceJob::isCompleted() const |
92 | { |
93 | return d->status == 2; |
94 | } |
95 | |
96 | bool BuildServiceJob::isFailed() const |
97 | { |
98 | return d->status == 3; |
99 | } |
100 | |
101 | void BuildServiceJob::setUrl(const QString &u) |
102 | { |
103 | d->url = u; |
104 | } |
105 | |
106 | QString BuildServiceJob::url() const |
107 | { |
108 | return d->url; |
109 | } |
110 | |
111 | void BuildServiceJob::setMessage(const QString &u) |
112 | { |
113 | d->message = u; |
114 | } |
115 | |
116 | QString BuildServiceJob::message() const |
117 | { |
118 | return d->message; |
119 | } |
120 | |
121 | void BuildServiceJob::setProjectId(const QString &u) |
122 | { |
123 | d->projectId = u; |
124 | } |
125 | |
126 | QString BuildServiceJob::projectId() const |
127 | { |
128 | return d->projectId; |
129 | } |
130 | |
131 | void BuildServiceJob::setTarget(const QString &u) |
132 | { |
133 | d->target = u; |
134 | } |
135 | |
136 | QString BuildServiceJob::target() const |
137 | { |
138 | return d->target; |
139 | } |
140 | |
141 | void BuildServiceJob::setBuildServiceId(const QString &u) |
142 | { |
143 | d->buildServiceId = u; |
144 | } |
145 | |
146 | QString BuildServiceJob::buildServiceId() const |
147 | { |
148 | return d->buildServiceId; |
149 | } |
150 | |
151 | bool BuildServiceJob::isValid() const |
152 | { |
153 | return !(d->id.isEmpty()); |
154 | } |
155 |