Chromium Code Reviews| Index: printing/backend/print_backend_cups.cc |
| diff --git a/printing/backend/print_backend_cups.cc b/printing/backend/print_backend_cups.cc |
| index 9b6976c0700c5df0b16a359332631368001ee9b0..f242da714e37995c1b4a9ed2d1f7fe351caf38a2 100644 |
| --- a/printing/backend/print_backend_cups.cc |
| +++ b/printing/backend/print_backend_cups.cc |
| @@ -156,10 +156,10 @@ bool PrintBackendCUPS::EnumeratePrinters(PrinterList* printer_list) { |
| } |
| std::string PrintBackendCUPS::GetDefaultPrinterName() { |
| - // TODO(thestig) Figure out why cupsGetDefault() lies about the default |
| - // printer. :-( |
| - // Return an empty string for now. |
| - return std::string(); |
| + cups_dest_t *dests; |
| + int num_dests = cupsGetDests(&dests); |
| + cups_dest_t* dest = cupsGetDest(NULL, NULL, num_dests, dests); |
| + return dest ? std::string(dest->name) : std::string(); |
|
Lei Zhang
2011/06/08 00:41:59
I'm glad you found a reliable way to get the defau
dpapad
2011/06/08 16:33:56
Done.
|
| } |
| bool PrintBackendCUPS::GetPrinterCapsAndDefaults( |