Skip to content

Add lpoptions support and destination/job improvements - #22

Merged
tillkamppeter merged 3 commits into
OpenPrinting:mainfrom
Abd002:cups3-pr-lpoptions
Sep 17, 2026
Merged

tillkamppeter merged 3 commits into
OpenPrinting:mainfrom
Abd002:cups3-pr-lpoptions

Conversation

@Abd002

@Abd002 Abd002 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

1. fix(destination): free the options cupsCopyDestInfo actually allocated

get_detailed_info and is_option_supported freed the options pointer they
built before calling cupsCopyDestInfo, but that call can reallocate the
options array internally. Free what the struct points to afterward instead.

2. feat(destination): read and write default and per-destination lpoptions

Adds Destinations::named_destination, default_destination_name,
set_destination_option, and clear_default_destination. The default-name
lookup follows libcups' own precedence ($LPDEST/$PRINTER, user lpoptions,
system lpoptions, scheduler default) via cupsGetNamedDest rather than
reading files directly, so it stays correct on a machine with different CUPS
directories.

3. refactor(job): keep a job's own destination instead of re-resolving it by name

Job now owns the Destination it was created from instead of storing its
name and re-resolving it on every operation. This also removes a separate
is_accepting_jobs() pre-check that raced against the real state — CUPS's
own server-error-not-accepting-jobs response is now mapped to
Error::PrinterNotAccepting directly.

@tillkamppeter
tillkamppeter merged commit 475d7a4 into OpenPrinting:main Sep 17, 2026
2 of 3 checks passed
@Abd002
Abd002 deleted the cups3-pr-lpoptions branch September 24, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants