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:
Ahmad Samir 2023-01-04 16:29:39 +02:00 committed by Thiago Macieira
parent 905bc62933
commit 26b5325767
2 changed files with 5 additions and 5 deletions

View File

@ -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));

View File

@ -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);
}
}