Changeset View
Changeset View
Standalone View
Standalone View
src/core/job.cpp
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Line(s) | |||||
173 | { | 173 | { | ||
174 | emit job->description(job, i18nc("@title job", "Unmounting"), | 174 | emit job->description(job, i18nc("@title job", "Unmounting"), | ||
175 | qMakePair(i18n("Mountpoint"), point)); | 175 | qMakePair(i18n("Mountpoint"), point)); | ||
176 | } | 176 | } | ||
177 | 177 | | |||
178 | bool Job::doKill() | 178 | bool Job::doKill() | ||
179 | { | 179 | { | ||
180 | // kill all subjobs, without triggering their result slot | 180 | // kill all subjobs, without triggering their result slot | ||
181 | Q_FOREACH (KJob *it, subjobs()) { | 181 | for (KJob *job : subjobs()) { | ||
182 | it->kill(KJob::Quietly); | 182 | job->kill(KJob::Quietly); | ||
dfaure: You need a local const var to hold the result of the subjobs() method call.
(repeats) | |||||
IIUC, subjobs() returns a const QList &, do we still need a local const var? ahmadsamir: IIUC, subjobs() returns a const QList &, do we still need a local const var?
https://api.kde. | |||||
dfaure: Well spotted. Unusual.... | |||||
183 | } | 183 | } | ||
184 | clearSubjobs(); | 184 | clearSubjobs(); | ||
185 | 185 | | |||
186 | return true; | 186 | return true; | ||
187 | } | 187 | } | ||
188 | 188 | | |||
189 | bool Job::doSuspend() | 189 | bool Job::doSuspend() | ||
190 | { | 190 | { | ||
191 | Q_FOREACH (KJob *it, subjobs()) { | 191 | for (KJob *job : subjobs()) { | ||
192 | if (!it->suspend()) { | 192 | if (!job->suspend()) { | ||
193 | return false; | 193 | return false; | ||
194 | } | 194 | } | ||
195 | } | 195 | } | ||
196 | 196 | | |||
197 | return true; | 197 | return true; | ||
198 | } | 198 | } | ||
199 | 199 | | |||
200 | bool Job::doResume() | 200 | bool Job::doResume() | ||
201 | { | 201 | { | ||
202 | Q_FOREACH (KJob *it, subjobs()) { | 202 | for (KJob *job : subjobs()) { | ||
203 | if (!it->resume()) { | 203 | if (!job->resume()) { | ||
204 | return false; | 204 | return false; | ||
205 | } | 205 | } | ||
206 | } | 206 | } | ||
207 | 207 | | |||
208 | return true; | 208 | return true; | ||
209 | } | 209 | } | ||
210 | 210 | | |||
211 | //Job::errorString is implemented in job_error.cpp | 211 | //Job::errorString is implemented in job_error.cpp | ||
▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines |
You need a local const var to hold the result of the subjobs() method call.
(repeats)