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:
parent
d9b545152d
commit
840729a931
@ -180,7 +180,7 @@ void FragmentToy::draw(const QSize &windowSize)
|
|||||||
m_program->enableAttributeArray("vertexCoord");
|
m_program->enableAttributeArray("vertexCoord");
|
||||||
m_vertex_buffer.release();
|
m_vertex_buffer.release();
|
||||||
|
|
||||||
m_program->setUniformValue("currentTime", (uint) QDateTime::currentDateTime().toMSecsSinceEpoch());
|
m_program->setUniformValue("currentTime", (uint) QDateTime::currentMSecsSinceEpoch());
|
||||||
m_program->setUniformValue("windowSize", windowSize);
|
m_program->setUniformValue("windowSize", windowSize);
|
||||||
|
|
||||||
QOpenGLContext::currentContext()->functions()->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
QOpenGLContext::currentContext()->functions()->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||||
|
@ -332,7 +332,7 @@ QString QIcuTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
|
|||||||
{
|
{
|
||||||
// Return standard offset format name as ICU C api doesn't support it yet
|
// Return standard offset format name as ICU C api doesn't support it yet
|
||||||
if (nameType == QTimeZone::OffsetName) {
|
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
|
// We can't use transitions reliably to find out right dst offset
|
||||||
// Instead use dst offset api to try get it if needed
|
// Instead use dst offset api to try get it if needed
|
||||||
if (timeType == QTimeZone::DaylightTime)
|
if (timeType == QTimeZone::DaylightTime)
|
||||||
|
@ -106,7 +106,7 @@ QString QMacTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
|
|||||||
{
|
{
|
||||||
// TODO Mac doesn't support OffsetName yet so use standard offset name
|
// TODO Mac doesn't support OffsetName yet so use standard offset name
|
||||||
if (nameType == QTimeZone::OffsetName) {
|
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
|
// TODO Cheat for now, assume if has dst the offset if 1 hour
|
||||||
if (timeType == QTimeZone::DaylightTime && hasDaylightTime())
|
if (timeType == QTimeZone::DaylightTime && hasDaylightTime())
|
||||||
return isoOffsetFormat(nowData.standardTimeOffset + 3600);
|
return isoOffsetFormat(nowData.standardTimeOffset + 3600);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user