summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemengine.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2010-09-10 15:43:23 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2010-09-10 17:13:12 (GMT)
commitce74c076062c84f183f72947730db7b0e2d5ab54 (patch)
tree3a25cd88c846e131a6d6f5a570ee5fd96a48f9fd /src/corelib/io/qfilesystemengine.cpp
parent8f40161a7932e901a9f6fe59b5b3d2666c5482c5 (diff)
downloadQt-ce74c076062c84f183f72947730db7b0e2d5ab54.zip
Qt-ce74c076062c84f183f72947730db7b0e2d5ab54.tar.gz
Qt-ce74c076062c84f183f72947730db7b0e2d5ab54.tar.bz2
Refactored QFSFileEngineIterator/Unix
into new internal native iterators. QFSFileEngineIterator will use that internally, currently only on non-windows platforms. This implementation can be reused on Windows once the native iterators are in place there as well. Reviewed-by: Shane Kearns
Diffstat (limited to 'src/corelib/io/qfilesystemengine.cpp')
-rw-r--r--src/corelib/io/qfilesystemengine.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp
index cbc4c42..4791dfc 100644
--- a/src/corelib/io/qfilesystemengine.cpp
+++ b/src/corelib/io/qfilesystemengine.cpp
@@ -285,6 +285,65 @@ void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer)
#endif
}
+void QFileSystemMetaData::fillFromDirEnt(const QT_DIRENT &entry)
+{
+ // ### This will clear all entry flags and knownFlagsMask
+ switch (entry.d_type)
+ {
+ case DT_DIR:
+ knownFlagsMask = QFileSystemMetaData::LinkType
+ | QFileSystemMetaData::FileType
+ | QFileSystemMetaData::DirectoryType
+ | QFileSystemMetaData::SequentialType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ entryFlags = QFileSystemMetaData::DirectoryType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ break;
+
+ case DT_BLK:
+ case DT_CHR:
+ case DT_FIFO:
+ case DT_SOCK:
+ // ### System attribute
+ knownFlagsMask = QFileSystemMetaData::LinkType
+ | QFileSystemMetaData::FileType
+ | QFileSystemMetaData::DirectoryType
+ | QFileSystemMetaData::BundleType
+ | QFileSystemMetaData::AliasType
+ | QFileSystemMetaData::SequentialType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ entryFlags = QFileSystemMetaData::SequentialType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ break;
+
+ case DT_LNK:
+ knownFlagsMask = QFileSystemMetaData::LinkType;
+ entryFlags = QFileSystemMetaData::LinkType;
+ break;
+
+ case DT_REG:
+ knownFlagsMask = QFileSystemMetaData::LinkType
+ | QFileSystemMetaData::FileType
+ | QFileSystemMetaData::DirectoryType
+ | QFileSystemMetaData::BundleType
+ | QFileSystemMetaData::SequentialType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ entryFlags = QFileSystemMetaData::FileType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ break;
+
+ case DT_UNKNOWN:
+ default:
+ clear();
+ }
+}
+
#endif
//static