]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ppd-cache.c
Merge changes from CUPS 1.6svn-r10310.
[thirdparty/cups.git] / cups / ppd-cache.c
index c9ee6af2d88e892e4389a80a4a8ef3d48e02b337..cf34a00bd5dff9c2367701272d78eab656014f2f 100644 (file)
@@ -171,6 +171,8 @@ _ppdCacheCreateWithFile(
     goto create_error;
   }
 
+  pc->max_copies = 9999;
+
  /*
   * Read the file...
   */
@@ -553,6 +555,8 @@ _ppdCacheCreateWithFile(
 
       cupsArrayAdd(pc->finishings, finishings);
     }
+    else if (!_cups_strcasecmp(line, "MaxCopies"))
+      pc->max_copies = atoi(value);
     else
     {
       DEBUG_printf(("_ppdCacheCreateWithFile: Unknown %s on line %d.", line,
@@ -1348,6 +1352,17 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
                                        NULL)) != NULL);
   }
 
+ /*
+  * Max copies...
+  */
+
+  if ((ppd_attr = ppdFindAttr(ppd, "cupsMaxCopies", NULL)) != NULL)
+    pc->max_copies = atoi(ppd_attr->value);
+  else if (ppd->manual_copies)
+    pc->max_copies = 1;
+  else
+    pc->max_copies = 9999;
+
  /*
   * Return the cache data...
   */
@@ -2333,6 +2348,12 @@ _ppdCacheWriteFile(
     cupsFilePutChar(fp, '\n');
   }
 
+ /*
+  * Max copies...
+  */
+
+  cupsFilePrintf(fp, "MaxCopies %d\n", pc->max_copies);
+
  /*
   * IPP attributes, if any...
   */