qt5base-lts/tests/auto/corelib
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
..
animation QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
codecs tests/auto/corelib/codecs: clean up 2016-08-06 14:49:21 +00:00
global Long live QTest::addRow()! 2017-01-10 07:47:26 +00:00
io Simplify fileTimeToQDateTime() by having it return a UTC time 2017-01-11 11:53:27 +00:00
itemmodels Merge remote-tracking branch 'origin/5.7' into dev 2016-08-16 07:58:32 +02:00
json Merge remote-tracking branch 'origin/5.8' into dev 2016-11-17 14:43:26 +01:00
kernel Merge remote-tracking branch 'origin/5.8' into dev 2016-12-13 09:39:20 +01:00
mimetypes tests/auto/corelib/mimetypes: use local QThreadPool 2016-09-17 06:47:05 +00:00
plugin macOS: Don't build auto-tests as application bundles unless explicitly requested 2016-10-23 10:39:56 +00:00
statemachine Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
thread Long live QTest::addRow()! 2017-01-10 07:47:26 +00:00
tools Long live QTest::addRow()! 2017-01-10 07:47:26 +00:00
xml tests/auto/corelib/xml: cleanup 2016-08-27 05:09:16 +00:00
corelib.pro Add support for Apple tvOS 2016-05-17 16:11:23 +00:00