diff options
author | Shane Kearns <ext-shane.2.kearns@nokia.com> | 2012-01-17 19:51:39 +0000 |
---|---|---|
committer | Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com> | 2012-01-26 10:33:41 +0100 |
commit | afa6fdbb29196b42f3c987626eecaaeb3d3049e0 (patch) | |
tree | e09703f7f03eb1e83c985abac5a6f3d7bff69c49 /src/corelib/io/qfileinfo_p.h | |
parent | 943dc8e4a58a32a5b5a14c456d60bd3601e42618 (diff) | |
download | qt4-tools-afa6fdbb29196b42f3c987626eecaaeb3d3049e0.tar.gz |
Fix BC break with QAbstractFileEngine "mount points"
File system cached metadata can't be trusted when custom file engines
are in use, because the custom file engine may want to override the
metadata. (e.g. present an archive file as a directory)
Therefore, check if a file engine should be instantiated for each
result in QDirIterator. This is a fast check if no custom file engines
are registered.
When pushing a directory (using QDirIterator::SubDirectories) the
file engine needs to be instantiated also.
Task-number: QTBUG-23688
Task-number: ou1cimx1#965023
Change-Id: I0114c8df6258535553783a2486131c4194926649
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
(cherry picked from commit 3864ad09d578210b52e5f58fca2ee8a1144f5be2)
Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
Diffstat (limited to 'src/corelib/io/qfileinfo_p.h')
-rw-r--r-- | src/corelib/io/qfileinfo_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h index 23ea0225f5..4f97ca3044 100644 --- a/src/corelib/io/qfileinfo_p.h +++ b/src/corelib/io/qfileinfo_p.h @@ -108,10 +108,15 @@ public: : QSharedData(), fileEntry(file), metaData(data), + fileEngine(QFileSystemEngine::resolveEntryAndCreateLegacyEngine(fileEntry, metaData)), cachedFlags(0), isDefaultConstructed(false), cache_enabled(true), fileFlags(0), fileSize(0) { + //If the file engine is not null, this maybe a "mount point" for a custom file engine + //in which case we can't trust the metadata + if (fileEngine) + metaData = QFileSystemMetaData(); } inline void clearFlags() const { |