KProcess Line Mode Patch

Ralf Habacker ralf.habacker at freenet.de
Mon Dec 1 11:32:08 GMT 2008


Hi,

based on the work described on 
http://lists.kde.org/?l=kde-core-devel&m=120522889930459&w=2 there is a 
patch appended which implements a line buffering mode directly in KProcess.
The advantage of this approach is that this feature is directly 
available from kdecore and therefore no additional class located 
somewhere in the related package source is required.

 How it works:

1.Line buffering mode ist enabled with the

    void setOutputLineMode(bool mode);

2.There are new KProcess signals available which indicates available lines.

    void readyReadLineStandardOutput();
    void readyReadLineStandardError();

3. The lines could be fetched with

    QStringList &readLinesStandardOutput(QStringList &out=QStringList());
    QStringList &readLinesStandardError(QStringList &out=QStringList());

4. non standard line delimiters could be set by

    void setOutputLineDelimiter(QString &delim=QString());

Any comments or objections ?

Ralf

 


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kprocess-output-linemode.patch
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081201/c764212c/attachment.ksh>


More information about the kde-core-devel mailing list