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

Jiergir Ogoerg f35f22fan at gmail.com
Sun Oct 27 23:12:36 CET 2013


Yep, I know, the solution I proposed was also thread safe, but it didn't
require a lock/unlock
on each function call or extra memory structs around it.
Anyway, I stumbled across the home
path thingy as a side effect of looking into a different Qt issue (startup
time, which is
pretty much unrelated to this issue) so I'll leave this (non-)issue for
later cause the
Qt start up time to me is far more important.



On Sun, Oct 27, 2013 at 11:55 PM, Thiago Macieira <thiago.macieira at intel.com
> wrote:

> 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
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131028/57e8bd81/attachment.html>


More information about the Development mailing list