summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfileinfo.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-08-04 16:10:09 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-08-05 16:41:32 +0000
commit261c6713bd0b39778236f7dbb1d81d48599f955c (patch)
treea1f05cfebf4258bd416a1b0d17dca0c1581ca1c6 /src/corelib/io/qfileinfo.h
parent88c30618d512864adab0733b58dd5f48b7f98f74 (diff)
Introduce QFileInfo::birthTime and metadataChangeTime
[ChangeLog][QtCore][QFileInfo] Deprecated created() because it could return one of three different file times depending on the OS and filesystem type, without the ability to determine which one is which. It is replaced by metadataChangeTime() and birthTime(). [ChangeLog][QtCore][QFileInfo] Added QFileInfo::metadataChangeTime(), which returns the time the file's metadata was last changed, if it is known, and falling back to the same value as lastModified() otherwise. On Unix systems, this corresponds to the file's ctime. [ChangeLog][QtCore][QFileInfo] Added QFileInfo::birthTime(), which returns the file's birth time if it is known, an invalid QDateTime otherwise. This function is supported on Windows and on some Unix systems. Change-Id: I0031aa609e714ae983c3fffd1467bd8b3e3a593d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/io/qfileinfo.h')
-rw-r--r--src/corelib/io/qfileinfo.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index 845fdefac7..f295a86015 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -130,7 +130,12 @@ public:
qint64 size() const;
// ### Qt6: inline these functions
+#if QT_DEPRECATED_SINCE(5, 10)
+ QT_DEPRECATED_X("Use either birthTime() or metadataChangeTime()")
QDateTime created() const;
+#endif
+ QDateTime birthTime() const;
+ QDateTime metadataChangeTime() const;
QDateTime lastModified() const;
QDateTime lastRead() const;
QDateTime fileTime(QFile::FileTime time) const;