summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorShane Kearns <ext-shane.2.kearns@nokia.com>2012-01-17 19:51:39 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-01-25 03:06:04 (GMT)
commit3864ad09d578210b52e5f58fca2ee8a1144f5be2 (patch)
treed98f54d4f65aa8a6733be3788410ec5318615757 /src/corelib
parent3aef11802c5f4ca0f3bde121e1704594f775bc33 (diff)
downloadQt-3864ad09d578210b52e5f58fca2ee8a1144f5be2.zip
Qt-3864ad09d578210b52e5f58fca2ee8a1144f5be2.tar.gz
Qt-3864ad09d578210b52e5f58fca2ee8a1144f5be2.tar.bz2
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>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfileinfo_p.h5
-rw-r--r--src/corelib/io/qfilesystemiterator_symbian.cpp10
2 files changed, 11 insertions, 4 deletions
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h
index 64e644f..a68866f 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 {
diff --git a/src/corelib/io/qfilesystemiterator_symbian.cpp b/src/corelib/io/qfilesystemiterator_symbian.cpp
index 2a58770..82dfd87 100644
--- a/src/corelib/io/qfilesystemiterator_symbian.cpp
+++ b/src/corelib/io/qfilesystemiterator_symbian.cpp
@@ -83,10 +83,12 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &path, QDir::Fil
symbianMask |= KEntryAttHidden;
if (filters & QDir::System)
symbianMask |= KEntryAttSystem;
- if (((filters & QDir::Files) == 0) && symbianMask == KEntryAttDir)
- symbianMask |= KEntryAttMatchExclusive; //exclude non-directories
- else if (symbianMask == 0) {
- if ((filters & QDir::PermissionMask) == QDir::Writable)
+ //Do not use KEntryAttMatchExclusive to optimise to return only
+ //directories for QDir::Dirs. There may be a file which is actually
+ //a "mount point" for a file engine and needs to be returned so it
+ //can be overriden to be a directory, see QTBUG-23688
+ if (symbianMask == 0
+ && ((filters & QDir::PermissionMask) == QDir::Writable)) {
symbianMask = KEntryAttMatchExclude | KEntryAttReadOnly;
}