After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693186 - GNOME Printer Setup Tool: HP printers discovered by both usb and hp CUPS backends -> prefer hp backend
GNOME Printer Setup Tool: HP printers discovered by both usb and hp CUPS back...
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Printers
3.6.x
Other Linux
: Normal major
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
3.10
Depends on:
Blocks:
 
 
Reported: 2013-02-05 08:52 UTC by Till Kamppeter
Modified: 2015-07-13 10:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't show the same device multiple times (13.97 KB, patch)
2015-05-25 13:01 UTC, Marek Kašík
committed Details | Review

Description Till Kamppeter 2013-02-05 08:52:15 UTC
I have several HP printers. If I connect one of them via USB and click the "+" button to add a new printer in GNOME's printer setup tool, I get two entries where a user will not see the difference:

HP-LaserJet-3390
HP-LaserJet-3390-2

To find out why I got two entries, I added two print queues, one using the first entry, another using the second entry. Then I ran the command

lpstat -v

and got

device for HP-LaserJet-3390: usb://HP/LaserJet%203390?serial=00CNMJP81545
device for HP-LaserJet-3390-2: hp:/usb/HP_LaserJet_3390?serial=00CNMJP81545

So the first comes from the HP LaserJet 3390 discovered via the "usb" CUPS backend and the second from the same printer via the "hp" backend.

The preferred backend is the latter, as it is made by HP especially for HP printers. Therefore there should be only one entry, using the "hp" backend. system-config-printer does this correctly, so using the D-Bus service of system-config-printer one should be able to join these entries to one using the "hp" backend.

Note that this is not a duplicate of bug 693183. That bug is about making duplicate entries distinguishable, this bug is about making the "hp" backend used with HP printers.

Also reported at Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1115701
Comment 1 Matthias Clasen 2013-02-05 13:32:20 UTC
sounds like a bug in the printing system (ie cups) - if the there is a preferred backend, it should be used. We don't want to let the user play guessing games as to which driver to use.
Comment 2 Till Kamppeter 2013-02-05 20:00:16 UTC
Problem is that CUPS runs all backends in turn and lists all the backend's discovery results. There is no information about what has priority. system-config-printer knows the priorities and joins the entries coming from the same printers and selects the preferred entry as default. Using the D-Bus service of system-config-printer one should be able to join the two entries to one using the hp backend.
Comment 3 Marek Kašík 2015-05-25 13:01:09 UTC
Created attachment 303922 [details] [review]
Don't show the same device multiple times

The 'New printer dialog' already uses the 'GroupPhysicalDevices' method but the list of devices passed into it was wrong. Attached patch fixes the problem by passing all discovered devices to it and by replacing an existing device in the list by a better alternative if there is any.

Another problem related to this could be the one from https://bugzilla.gnome.org/show_bug.cgi?id=749830.
Comment 4 Bastien Nocera 2015-07-10 14:09:37 UTC
Review of attachment 303922 [details] [review]:

Looks fine to me. Don't forget to cherry-pick in earlier versions.
Comment 5 Marek Kašík 2015-07-13 10:11:06 UTC
Comment on attachment 303922 [details] [review]
Don't show the same device multiple times

(In reply to Bastien Nocera from comment #4)
> Review of attachment 303922 [details] [review] [review]:
> 
> Looks fine to me. Don't forget to cherry-pick in earlier versions.

Thank you for the review. I've pushed the patch into master, 3.16 and 3.14.