Ignore 'Printer-added' notifications for queues created by cups-browsed
Hi,
there are Ubuntu reports - 1869981 1878241 - about duplicate notifications for print queues, which are created by cups-browsed
.
The duplicate notifications appear when cups-browsed
is restarted for a brief moment, e.g. logrotate, cupsd
restart, and can be annoying for users.
Since it is not possible to recognize whether notifications for cups-browsed queues are valid or not, in my opinion the best course of action is to ignore them.
The patch is using 'cups-browsed'
option, which is in every cups-browsed managed queue - gsd will not create a notification for a queue which has the option set to 'on'/'true'/'yes'. Since cups-browsed connects only to local cupsd
when creating queues (so its queues are only on local cupsd
), it makes sense to use CUPS_HTTP_DEFAULT
in cupsGetNamedDest()
call - it stands for localhost. Either way the new function - is_cupsbrowsed_dest()
- is called in a condition where it is in AND relation with is_local_dest()
, so even if a dest wouldn't be a local one, shortened evalution will not call the new function.
Please let me know whether I should change something.
If it is okay, would you mind adding the patch to the project?
I tested it manually (I'm not sure whether g-s-d has a test-suite for it) - I added a new printer via control-center, notification was shown with old and patched g-s-d, then started cups-browsed and old g-s-d showed a notification and the patched didn't.
Thank you in advance!
Zdenek