From: Zdenek Dohnal Date: Mon, 27 Nov 2023 11:49:57 +0000 (+0100) Subject: scheduler: Fix reasons for previously printed jobs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=259b67100577654e2f83beaf9b6455e9088ba84a;p=thirdparty%2Fcups.git scheduler: Fix reasons for previously printed jobs Before #832 most successfully finished jobs had incorrect job state reasons - try to fix them during loading the jobs. --- diff --git a/scheduler/job.c b/scheduler/job.c index fa901dcc18..0e5ac281e9 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1832,6 +1832,14 @@ cupsdLoadJob(cupsd_job_t *job) /* I - Job */ else ippSetString(job->attrs, &job->reasons, 0, "none"); } + else if (job->state_value == IPP_JSTATE_COMPLETED && !strcmp(job->reasons, "processing-to-stop-point")) + { + /* + * Try to fix job reasons for older jobs finished before openprinting/cups #832 was applied... + */ + + ippSetString(job->attrs, &job->reasons, 0, "job-completed-successfully"); + } job->impressions = ippFindAttribute(job->attrs, "job-impressions-completed", IPP_TAG_INTEGER); job->sheets = ippFindAttribute(job->attrs, "job-media-sheets-completed", IPP_TAG_INTEGER);