Skip to content

Commit

Permalink
scheduler: Fix reasons for previously printed jobs
Browse files Browse the repository at this point in the history
Before OpenPrinting#832 most successfully finished jobs had incorrect
job state reasons - try to fix them during loading the jobs.
  • Loading branch information
zdohnal committed Jan 19, 2024
1 parent 881eab1 commit d8d2624
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scheduler/job.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d8d2624

Please sign in to comment.