• Elvis Angelaccio's avatar
    Stop emitting result() after doKill() · 79219339
    Elvis Angelaccio authored
    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
    79219339
jobs.cpp 24.6 KB