summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfiledevice.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-07-23 11:14:57 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-08-05 16:41:38 +0000
commit6c3a3d498a8797c481a394418fff8f7bf1886c61 (patch)
treeb64407f2b2520d46b42f96495c41600aaae03d3c /src/corelib/io/qfiledevice.cpp
parentdb433bdf65e011e64be51948e79abc02034dddbf (diff)
Filesystem: Use "birth time" to avoid confusion with Unix ctime
The Unix stat fields "st_ctime" and "st_ctim" mean "change time", the last time that the file/inode status fields were changed. It does not mean "creation time". So this commit splits all of the internal API to "birth" and "metadata change" instead of "creation" to avoid the conflict. Change-Id: I149e0540c00745fe8119fffd1463fe78b619649e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/corelib/io/qfiledevice.cpp')
-rw-r--r--src/corelib/io/qfiledevice.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp
index b642add7f6..ab37d6f4d7 100644
--- a/src/corelib/io/qfiledevice.cpp
+++ b/src/corelib/io/qfiledevice.cpp
@@ -744,29 +744,23 @@ bool QFileDevice::unmap(uchar *address)
This enum is used by the fileTime() and setFileTime() functions.
- \value FileCreationTime When the file was created (not supported on UNIX).
- \value FileModificationTime When the file was most recently modified.
- \value FileAccessTime When the file was most recently accessed (e.g.
- read or written to).
-
- \sa setFileTime(), fileTime()
+ \value FileAccessTime When the file was most recently accessed
+ (e.g. read or written to).
+ \value FileBirthTime When the file was created (may not be not
+ supported on UNIX).
+ \value FileMetadataChangeTime When the file's metadata was last changed.
+ \value FileModificationTime When the file was most recently modified.
+
+ \sa setFileTime(), fileTime(), QFileInfo::fileTime()
*/
static inline QAbstractFileEngine::FileTime FileDeviceTimeToAbstractFileEngineTime(QFileDevice::FileTime time)
{
- switch (time) {
- case QFileDevice::FileAccessTime:
- return QAbstractFileEngine::AccessTime;
-
- case QFileDevice::FileCreationTime:
- return QAbstractFileEngine::CreationTime;
-
- case QFileDevice::FileModificationTime:
- return QAbstractFileEngine::ModificationTime;
- }
-
- Q_UNREACHABLE();
- return QAbstractFileEngine::AccessTime;
+ Q_STATIC_ASSERT(int(QFileDevice::FileAccessTime) == int(QAbstractFileEngine::AccessTime));
+ Q_STATIC_ASSERT(int(QFileDevice::FileBirthTime) == int(QAbstractFileEngine::BirthTime));
+ Q_STATIC_ASSERT(int(QFileDevice::FileMetadataChangeTime) == int(QAbstractFileEngine::MetadataChangeTime));
+ Q_STATIC_ASSERT(int(QFileDevice::FileModificationTime) == int(QAbstractFileEngine::ModificationTime));
+ return QAbstractFileEngine::FileTime(time);
}
/*!