summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-12-06 11:35:05 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2018-07-16 15:22:45 +0000
commite000c60ab35476a603617bb1667b89284d0119fb (patch)
treef7d4d669a3dcbb1133983c105f7337f905a01d53 /src
parent40a98ea750b90e453f552a1d1eb46b9947c951fa (diff)
QDateTime: fix some misnamed variables, s/local/zone/
When I wrote zoneMSecsToEpochMSecs I seem to have copied names from localMSecsToEpochMSecs, that need a s/local/zone/ change to their names to make sense in this context. Flipped an if/else for clarity in the process. Change-Id: If2b288532b16d999f6ff0b9241e2dbcbc016b010 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qdatetime.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 49e7173de0..288c7963d9 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2979,18 +2979,18 @@ inline QDateTime::Data QDateTimePrivate::create(const QDate &toDate, const QTime
// DST transitions are disambiguated by hint.
inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QTimeZone &zone,
DaylightStatus hint,
- QDate *localDate, QTime *localTime)
+ QDate *zoneDate, QTime *zoneTime)
{
// Get the effective data from QTimeZone
QTimeZonePrivate::Data data = zone.d->dataForLocalTime(zoneMSecs, int(hint));
- // Docs state any LocalTime before 1970-01-01 will *not* have any DST applied
+ // Docs state any time before 1970-01-01 will *not* have any DST applied
// but all affected times afterwards will have DST applied.
- if (data.atMSecsSinceEpoch >= 0) {
- msecsToTime(data.atMSecsSinceEpoch + (data.offsetFromUtc * 1000), localDate, localTime);
- return data.atMSecsSinceEpoch;
+ if (data.atMSecsSinceEpoch < 0) {
+ msecsToTime(zoneMSecs, zoneDate, zoneTime);
+ return zoneMSecs - data.standardTimeOffset * 1000;
} else {
- msecsToTime(zoneMSecs, localDate, localTime);
- return zoneMSecs - (data.standardTimeOffset * 1000);
+ msecsToTime(data.atMSecsSinceEpoch + data.offsetFromUtc * 1000, zoneDate, zoneTime);
+ return data.atMSecsSinceEpoch;
}
}
#endif // timezone