[Development] Is Qt allowed caching the home dir path?
f35f22fan at gmail.com
Sun Oct 27 03:53:41 CET 2013
It looks like only the home and temp dir paths are worth caching, their
window$ implementation is ~ 30-40 lines of code
if counting QDir's subcalls to QFileSystemEngine.
For these two QDir functions to stay one liners and lock-less (while thread
safe), I'm caching the paths in QDirPrivate
static void initPaths();
static QString homePath;
static QString tempPath;
homePath = QFileSystemEngine::homePath();
tempPath = QFileSystemEngine::tempPath();
and initiating the variables once when the program starts when it's still
in single thread mode in QCoreApplication::init()
QCoreApplication::self = this; // after this line
Does it sound plausible?
On Sat, Oct 26, 2013 at 10:14 PM, Thiago Macieira <thiago.macieira at intel.com
> On sábado, 26 de outubro de 2013 21:58:10, Jiergir Ogoerg wrote:
> > That is, it calls other (sub)functions to perform search, copy and
> > up the string which makes me
> > wonder if it's OK for Qt caching the home dir path as long as the Qt
> > library runs?
> Yes, caching is fine, since the user shouldn't really be doing
> It's very unlikely.
> Thiago Macieira - thiago.macieira (AT) intel.com
> Software Architect - Intel Open Source Technology Center
> Development mailing list
> Development at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Development