Vincent van Ravesteijn wrote:
I'd do rather something like this. The only time we care about caching is when we are really interested in a file's existence.
I see the motivation, but this will slow down other operations. E.g., access to absoluteFilename() won't be cached unless we've checked for existence. Is that right?

This does solve your problem? If so, then at least we know the exists() check is the culprit.

rh

diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp
index 65c682c..9187814 100644
--- a/src/support/FileName.cpp
+++ b/src/support/FileName.cpp
@@ -105,7 +105,6 @@ struct FileName::Private
Private(string const & abs_filename) : fi(toqstr(abs_filename))
        {
-               fi.setCaching(fi.exists() ? true : false);
        }
        ///
inline void refresh() @@ -279,7 +278,9 @@ FileName FileName::fromFilesystemEncoding(string const & name) bool FileName::exists() const
 {
-       return d->fi.exists();
+       bool const exists = d->fi.exists();
+       fi.setCaching(exists);
+       return exists;
 }

Vincent

Reply via email to