Enhancement: KLineBufferedProcess

Thiago Macieira thiago at kde.org
Wed Mar 12 07:42:17 GMT 2008


Rolf Eike Beer wrote:
>Oswald Buddenhagen wrote:
>> On Fri, Mar 07, 2008 at 04:13:40PM +0100, Rolf Eike Beer wrote:
>> > The idea behind this class is to receive the data from the process
>> > and buffer it. A signal is emitted only if a complete line of data
>> > is available.
>>
>> fwiw, in qt 4.4, the combination of kprocess + qtextstream should work
>> reliably.
>
>Well, that would not help anyone who could find arbitrary 8 bit
> characters in the output so he needs the result as a QByteArray. For
> the GPG output I should be able to write a QTextCodec that handles this
> stuff. Thanks for the hint.
>
>Nevertheless I have attached a version that actually works (tested with
> KGpg). The other one was a bit hacky since the people at the booth
> confused me ;)

Is the QProcess being opened in QIODevice::Text mode? If not, you have to 
handle CRLF too.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080312/742b373e/attachment.sig>


More information about the kde-core-devel mailing list