[PATCH] KProcess port of khelpcenter

Ralf Habacker ralf.habacker at freenet.de
Sun Dec 16 20:49:27 GMT 2007


Oswald Buddenhagen schrieb:
> On Thu, Dec 13, 2007 at 06:43:25PM +0100, Ralf Habacker wrote:
>   
>> appended is a patch which ports KHelpcenter to KProcess.
>>     
a major problem of porting K3Process to KProcess is that KProcess does 
not provide a pointer to the K3Process in the exit signal.

void TOC::meinprocExited( K3Process *meinproc )

This makes it able to identify the object and destroy it in the related 
slot.

In KProcess there is no such signal available which requires to have a 
KProcess pointer be defined in the related class and additional effort 
to handle multiple calls. As an alternative a List of KProcess pointer 
could be used, but how could the related KProcess object be detected in 
the finish slots ?  (Because of this I refactored searchhandler.cpp/h to 
have a single KProcess instance in each SearchJob)

Another approach would be extend KProcess or create a subclass of 
KProcess, which provides signals containing the KProcess instance

How to proceed ?

Another issue is the multibyte handling described in 
http://techbase.kde.org/Development/Tutorials/Common_Programming_Mistakes#Reading_QString_from_a_KProcess. 


Wouldn't it be better to implement specific signals in KProcess or a 
subclass to avoid that this has to be fixed on every place where 
KProcess is needed ?

Ralf




More information about the kde-core-devel mailing list