Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make printer instances work again #5679

Closed
wants to merge 2 commits into from
Closed

Make printer instances work again #5679

wants to merge 2 commits into from

Conversation

michaelweghorn
Copy link
Contributor

Hi Mike,

since commit c5f5c5a, printer instances don't work anymore.

They can be created, e.g. using

lpoptions -p myprinter/myinstance -o Duplex=None

and then show up in ~/.cups/lpoptions. However, they are not listed when e.g. running lpstat -v or in print dialogs.

These two commits make printer instances work again for the case where queues from the local CUPS server are used.

Handling of instances for autodiscovered printers might need a follow-up commit. I wasn't 100 % sure about this, so left it unchanged.

Move the code to read dests from global and user lpoptions
files to a separate function 'cups_get_dests_from_lpoptions'.
This is to avoid duplication, in particular since the same
functionality will be used again in a follow-up patch.

Move the related comment in 'cups_enum_dests' to the place
where the lpoptions files are actually evaluated.
... after commit c5f5c5a
("The `cupsEnumDests` function did not include options from the
lpoptions files (Issue #5144)") had moved option reading
to function 'cups_enum_dests'.

Move the reading of dests after the call to '_cupsGetDests' and
use 'dests' and 'num_dests' directly instead of 'data.dests' and
'data.num_dests', so that the printer instances and options from
the lpoptions files are taken into account right away.

Applying user options in an extra step is no longer necessary with
this approach, so drop the corresponding loop.

This makes printer instances work again for printers retrieved
from the CUPS server. It leaves the DNSSD/Avahi case unchanged for
now.
@michaelrsweet
Copy link
Collaborator

Sorry, that change has some bad side-effects. I will push a simpler fix to cups_enum_dests against the parent bug...

@michaelrsweet michaelrsweet self-assigned this Nov 14, 2019
@michaelrsweet michaelrsweet added the wontfix This will not be worked on label Nov 14, 2019
@michaelweghorn
Copy link
Contributor Author

Fine for me, thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants