libkdeprint
John Layt
johnlayt at yahoo.com.au
Sat Nov 3 17:23:53 GMT 2007
On Saturday 03 November 2007, Kurt Pfeifle wrote:
> Are you saying you detect the cupsd.conf config file? And doing so by
> searching the local file system?
>
> If so, that is not "good enough". The CUPS daemon to connect to may not
> be running locally, but on a remote server.
>
> Also, does the code take into account that the local cupsd may not at
> all listen at a TCP/UDP port, but only at a local unix domain socket?
The KDE3 KDEPrint code which I copied tries to connect to a local UNIX socket
with a path of /ipp, and checks if cupsd.conf exists in various locations.
Both have to be true for it to believe it can talk to CUPS:
KMFactory::autoDetect()
KMFactory::pluginList()
KMFactory::pluginInfo()
KdeprintChecker::check()
using details in kdeprint/cups/cups.print
Is there a file that we can reliably say will be installed locally even if the
daemon is on a remote server?
I'm assuming the CUPS versions of lp and lpr will transparently know how to
talk to the remote server?
> Can't you look if that lpr binary is linked to libcups? On a shell I'd
> do the "ldd $(which lpr)|grep libcups" test...
I'll look into that, would this work on all the *nix platforms?
> KDEPrint3 didn't use the CUPS lpr/lp commands at all. It knew how to
> talk IPP to CUPS, and it used "cupsdoprint" as a helper utility.
Well, there's a couple of good reasons not to talk directly to CUPS/IPP,
mainly because FilePrinter wll not be in kdelibs for 4.0 but will instead be
added to every application that wants to use it, i.e. okular, kghostview,
ligature. If we had to build a cupsdoprint in every one of those apps, each
of them would pick up a compile-time dependency on CUPS, and we would have to
give cupsdoprint a different name for each to avoid install clashes. When
you then consider that the few user options we can currently pull out from
QPrintDialog are all supported by the lpr command line, it just seemed the
simplist solution.
Now, if we still need this in 4.1, then obviously it will move to kdelibs and
we can then do it properly through cupsdoprint, but we'll cross that bridge
later.
With regard to lp, it's always installed with CUPS? What's its status if CUPS
isn't installed? We could always just try a succession of calls to lp and
lpr with and without the options hoping one will work :-)
John.
--
Send instant messages to your online friends http://au.messenger.yahoo.com
More information about the kde-core-devel
mailing list