Always query current CUPS default printer #33
Merged
+3
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When asked for the default printer, always
query and return the current CUPS default
printer instead of whatever was the default
last time this was done, to take into account
that the CUPS default printer can change while
the backend is running.
Sample steps (without this commit in place)
to reproduce an incorrect default
printer being returned with cpdb-text-frontend
from cpdb-libs, when the PDF printer is initially
set as default:
Run cpdb-text-frontend:
Query for the default printer
Now, switch the CUPS user default printer
to another one:
In the running cpdb-text-frontend instance,
query the default printer again:
-> The outdated/previous default printer was returned.
With this commit in place, the new default
printer is now returned as expected:
(This addresses part of issue 3) from comment [1] on the pending change to update CPDB support in LibreOffice.)
[1] https://gerrit.libreoffice.org/c/core/+/169617/comments/3ef76e40_4f120b66