From 4cba08df513e6c52ba4962a0770ef1ff8a68f940 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 10 Jan 2019 16:32:31 -0500 Subject: [PATCH] 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. --- src/preferences/printers/AddPrinterDialog.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/preferences/printers/AddPrinterDialog.cpp b/src/preferences/printers/AddPrinterDialog.cpp index 395b692454..b03cae67f0 100644 --- a/src/preferences/printers/AddPrinterDialog.cpp +++ b/src/preferences/printers/AddPrinterDialog.cpp @@ -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);