]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
PPD option mapping auto-generator: Consider "ColorMode" also with prefix
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 15 Sep 2021 19:05:03 +0000 (21:05 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 15 Sep 2021 19:05:03 +0000 (21:05 +0200)
This way we also cover "cupsColorMode" for example which appears in
auto-generated PPDs for driverless IPP printers (in case we cannot
print directly to the printer but only have access via a CUPS queue).

Also updated a comment and a log message.

cups/ppd-cache.c
scheduler/job.c

index 0a46d7441e0314433929f2e7afdd3187bea74b0d..bf008f50d477211485b15e5a93e7ed4447a76e56 100644 (file)
@@ -2209,7 +2209,7 @@ _ppdCacheAssignPresets(ppd_file_t *ppd,
        }
 
        /*
-       * Color/Gray - print-color-mode
+       * Color/Monochrome - print-color-mode
        */
 
        /* If we have a color device, check whether this option sets mono or
@@ -2233,7 +2233,7 @@ _ppdCacheAssignPresets(ppd_file_t *ppd,
              properties->sets_color = 1;
          }
          else if (_cups_strcasecmp(o, "ColorModel") == 0 ||
-                  _cups_strcasecmp(o, "ColorMode") == 0 ||
+                  _cups_strcasestr(o, "ColorMode") ||
                   _cups_strcasecmp(o, "OutputMode") == 0 ||
                   _cups_strcasecmp(o, "PrintoutMode") == 0 ||
                   _cups_strcasecmp(o, "ARCMode") == 0 || /* Sharp */
@@ -2370,7 +2370,7 @@ _ppdCacheAssignPresets(ppd_file_t *ppd,
        }
        /* Generic enumerated choice option and choice names */
        else if (_cups_strcasecmp(o, "ColorModel") == 0 ||
-                _cups_strcasecmp(o, "ColorMode") == 0 ||
+                _cups_strcasestr(o, "ColorMode") ||
                 _cups_strcasecmp(o, "OutputMode") == 0 || /* HPLIP hpcups */
                 _cups_strcasecmp(o, "PrintoutMode") == 0 || /* Foomatic */
                 _cups_strcasecmp(o, "PrintQuality") == 0 ||
index 615ef98f4c0b1a459596efc1f56777c580bda8d2..38e869e334dc8830134c28f712b3a4edfc57234c 100644 (file)
@@ -3729,7 +3729,7 @@ get_options(cupsd_job_t *job,             /* I - Job */
     cupsdLogJob(job, CUPSD_LOG_DEBUG,
                "print-color-mode=%s, print-quality=%s",
                print_color_mode == _PWG_PRINT_COLOR_MODE_MONOCHROME ?
-               "gray" : "color",
+               "monochrome" : "color",
                print_quality == _PWG_PRINT_QUALITY_DRAFT ? "draft" :
                (print_quality == _PWG_PRINT_QUALITY_HIGH ? "high" : "normal"));
     if (pc->num_presets[print_color_mode][print_quality] > 0)