File: qhelpgenerator_lastmodified_source_date_epoch_utcoffset.diff

package info (click to toggle)
qttools-opensource-src 5.15.17-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,632 kB
  • sloc: cpp: 204,308; xml: 3,621; ansic: 265; javascript: 120; perl: 118; makefile: 64; java: 32
file content (28 lines) | stat: -rw-r--r-- 1,403 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Description: qhelpgenerator: localize SOURCE_DATE_EPOCH to UTC
Origin: upstream, https://code.qt.io/cgit/qt/qttools.git/commit/?id=f11d7e4af73ca474
Last-Update: 2024-01-13

--- a/src/assistant/help/qhelpcollectionhandler.cpp
+++ b/src/assistant/help/qhelpcollectionhandler.cpp
@@ -2202,8 +2202,10 @@ bool QHelpCollectionHandler::registerInd
         const QString sourceDateEpochStr = qEnvironmentVariable("SOURCE_DATE_EPOCH");
         bool ok;
         const qlonglong sourceDateEpoch = sourceDateEpochStr.toLongLong(&ok);
-        if (ok && sourceDateEpoch < lastModified.toSecsSinceEpoch())
+        if (ok && sourceDateEpoch < lastModified.toSecsSinceEpoch()) {
+            lastModified.setOffsetFromUtc(0);
             lastModified.setSecsSinceEpoch(sourceDateEpoch);
+        }
     }
     m_query->addBindValue(lastModified.toString(Qt::ISODate));
     if (!m_query->exec())
--- a/src/assistant/qhelpgenerator/main.cpp
+++ b/src/assistant/qhelpgenerator/main.cpp
@@ -116,6 +116,7 @@ int generateCollectionFile(const QByteAr
     if (!config.filesToRegister().isEmpty()) {
         if (Q_UNLIKELY(qEnvironmentVariableIsSet("SOURCE_DATE_EPOCH"))) {
             QDateTime dt;
+            dt.setOffsetFromUtc(0);
             dt.setSecsSinceEpoch(qEnvironmentVariableIntValue("SOURCE_DATE_EPOCH"));
             CollectionConfiguration::updateLastRegisterTime(helpEngine, dt);
         } else {