MCPcopy Create free account
hub / github.com/cztomczak/cefpython / GetPrinterWithName

Method GetPrinterWithName

src/subprocess/print_handler_gtk.cpp:116–128  ·  view source on GitHub ↗

Can return NULL if the printer cannot be found due to: - Printer list out of sync with printer dialog UI. - Querying for non-existant printers like 'Print to PDF'.

Source from the content-addressed store, hash-verified

114 // - Printer list out of sync with printer dialog UI.
115 // - Querying for non-existant printers like 'Print to PDF'.
116 GtkPrinter* GetPrinterWithName(const std::string& name) {
117 if (name.empty())
118 return NULL;
119
120 for (std::vector<GtkPrinter*>::iterator it = printers_.begin();
121 it < printers_.end(); ++it) {
122 if (gtk_printer_get_name(*it) == name) {
123 return *it;
124 }
125 }
126
127 return NULL;
128 }
129
130 private:
131 // Callback function used by gtk_enumerate_printers() to get all printer.

Callers 1

OnPrintSettingsMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected