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

List:       kmail-devel
Subject:    Re: [PATCH] Fixes Bug#39626: kmail silently (!) stops saving huge attachments after ~ 1MB is written
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <ingo.kloecker () epost ! de>
Date:       2002-04-02 22:07:05
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 02 April 2002 21:26, Stephan Kulow wrote:
> On Dienstag, 2. April 2002 13:15, Marc Mutz wrote:
> > On Tuesday 02 April 2002 12:15, Stephan Kulow wrote:
> > <snip>
> >
> > > Why do you need to do duplicate()? assign() should do - and be
> > > faster and less memory hungy, even though the memory problem is
> > > limited to 64KB now
> > >
> > > :)
> >
> > <snip>
> >
> > Using assign() would steal the assigned 64k chunk from the big
> > QByteArray, that owns it. Nasty boy. Don't. ;-)
>
> OK, I meant setRawData :)

- From the Qt docu the usage of setRawData seems to be very dangerous. 
Especially as I can't know what KIO::connection (or whoever requests 
the data) does with the QByteArray. Quote from the docu: "Do not 
attempt to resize or re-assign the array data when raw data has been 
set.".
Furthermore resetting the QByteArray with resetRawData isn't possible 
because we obviously can't reset it after returning it to the caller.

We could of course change dataReq to use a char* instead of a 
QByteArray. Simply passing around a pointer would be much safer. Not. 
;-)

Regards,
Ingo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8qiuJGnR+RTDgudgRAtw6AKC3HU0/D+nQ8LIP6oLuVAElEqz/WQCeIbJ0
XkpRJx6c77074dEmphHsiTo=
=zyf4
-----END PGP SIGNATURE-----
_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread] 

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