]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
scheduler: Fix reasons for previously printed jobs
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 27 Nov 2023 11:49:57 +0000 (12:49 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Fri, 26 Jan 2024 05:50:45 +0000 (06:50 +0100)
Before #832 most successfully finished jobs had incorrect
job state reasons - try to fix them during loading the jobs.

scheduler/job.c

index fa901dcc188c3dc49f8f8b6aac91e87a62e7babf..0e5ac281e9e0f65bb6cc5e35307df9fba027f4ca 100644 (file)
@@ -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);