Printers: Allow adding IPP printers even if none are detected.

Yes, this is kind of hacky to put the printer driver as a special case
in here, but we already do this for the Preview driver, and IPP's
printer detection is pretty broken, whereas adding a printer URL manually
seems to still work.

Works around #12702.
This commit is contained in:
Augustin Cavalier 2019-01-10 16:32:31 -05:00
parent daa6582acb
commit 4cba08df51

View File

@ -369,9 +369,11 @@ AddPrinterDialog::_FillTransportMenu(BMenu* menu)
msg.MakeEmpty();
msg.what = B_GET_PROPERTY;
msg.AddSpecifier("Ports");
if (transport.SendMessage(&msg, &reply) != B_OK ||
reply.FindInt32("error", &error) != B_OK ||
error != B_OK) {
if (transport.SendMessage(&msg, &reply) != B_OK
|| reply.FindInt32("error", &error) != B_OK
|| error != B_OK
|| (transportName == "IPP"
&& reply.FindString("port_id", &portId) != B_OK)) {
// Transport does not provide list of ports
BMessage* menuMsg = new BMessage(kTransportSelectedMsg);
menuMsg->AddString("name", transportName);