KIO error system question

Waldo Bastian bastian at kde.org
Tue Apr 9 21:12:04 BST 2002


On Tuesday 09 April 2002 04:21 am, Hamish Rodda wrote:
> I'm in the process of working in a way for kioslaves to report errors in
> detail to fit in with the error documentation work I did a while back. What
> I'm trying to accomplish is the following:
>
> When a slave emits error(), it sends a QString errorText. I want to be able
> to send more structured data (a few QStrings and QStringLists) through
> errorText, and tried creating a QByteArray and QDataStream in order to
> stream these objects into the errorText QString.
>
> The problem is that the resulting QByteArray has lots of zero-value chars
> in it, so when the QString is created to send back, it is of length zero.

You treat the raw-data as utf8 and utf8 is null-terminated.

> Can anyone think of a fix for this (or a better way to do it)?

You say "structured data", I say "XML".

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





More information about the kfm-devel mailing list