Changeset View
Changeset View
Standalone View
Standalone View
util/executecompositejob.cpp
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | |||||
101 | { | 101 | { | ||
102 | disconnect(job, SIGNAL(percent(KJob*,ulong)), this, SLOT(slotPercent(KJob*,ulong))); | 102 | disconnect(job, SIGNAL(percent(KJob*,ulong)), this, SLOT(slotPercent(KJob*,ulong))); | ||
103 | 103 | | |||
104 | // jobIndex + 1 because this job just finished | 104 | // jobIndex + 1 because this job just finished | ||
105 | const float ratio = d->m_jobIndex != -1 ? (d->m_jobIndex + 1.0) / d->m_jobCount : 1.0; | 105 | const float ratio = d->m_jobIndex != -1 ? (d->m_jobIndex + 1.0) / d->m_jobCount : 1.0; | ||
106 | emitPercent(ratio * 100, 100); | 106 | emitPercent(ratio * 100, 100); | ||
107 | 107 | | |||
108 | qCDebug(UTIL) << "finished: "<< job << job->error() << "percent:" << ratio * 100; | 108 | qCDebug(UTIL) << "finished: "<< job << job->error() << "percent:" << ratio * 100; | ||
109 | bool emitDone = false; | ||||
109 | if (d->m_abortOnError && job->error()) { | 110 | if (d->m_abortOnError && job->error()) { | ||
110 | qCDebug(UTIL) << "JOB ERROR:" << job->error() << job->errorString(); | 111 | qCDebug(UTIL) << "JOB ERROR:" << job->error() << job->errorString(); | ||
111 | KCompositeJob::slotResult(job); | 112 | KCompositeJob::slotResult(job); // calls emitResult() | ||
113 | emitDone = true; | ||||
112 | } else | 114 | } else | ||
113 | removeSubjob(job); | 115 | removeSubjob(job); | ||
114 | 116 | | |||
115 | if (hasSubjobs() && !error() && !d->m_killing) { | 117 | if (hasSubjobs() && !error() && !d->m_killing) { | ||
116 | qCDebug(UTIL) << "remaining: " << subjobs().count() << subjobs(); | 118 | qCDebug(UTIL) << "remaining: " << subjobs().count() << subjobs(); | ||
117 | d->startNextJob(subjobs().first()); | 119 | d->startNextJob(subjobs().first()); | ||
118 | } else { | 120 | } else if (!emitDone) { | ||
119 | setError(job->error()); | 121 | setError(job->error()); | ||
120 | setErrorText(job->errorString()); | 122 | setErrorText(job->errorString()); | ||
121 | emitResult(); | 123 | emitResult(); | ||
122 | } | 124 | } | ||
123 | } | 125 | } | ||
124 | 126 | | |||
125 | bool ExecuteCompositeJob::doKill() | 127 | bool ExecuteCompositeJob::doKill() | ||
126 | { | 128 | { | ||
Show All 21 Lines |