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

List:       kde-devel
Subject:    KProcess update
From:       Christian Czezatke <e9025461 () student ! tuwien ! ac ! at>
Date:       1998-01-08 23:41:57
[Download RAW message or body]

Hi!

In December, Kalle checked in a new version (0.3.0) of KProcess which
introduced some changes. Programmers, whose applications programs have
been directly affected by that changes have already got a patch for it. 

Right now, I'm checking in yet another version of KProcess (0.3.1) that is
basically a maintainence update. 

However, 0.3.0 introduced the following semantic changes to KProcess
itself that should IMHO be pointed out to KDE developers:

-- KProcess::clearArguments -- Semantics have slightly changed:
   It now removes the executable that is assigned with
   "setExecutable"too.       

-- the use of "setExecutable"  is now depreceated. Use the
   "operator<<" to assign the executable instead. For example,
   turn the sequence

     p.setExecutable("kghostview");
     p << "tiger.ps";

   into:

     p << "kghostview" << "tiger.ps";   

-- Changed a lot of stuff from private to protected in order to
   make deriving classes from KProcess easier.

Please note that there is also a "KShellProcess" class now that easily
allows you to do things like "ls ~/$HOME/*.lyx | sort | uniq | wc -l" 
with it. 

I've also fixed a few minor bugs in 0.3.1. The great news about 0.3.1 is
the new and improved documentation of KProcess. It is now optimized for
KDoc. 

Furthermore all member functions are now fully documented. It even
provides some documentation for the brave-hearted who like to derive new
classes from it.

Right now I'm not particularly happy with the interface of KProcess
concerning deriving classes from it. I'll try to have a look at Johannes
Sixt's gdb frontend that is already making use of KProcess-derived
classes, AFAIK. 

I would like to say thank you to Johannes Sixt who has provided really
valuable suggestions and bug fixes. He even managed to convince me that it
does indeed make sense to derive classes from KProcess... ;-) 

Please email all your comments and suggestions about K*Process classes
to me. 

A full changelog for KProcess (since 0.2.2 from Aug, 31st 1997) is
appended at the end of this email.

     Christian


VERSION 0.3.1 (Jan, 8th 1998)

-- Vastly improved the documentation. All member functions are now 
   fully documented. Documentation checked with newest release of KDoc. 

-- in order to make the new "writeStdin" check work, "K*Process::start"
   now discards an eventually remaining buffer for writing to the child's
   stdin after forking.

-- added explicit check for an empty command line in "KProcess::start"
   and "KShellProcess::start"

-- added explicit check to avoid "writeStdin" being called before a
   previous "writeStdin" has completed.

-- Added workaround for a problem with egcs 1.0 and the WIFEXITED 
   macro in kprocctrl.cpp (Kalle Dalheimer)

-- Fixed a bug in KProcessControler's (UN*X) signal handler to avoid a
   potential race condition. (Johannes Sixt)

VERSION 0.3.0 (Nov, 23rd 1997)

-- introduced a new class called "KShellProcess" that is derived from 
   KProcess. -- It tries to find a valid shell (see 0.2.5 changes) and
   executes the process with the "-c" command of the shell. So pipes
   and variable substitutions work with KShellProcess!

-- KProcess::clearArguments -- Semantics have slightly changed:
   It now removes the executable that is assigned with
   "setExecutable"too. 
   

-- the use of "setExecutable"  is now depreceated. Use the
   "operator<<" to assign the executable instead. For example,
   turn the sequence

     p.setExecutable("kghostview");
     p << "tiger.ps";

   into:

     p << "kghostview" << "tiger.ps";

-- Removed the SHELL -- execution stuff from 0.2.5 again

-- Made all private members of KProcess protected and made some 
   KProcess member functions virtual (see kprocess.h for details)
   due to popular demand

-- DontCare Processes are now run in their own process group to avoid
   a SIGSTP being sent to the process group if the child process tries
   to do direct terminal I/O. (Matthias Ettrich)

VERSION 0.2.5 (Oct, 13th 1997, not released)

-- updated kprocesstest.cpp: Added an example for using the new
   shell--mode execution. 

-- updated kprocesstest.cpp: It now refuses to work with Qt 1.2/1.21

-- added support for executing commands using a shell. Instead of
	p.setExecutable("/bin/sh");
	p << "-c" << "<my_shell_commandline>";

   you can now do a:
	p.useShell();
	p << "my_shell_command";

   useShell will also search for the shell to use in several places
   (in the following order):
	+) The SHELL environment variable
	+) The SHELL environment variable with whitespaces stripped
	+) "/bin/sh" as a last ressort
   If none of these yields a fully qualified path to a shell
   we could use, "useShell" returns FALSE.

   (See the KProcess documentation for more details).

--------------------------------------------------------------------
| Christian Czezatke, Student of Computer Science at the Vienna    |
| University Of Technology.                                        |
|------------------------------------------------------------------|
| email: e9025461@student.tuwien.ac.at                             |
--------------------------------------------------------------------

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

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