QFileInfo: use currentDateTimeUtc()
Instead of the more verbose currentDateTime(QTZ::UTC). Pick-to: 6.5 Change-Id: Ie759f4270b12fca39c458bf85c8296f5342033db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
905bc62933
commit
26b5325767
@ -1130,7 +1130,7 @@ void tst_QFileInfo::fileTimes()
|
||||
QDateTime birthTime, writeTime, metadataChangeTime, readTime;
|
||||
|
||||
// --- Create file and write to it
|
||||
beforeBirth = QDateTime::currentDateTime(QTimeZone::UTC).addMSecs(-fsClockSkew);
|
||||
beforeBirth = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew);
|
||||
{
|
||||
QFile file(fileName);
|
||||
QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
|
||||
@ -1140,7 +1140,7 @@ void tst_QFileInfo::fileTimes()
|
||||
datePairString(birthTime, beforeBirth));
|
||||
|
||||
QTest::qSleep(sleepTime);
|
||||
beforeWrite = QDateTime::currentDateTime().addMSecs(-fsClockSkew);
|
||||
beforeWrite = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew);
|
||||
QTextStream ts(&file);
|
||||
ts << fileName << Qt::endl;
|
||||
}
|
||||
@ -1153,7 +1153,7 @@ void tst_QFileInfo::fileTimes()
|
||||
|
||||
// --- Change the file's metadata
|
||||
QTest::qSleep(sleepTime);
|
||||
beforeMetadataChange = QDateTime::currentDateTime(QTimeZone::UTC).addMSecs(-fsClockSkew);
|
||||
beforeMetadataChange = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew);
|
||||
{
|
||||
QFile file(fileName);
|
||||
file.setPermissions(file.permissions());
|
||||
@ -1169,7 +1169,7 @@ void tst_QFileInfo::fileTimes()
|
||||
|
||||
// --- Read the file
|
||||
QTest::qSleep(sleepTime);
|
||||
beforeRead = QDateTime::currentDateTime(QTimeZone::UTC).addMSecs(-fsClockSkew);
|
||||
beforeRead = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew);
|
||||
{
|
||||
QFile file(fileName);
|
||||
QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
|
||||
|
@ -886,7 +886,7 @@ static bool waitAndRunUpdateMimeDatabase(const QString &path)
|
||||
QFileInfo mimeCacheInfo(path + QString::fromLatin1("/mime.cache"));
|
||||
if (mimeCacheInfo.exists()) {
|
||||
// Wait until the beginning of the next second
|
||||
while (mimeCacheInfo.lastModified(QTimeZone::UTC).secsTo(QDateTime::currentDateTime()) == 0) {
|
||||
while (mimeCacheInfo.lastModified(QTimeZone::UTC).secsTo(QDateTime::currentDateTimeUtc()) == 0) {
|
||||
QTest::qSleep(200);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user