RCCFileInfo: get lastModified file time in UTC directly

These are time stamps, and they use toMsecsSinceEpoch(), no point
getting the time in Local time zone then converting it.

Change-Id: I2db2db5f9ebc062e65514a592fa7fa00cf1d179d
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ahmad Samir 2022-12-17 11:49:20 +02:00
parent a608744c90
commit b5701ca5a2
2 changed files with 2 additions and 2 deletions

View File

@ -202,7 +202,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
if (lib.formatVersion() >= 2) { if (lib.formatVersion() >= 2) {
// last modified time stamp // last modified time stamp
const QDateTime lastModified = m_fileInfo.lastModified(); const QDateTime lastModified = m_fileInfo.lastModified(QTimeZone::UTC);
quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0); quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong(); static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
if (sourceDate != 0) if (sourceDate != 0)

View File

@ -114,7 +114,7 @@ static QString doCompare(const QStringList &actual, const QStringList &expected,
ba.append("File " + fi.absoluteFilePath().toUtf8() + " does not exist!"); ba.append("File " + fi.absoluteFilePath().toUtf8() + " does not exist!");
break; break;
} }
const quint64 timeStamp = quint64(fi.lastModified().toMSecsSinceEpoch()); const quint64 timeStamp = quint64(fi.lastModified(QTimeZone::UTC).toMSecsSinceEpoch());
expectedLine.clear(); expectedLine.clear();
for (int shift = 56; shift >= 0; shift -= 8) { for (int shift = 56; shift >= 0; shift -= 8) {
expectedLine.append(QLatin1String("0x")); expectedLine.append(QLatin1String("0x"));