From ef769055900fbb391de7e2dbb89f8ffb23c237b0 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 26 Apr 2019 18:16:02 +0200 Subject: Cleanup: simplify YearInfo class YearInfo is a trivial wrapper around "stats_t *". All the constructor / destructor rigmarole seems completely unnecessary. Remove it. Probably the whole class could be removed, but for that I'd need more insight into Grantlee, which is low on my list of priorities for now. Signed-off-by: Berthold Stoeger --- desktop-widgets/templatelayout.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'desktop-widgets/templatelayout.cpp') diff --git a/desktop-widgets/templatelayout.cpp b/desktop-widgets/templatelayout.cpp index 060fc0ace..fa5f6282c 100644 --- a/desktop-widgets/templatelayout.cpp +++ b/desktop-widgets/templatelayout.cpp @@ -210,7 +210,7 @@ QString TemplateLayout::generateStatistics() stats_summary_auto_free stats; calculate_stats_summary(&stats, false); while (stats.stats_yearly != NULL && stats.stats_yearly[i].period) { - YearInfo year(stats.stats_yearly[i]); + YearInfo year{ &stats.stats_yearly[i] }; years.append(QVariant::fromValue(year)); i++; } @@ -256,13 +256,3 @@ void TemplateLayout::writeTemplate(QString template_name, QString grantlee_templ qfile.close(); } } - -YearInfo::YearInfo() -{ - year = nullptr; -} - -YearInfo::~YearInfo() -{ - -} -- cgit v1.2.3-70-g09d2