mirror of
https://github.com/kfattic/cupsadmin.git
synced 2026-11-13 19:06:43 -05:00
Flag queues whose driver filters need Rosetta or are missing
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,8 @@ public struct PPD {
|
||||
public private(set) var groups: [String] = []
|
||||
/// Top-level `*Key: value` attributes (NickName, Manufacturer, ...), first occurrence wins.
|
||||
public private(set) var attributes: [String: String] = [:]
|
||||
/// Every `*cupsFilter` / `*cupsFilter2` line, in order, with the quotes removed.
|
||||
public private(set) var filterLines: [(keyword: String, value: String)] = []
|
||||
|
||||
public init(text: String) {
|
||||
var defaults: [String: String] = [:]
|
||||
@@ -122,6 +124,9 @@ public struct PPD {
|
||||
let (choice, label) = Self.splitText(String(parts[1]))
|
||||
current!.choices.append(choice)
|
||||
current!.choiceList.append(Choice(keyword: choice, text: label ?? choice))
|
||||
} else if parts.count == 1, mainKey == "cupsFilter" || mainKey == "cupsFilter2" {
|
||||
filterLines.append((mainKey, value.trimmingCharacters(in: CharacterSet(charactersIn: "\""))))
|
||||
if attributes[mainKey] == nil { attributes[mainKey] = filterLines.last!.value }
|
||||
} else if parts.count == 1, attributes[mainKey] == nil {
|
||||
attributes[mainKey] = value.trimmingCharacters(in: CharacterSet(charactersIn: "\""))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user