[Libreoffice] Printer handling

Francois Tigeot ftigeot at wolfpond.org
Fri Jul 8 23:52:29 PDT 2011


Hi,

The printer handling code in
libs-gui/vcl/unx/generic/printer/printerinfomanager.cxx gets the list of
print queues with a combination of hardcoded platform names and shell
commands :

  #if defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD)
  { "/usr/sbin/lpc status", "lpr -P \"(PRINTER)\"", "", ":", 0, standardSysQueueTokenHandler },
  { "lpc status", "lpr -P \"(PRINTER)\"", "", ":", 0, standardSysQueueTokenHandler },
  { "LANG=C;LC_ALL=C;export LANG LC_ALL;lpstat -s", "lp -d \"(PRINTER)\"", "system for ", ": ", 1, standardSysQueueTokenHandler }
  #else
  { "LANG=C;LC_ALL=C;export LANG LC_ALL;lpget list", "lp -d \"(PRINTER)\"", "", ":", 0, lpgetSysQueueTokenHandler },
  { "LANG=C;LC_ALL=C;export LANG LC_ALL;lpstat -s", "lp -d \"(PRINTER)\"", "system for ", ": ", 1, standardSysQueueTokenHandler },
  { "/usr/sbin/lpc status", "lpr -P \"(PRINTER)\"", "", ":", 0, standardSysQueueTokenHandler },
  { "lpc status", "lpr -P \"(PRINTER)\"", "", ":", 0, standardSysQueueTokenHandler }
  #endif

There are also some other things like this I don't like in this file:

  /*  TODO:
   *  porters: please append your platform to the Solaris
   *  case if your platform has SystemV printing per default.
   */

Trying to manage printers in one way or another depending on the operating
system name feels incredibly wrong for application code.

Shouldn't CUPS be the default printing system anywhere by now on Unix-like
systems ? Is there a reason to keep this sort of code as-is ?

-- 
Francois Tigeot


More information about the LibreOffice mailing list