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

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to