qt5base-lts/tests/auto/corelib/io
Edward Welbourne 4b4bd6ab98 Simplify fileTimeToQDateTime() by having it return a UTC time
This avoids so many complications.  The prior code, using
SystemTimeToTzSpecificLocalTime(), lead to unhelpful results when the
QDateTime() implementation used MS-POSIX's defective mktime().
Although SystemTimeToTzSpecificLocalTime() is actually more correct,
we were getting inconsistent results by mixing the two: and
eliminating the use of mktime() turns out to be decidedly tricky.  So,
to avoid inconsistency, stick with a UTC time (which is what FILETIME
is defined as).  Change QFileInfo's methods to explicitly convert
.toLocalTime() where appropriate and document that these methods do
indeed return local time (as we conjecture has been taken for granted
by callers).

Also added a regression test for the reported case of this going
wrong.  A time-stamp from before Russia's (permanent, not DST) change
of TZ could end up inconsistently handled between file-system
meta-data and raw date-time APIs, due to cross-talk between different
MS-Win time APIs.

[ChangeLog][QtCore][QFileInfo] Made sure that all file lifecycle times
are in local time. This was probably true before, but is now explicit.

Task-number: QTBUG-48306
Change-Id: Ic0b99d25c4168f623d31967bc60665c0c4f38a14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-11 11:53:27 +00:00
..
largefile QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
qabstractfileengine Merge remote-tracking branch 'origin/5.6' into dev 2016-01-26 16:27:28 +01:00
qbuffer Updated license headers 2016-01-21 18:55:18 +00:00
qdatastream Merge remote-tracking branch 'origin/5.7' into dev 2016-08-01 18:20:00 +02:00
qdataurl Updated license headers 2016-01-21 18:55:18 +00:00
qdebug Merge remote-tracking branch 'origin/5.6' into 5.7 2016-06-10 23:27:10 +02:00
qdir Introduce QDir::isEmpty() 2017-01-08 16:11:34 +00:00
qdiriterator Merge remote-tracking branch 'origin/5.7' into dev 2016-06-13 12:46:46 +02:00
qfile Merge remote-tracking branch 'origin/5.8' into dev 2016-12-13 09:39:20 +01:00
qfileinfo Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-01 06:02:55 +01:00
qfileselector Fix QFileSelectorPrivate::addStatics() 2016-02-12 14:10:29 +00:00
qfilesystementry Updated license headers 2016-01-21 18:55:18 +00:00
qfilesystemmetadata Simplify fileTimeToQDateTime() by having it return a UTC time 2017-01-11 11:53:27 +00:00
qfilesystemwatcher Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-01 06:02:55 +01:00
qiodevice Revert blacklisting of two tests now the fix is in 2016-05-30 17:39:37 +00:00
qipaddress Merge remote-tracking branch 'origin/5.6' into 5.7 2016-04-13 06:55:37 +02:00
qlockfile macOS: Don't build auto-tests as application bundles unless explicitly requested 2016-10-23 10:39:56 +00:00
qloggingcategory Updated license headers 2016-01-21 18:55:18 +00:00
qloggingregistry Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-06 15:36:44 +02:00
qnodebug Updated license headers 2016-01-21 18:55:18 +00:00
qprocess macOS: Don't build auto-tests as application bundles unless explicitly requested 2016-10-23 10:39:56 +00:00
qprocess-noapplication macOS: Don't build auto-tests as application bundles unless explicitly requested 2016-10-23 10:39:56 +00:00
qprocessenvironment QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
qresourceengine Fix missing last modification time stamp in qrc content 2016-11-22 04:57:02 +00:00
qsavefile Updated license headers 2016-01-21 18:55:18 +00:00
qsettings Merge remote-tracking branch 'origin/5.6' into 5.7 2016-10-22 21:19:57 +02:00
qstandardpaths Merge remote-tracking branch 'origin/5.8' into dev 2016-12-13 09:39:20 +01:00
qstorageinfo Merge remote-tracking branch 'origin/5.7' into dev 2016-05-23 21:09:46 +02:00
qtemporarydir Add a convenience function QTemporaryDir::filePath() 2016-09-05 15:55:11 +00:00
qtemporaryfile Merge remote-tracking branch 'origin/5.7' into dev 2016-08-01 18:20:00 +02:00
qtextstream tst_QTextStream: Use casts instead of Q_UINT64_C for negative values cast to quint64 2016-11-30 10:48:50 +00:00
qurl Merge remote-tracking branch 'origin/5.6' into 5.7 2016-11-23 09:24:36 +01:00
qurlinternal Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qurlquery Updated license headers 2016-01-21 18:55:18 +00:00
qwinoverlappedionotifier Updated license headers 2016-01-21 18:55:18 +00:00
io.pro Simplify fileTimeToQDateTime() by having it return a UTC time 2017-01-11 11:53:27 +00:00