QDateTime: use the more efficient currentMSecsSinceEpoch()

... instead of creating a QDateTime object.

Change-Id: Ib57b52598e2f452985e9fffd145a36911de4fa9a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Thiago Macieira 2016-06-21 14:30:25 -07:00
parent d9b545152d
commit 840729a931
3 changed files with 3 additions and 3 deletions

View File

@ -180,7 +180,7 @@ void FragmentToy::draw(const QSize &windowSize)
m_program->enableAttributeArray("vertexCoord");
m_vertex_buffer.release();
m_program->setUniformValue("currentTime", (uint) QDateTime::currentDateTime().toMSecsSinceEpoch());
m_program->setUniformValue("currentTime", (uint) QDateTime::currentMSecsSinceEpoch());
m_program->setUniformValue("windowSize", windowSize);
QOpenGLContext::currentContext()->functions()->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

View File

@ -332,7 +332,7 @@ QString QIcuTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
{
// Return standard offset format name as ICU C api doesn't support it yet
if (nameType == QTimeZone::OffsetName) {
const Data nowData = data(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch());
const Data nowData = data(QDateTime::currentMSecsSinceEpoch());
// We can't use transitions reliably to find out right dst offset
// Instead use dst offset api to try get it if needed
if (timeType == QTimeZone::DaylightTime)

View File

@ -106,7 +106,7 @@ QString QMacTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
{
// TODO Mac doesn't support OffsetName yet so use standard offset name
if (nameType == QTimeZone::OffsetName) {
const Data nowData = data(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch());
const Data nowData = data(QDateTime::currentMSecsSinceEpoch());
// TODO Cheat for now, assume if has dst the offset if 1 hour
if (timeType == QTimeZone::DaylightTime && hasDaylightTime())
return isoOffsetFormat(nowData.standardTimeOffset + 3600);