Commit 79219339 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Stop emitting result() after doKill()

Whether the job emits the `result()` signal should depend on the
argument passed to `KJob::killed()`. From the Ark side we always call
`kill()` which uses the default argument `Quietly`.

However, KUiServerJobTracker (called from the plasma systrat applet)
calls `kill(KJob::EmitResult)`. This means that the result signal will
be emitted twice: one from `KJob::finishJob()` and another one when the
Ark jobs return and we go to `Job::onFinished()`.

This means that from the Ark side we need to emit `result()` only when
we didn't kill the job quietly, i.e. when we didn't call `doKill()`
(which sends the request interruption to the secondary threads).

This patch does that but it's quite an hack. A better long-term solution
would be to refactor the interface functions so that they return an enum
rather than a boolean (see T8084).

Task: T8081
parent 0f02f13e
...@@ -207,7 +207,9 @@ void Job::onFinished(bool result) ...@@ -207,7 +207,9 @@ void Job::onFinished(bool result)
setError(KJob::UserDefinedError); setError(KJob::UserDefinedError);
} }
emitResult(); if (!d->isInterruptionRequested()) {
emitResult();
}
} }
void Job::onUserQuery(Query *query) void Job::onUserQuery(Query *query)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment