QFileInfo: use currentDateTimeUtc()

Instead of the more verbose currentDateTime(QTZ::UTC).

Change-Id: Ie759f4270b12fca39c458bf85c8296f5342033db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 26b5325767a4084ca51f485b99ac58477246e062
with #include <QtCore/QTimeZone> added to tst_qmimedatabase.cpp)
This commit is contained in:
Ahmad Samir 2023-01-04 16:29:39 +02:00
parent 603388c465
commit d468e77af2
2 changed files with 5 additions and 5 deletions

View File

@ -1129,7 +1129,7 @@ void tst_QFileInfo::fileTimes()
QDateTime birthTime, writeTime, metadataChangeTime, readTime;
// --- Create file and write to it
beforeBirth = QDateTime::currentDateTime().addMSecs(-fsClockSkew);
beforeBirth = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew);
{
QFile file(fileName);
QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
@ -1139,7 +1139,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;
}
@ -1152,7 +1152,7 @@ void tst_QFileInfo::fileTimes()
// --- Change the file's metadata
QTest::qSleep(sleepTime);
beforeMetadataChange = QDateTime::currentDateTime().addMSecs(-fsClockSkew);
beforeMetadataChange = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew);
{
QFile file(fileName);
file.setPermissions(file.permissions());
@ -1168,7 +1168,7 @@ void tst_QFileInfo::fileTimes()
// --- Read the file
QTest::qSleep(sleepTime);
beforeRead = QDateTime::currentDateTime().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().secsTo(QDateTime::currentDateTime()) == 0) {
while (mimeCacheInfo.lastModified().secsTo(QDateTime::currentDateTimeUtc()) == 0) {
QTest::qSleep(200);
}
}