diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-06-21 14:08:22 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-06-22 18:34:27 +0000 |
commit | bff15c547e71e79738dfc9de89c4ef05947c0953 (patch) | |
tree | 69e263b6bc4ce2fe42a937d88ec65379d8ebcc8f /src/corelib/io/qfilesystemmetadata_p.h | |
parent | 90eee08b3e672573e3ad93470d844e1d498651dd (diff) |
QDateTime: introduce {to,from,set,current}SecsSinceEpoch
These new functions use a 64-bit integer in the API, instead of the
broken 32-bit unsigned integer that the previous xxxTime_t functions
used. That was a design flaw when the API was introduced back in Qt 4.2,
so I'm deprecating the API and slating it for removal in 6.0.
The changes to qfilesystemmetadata_p.h and quuid.cpp are necessary to
build the bootstrap library. The rest of the adaptation to the new API
will come in the next commit.
[ChangeLog][QtCore][QDateTime] Introduced toSecsSinceEpoch,
fromSecsSinceEpoch and setSecsSinceEpoch functions, which use 64-bit
integers to represent the number of seconds.
[ChangeLog][QtCore][QDateTime] The toTime_t, fromTime_t and setTime_t
functions are deprecated and will be removed in Qt 6.0. For new code,
use the equivalent functions with "SecsSinceEpoch" in the name, or the
equivalent ones with millisecond accurancy that have existed since
Qt 4.7.
Change-Id: Ib57b52598e2f452985e9fffd145a355d0e7ff48d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/io/qfilesystemmetadata_p.h')
-rw-r--r-- | src/corelib/io/qfilesystemmetadata_p.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h index b38188d357..9507a101a8 100644 --- a/src/corelib/io/qfilesystemmetadata_p.h +++ b/src/corelib/io/qfilesystemmetadata_p.h @@ -276,9 +276,9 @@ inline QDateTime QFileSystemMetaData::fileTime(QAbstractFileEngine::FileTime tim #endif #if defined(Q_OS_UNIX) -inline QDateTime QFileSystemMetaData::creationTime() const { return QDateTime::fromTime_t(creationTime_); } -inline QDateTime QFileSystemMetaData::modificationTime() const { return QDateTime::fromTime_t(modificationTime_); } -inline QDateTime QFileSystemMetaData::accessTime() const { return QDateTime::fromTime_t(accessTime_); } +inline QDateTime QFileSystemMetaData::creationTime() const { return QDateTime::fromSecsSinceEpoch(creationTime_); } +inline QDateTime QFileSystemMetaData::modificationTime() const { return QDateTime::fromSecsSinceEpoch(modificationTime_); } +inline QDateTime QFileSystemMetaData::accessTime() const { return QDateTime::fromSecsSinceEpoch(accessTime_); } inline uint QFileSystemMetaData::userId() const { return userId_; } inline uint QFileSystemMetaData::groupId() const { return groupId_; } |