[Development] Is Qt allowed caching the home dir path?

Thiago Macieira thiago.macieira at intel.com
Sun Oct 27 22:55:46 CET 2013


On domingo, 27 de outubro de 2013 22:51:59, Jiergir Ogoerg wrote:
> But looking at its source code [1] and since this was a micro-optimization
> to begin with, I guess it's
> not worth bothering caching the home dir path.

Since QDir::homePath() needs to be thread-safe, you need to use 
Q_GLOBAL_STATIC because it is thread-safe.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- 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://lists.qt-project.org/pipermail/development/attachments/20131027/ea54c787/attachment.sig>


More information about the Development mailing list