solid i18n krazy2 patch

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Fri Jan 23 15:14:59 GMT 2009


Dominik Haumann schrieb:
> On Saturday 17 January 2009, Armin Moradi wrote:
>> Attached is some fixes for the i18n problems which krazy2 (from EBN)
>> has detected.
>>
>> This patch includes fixes for "passing QString() to endsWith() and
>> startsWith()" problems.
> 
> Before your patch, the strings are implicitely converted to a QString, which 
> is exactly the same as what your patch does now :) The right fix (if there 
> is need for a 'fix' at all) would be to use QLatin1String, just like Stefan 
> mentioned already.
> 
> What does krazy exactly say as warning? I wonder because such patches with 
> QString wrappers appear on lots of our mailing lists and they don't bring 
> any performance boost. It's simply less readable :)
> 
krazy says they should use QLatin1String() instead - so the patch is wrong.
The idea behind this is to avoid the QTextCodec conversion from locale
encoding (which can be different on every machine but is mostly utf-8 on
linux) to Unicode and use the fast QString::fromLatin1() function instead.


Christian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090123/01d3b809/attachment.sig>


More information about the kde-core-devel mailing list