From 972aaccde19a6b0f48e3d04755c80913911bf63c Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 16 Jun 2023 10:11:41 +0200 Subject: [PATCH] Axivion: Display analysis version timestamp ..and finetune the layout of the issues count panel. Change-Id: Id8efdb7047fadc999d3fd4c2736600d135d7b224 Reviewed-by: David Schulz --- src/plugins/axivion/axivionoutputpane.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index 6c9e97e4900..beae1673b3f 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -28,6 +28,7 @@ public: private: QLabel *m_project = nullptr; QLabel *m_loc = nullptr; + QLabel *m_timestamp = nullptr; QFormLayout *m_formLayout = nullptr; }; @@ -41,9 +42,13 @@ DashboardWidget::DashboardWidget(QWidget *parent) projectLayout->addRow(Tr::tr("Project:"), m_project); m_loc = new QLabel(this); projectLayout->addRow(Tr::tr("Lines of code:"), m_loc); + m_timestamp = new QLabel(this); + projectLayout->addRow(Tr::tr("Analysis timestamp:"), m_timestamp); layout->addLayout(projectLayout); + layout->addSpacing(10); m_formLayout = new QFormLayout; layout->addLayout(m_formLayout); + layout->addStretch(1); setWidget(widget); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); setWidgetResizable(true); @@ -54,6 +59,7 @@ void DashboardWidget::updateUi() const ProjectInfo &info = AxivionPlugin::projectInfo(); m_project->setText(info.name); m_loc->setText({}); + m_timestamp->setText({}); while (m_formLayout->rowCount()) m_formLayout->removeRow(0); @@ -62,6 +68,9 @@ void DashboardWidget::updateUi() const ResultVersion &last = info.versions.last(); m_loc->setText(QString::number(last.linesOfCode)); + const QDateTime timeStamp = QDateTime::fromString(last.timeStamp, Qt::ISODate); + m_timestamp->setText(timeStamp.isValid() ? timeStamp.toString("yyyy-MM-dd HH::mm::ss") + : Tr::tr("unknown")); const QString tmpl("%1 %2 +%3 / -%4"); auto apply = [&tmpl](int t, int a, int r){