inefficient QString coding practice

Adriaan de Groot adridg at sci.kun.nl
Sat Mar 13 13:09:06 GMT 2004


On Sat, 13 Mar 2004, Dr. Juergen Pfennig wrote:
> But often I find code fragments like:
>
>   if (extension == QString::fromLatin1(".wav"))
...
> Conclusion: let QT do the job - and change code like the example above to keep
> KDE small and fast.

That's an interesting point, _if_ there is a way to find out when there is
such a method available (including in old code). See, going through and
removing all the ::fromLatin1()s and seeing if it compiles is _not_  a
pleasant job (and don't forget the effect QT_NO_CAST_ASCII and
_NO_ASCII_CAST have).

IOW, file a JJ (see the Quality Team pages), send patches for the cases
you find relevant, or create a tool to flag these things.





More information about the kde-core-devel mailing list