Review kdelibs whiting/fixQByteArrays

Thiago Macieira thiago at kde.org
Mon May 2 15:05:56 BST 2011


Em Monday, 2 de May de 2011, às 14:59:02, David Faure escreveu:
> +[...] XInternAtom( disp, QByteArray( QByteArray( msg_type_P ) + "_BEGIN" )
> );
> 
> Ah it's because XInternAtom takes a const char*, so in theory this should
> even  be QByteArray( QByteArray( msg_type_P ) + "_BEGIN" ).constData()

You can also write:

	(QByteArray( msg_type_P ) + "_BEGIN").constData();

> ...
> 
> Another one:
> 
> -      envs << QString::fromLatin1( QByteArray("DISPLAY=") + dpystring );
> +    envs << QString::fromLatin1( QByteArray(QByteArray("DISPLAY=") + 
> dpystring) );

Same:
	QString::fromLatin1((QByteArray("DISPLAY=") + dpystring).constData());

This will make one copy less.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      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: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110502/5b817452/attachment.sig>


More information about the kde-core-devel mailing list