Get last commit date and loadtime of tariff-file.

This commit is contained in:
Gerhard Hoffmann 2023-08-11 11:02:15 +02:00
parent 1af136e39d
commit 8f26bfee0f

View File

@ -1076,19 +1076,23 @@ PSAInstalled Worker::getPSAInstalled() {
PSAInstalled psaInstalled; PSAInstalled psaInstalled;
QString printSysDir("/etc/psa_config"); QString printSysDir("/etc/psa_config");
QString tariffSysDir("/etc/psa_tariff"); QString tariffSysDir("/etc/psa_tariff");
QString tariffRepoDir("etc/psa_tariff");
QString absPathName; QString absPathName;
QString absPathNameRepository;
if (m_zoneNr != 0) { if (m_zoneNr != 0) {
QString const &n = QString("%1").arg(m_zoneNr).rightJustified(2, '0'); QString const &n = QString("%1").arg(m_zoneNr).rightJustified(2, '0');
psaInstalled.tariff.name = QString("tariff%1.json").arg(n); psaInstalled.tariff.name = QString("tariff%1.json").arg(n);
absPathName = QDir::cleanPath(tariffSysDir + QDir::separator() + psaInstalled.tariff.name); absPathName = QDir::cleanPath(tariffSysDir + QDir::separator() + psaInstalled.tariff.name);
psaInstalled.tariff.blob = m_gc.gitBlob(absPathName); 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.size = getFileSize(absPathName);
psaInstalled.tariff.zone = m_zoneNr; psaInstalled.tariff.zone = m_zoneNr;
psaInstalled.tariff.loadTime = Utils::getTariffLoadTime(absPathName);
} }
psaInstalled.tariff.project = "Szeged"; psaInstalled.tariff.project = "Szeged";
psaInstalled.tariff.info = "N/A"; psaInstalled.tariff.info = "N/A";
psaInstalled.tariff.loadTime = "N/A"; // QDateTime::currentDateTime().toString(Qt::ISODateWithMs);
psaInstalled.tariff.version = "N/A"; psaInstalled.tariff.version = "N/A";
psaInstalled.hw.linuxVersion = m_osVersion; psaInstalled.hw.linuxVersion = m_osVersion;