[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: A print daemon ? (was: Detaching a KProcess ? Cancelling app exit ?)
From:       Waldo Bastian <bastian () kde ! org>
Date:       2001-04-30 17:33:41
[Download RAW message or body]

On Monday 30 April 2001 05:09, Michael Goffioul wrote:
> > If the application is just sitting there without any print-specific
> > progress dialog, I would not expect that quiting the application at that
> > point would have any effect on my ongoing print-job.
> >
> > So in that case I would go for detaching unconditionally.
>
> There's still a significant drawback to detaching running print processes:
> error report. The main program listens for processes termination and then
> report any error. If the main program exits and running processes are
> detached, no error report is possible.
>
> Then the idea of a print daemon taking care of print processes. Every print
> job can be reduced to a command line (even with preprocessing filters,
> using pipes, I'm currently working on it). It's then possible to send the
> command string to the print daemon for execution. This daemon can also
> handle temp file removal (I still have some problems with that).
> This daemon should be rather small, its job only being:
>   - to receive print command to execute through a shell, and listen for
>     process termination
>   - on process termination: report any error through KNotify and/or remove
>     any temporary file.
>
> Would it be a good idea ? Thanks for any comment.

Yes, in that case I suggest you make it a KDEDModule. KDEDModules are 
automatically loaded on demand and you can easily unload them. They run as 
part of the kded process, so you have low overhead.

On the application side all you would need is a dcop call like:

dcopClient()->call("kded", "kprintdaemon", "printThis(QString)", ....)

kded will then automatically load the "kprintdeamon" module and pass the call 
on.

See kdelibs/kio/kded/

Cheers,
Waldo
-- 
bastian@kde.org | SuSE Labs KDE Developer | bastian@suse.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic