From 8f26bfee0faff2abe596127106543ec495bf3167 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 11 Aug 2023 11:02:15 +0200 Subject: [PATCH] Get last commit date and loadtime of tariff-file. --- worker.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worker.cpp b/worker.cpp index fda3f39..95cedbc 100644 --- a/worker.cpp +++ b/worker.cpp @@ -1076,19 +1076,23 @@ PSAInstalled Worker::getPSAInstalled() { PSAInstalled psaInstalled; QString printSysDir("/etc/psa_config"); QString tariffSysDir("/etc/psa_tariff"); + QString tariffRepoDir("etc/psa_tariff"); QString absPathName; + QString absPathNameRepository; if (m_zoneNr != 0) { QString const &n = QString("%1").arg(m_zoneNr).rightJustified(2, '0'); psaInstalled.tariff.name = QString("tariff%1.json").arg(n); absPathName = QDir::cleanPath(tariffSysDir + QDir::separator() + psaInstalled.tariff.name); psaInstalled.tariff.blob = m_gc.gitBlob(absPathName); + absPathNameRepository = QDir::cleanPath(tariffRepoDir + QDir::separator() + psaInstalled.tariff.name); + psaInstalled.tariff.lastCommit = m_gc.gitLastCommit(absPathNameRepository); psaInstalled.tariff.size = getFileSize(absPathName); psaInstalled.tariff.zone = m_zoneNr; + psaInstalled.tariff.loadTime = Utils::getTariffLoadTime(absPathName); } psaInstalled.tariff.project = "Szeged"; psaInstalled.tariff.info = "N/A"; - psaInstalled.tariff.loadTime = "N/A"; // QDateTime::currentDateTime().toString(Qt::ISODateWithMs); psaInstalled.tariff.version = "N/A"; psaInstalled.hw.linuxVersion = m_osVersion;