diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2010-09-13 15:50:27 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-09-15 10:29:15 (GMT) |
commit | a4bd280f48b1508912ae50e28b47f0f74fd08c37 (patch) | |
tree | 67daebc0db0b00ae9c8ff1c0bda9c8357f728bc7 /src/corelib/io/qfilesystemengine_unix.cpp | |
parent | 0299d30d5aa35d532df6bc018afc52df263651a0 (diff) | |
download | Qt-a4bd280f48b1508912ae50e28b47f0f74fd08c37.zip Qt-a4bd280f48b1508912ae50e28b47f0f74fd08c37.tar.gz Qt-a4bd280f48b1508912ae50e28b47f0f74fd08c37.tar.bz2 |
Pass QFileSystemMetaData reference into QFileSystemEngine::canonicalName
On symbian, this allows us to use the cached ExistsAttribute
On symbian and unix, this allows us to update the caller's knowledge of
ExistsAttribute (potentially saving a stat later)
Reviewed-By: joao
Diffstat (limited to 'src/corelib/io/qfilesystemengine_unix.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index fdb881f..6d8b3ff 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -193,7 +193,7 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link, } //static -QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry) +QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, , QFileSystemMetaData &data) { if (entry.isEmpty() || entry.isRoot()) return entry; @@ -223,10 +223,14 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry) ret = realpath(entry.nativeFilePath().constData(), (char*)0); # endif if (ret) { + data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute; + data.entryFlags |= QFileSystemMetaData::ExistsAttribute; QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret)); free(ret); return QFileSystemEntry(canonicalPath); } else if (errno == ENOENT) { // file doesn't exist + data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute; + data.entryFlags &= ~(QFileSystemMetaData::ExistsAttribute); return QFileSystemEntry(); } return entry; |