diff --git a/libnotificationmanager/job_p.cpp b/libnotificationmanager/job_p.cpp --- a/libnotificationmanager/job_p.cpp +++ b/libnotificationmanager/job_p.cpp @@ -255,9 +255,9 @@ void JobPrivate::terminate(const QString &errorMessage) { Job *job = static_cast(parent()); - job->setErrorText(errorMessage); - job->setState(Notifications::JobStateStopped); - finish(); + // forward to JobViewV3. In V2 we get a setError before a terminate + // so we want to forward the current error to the V3 call. + terminate(job->error(), errorMessage, {}); } void JobPrivate::setSuspended(bool suspended) @@ -358,6 +358,14 @@ Job *job = static_cast(parent()); job->setError(errorCode); job->setErrorText(errorMessage); + + // If job finishes without error set its total files count to the processed files count + // to avoid situations where you have 1 out of 0 files. + if (!errorCode && m_processedFiles > 0 && m_totalFiles == 0) { + m_totalFiles = m_processedFiles; + emit job->totalFilesChanged(); + } + job->setState(Notifications::JobStateStopped); finish(); }