diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-04-26 18:16:02 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-29 13:03:31 -0700 |
commit | ef769055900fbb391de7e2dbb89f8ffb23c237b0 (patch) | |
tree | f904e6cf8cdf5ea3c3011dc743989628178a4f90 | |
parent | 8165abf2e7267e624e6e4754dbe6c3af3dbe17a7 (diff) | |
download | subsurface-ef769055900fbb391de7e2dbb89f8ffb23c237b0.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
-rw-r--r-- | desktop-widgets/templatelayout.cpp | 12 | ||||
-rw-r--r-- | desktop-widgets/templatelayout.h | 10 |
2 files changed, 2 insertions, 20 deletions
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() -{ - -} diff --git a/desktop-widgets/templatelayout.h b/desktop-widgets/templatelayout.h index 5fab95f44..49aa51613 100644 --- a/desktop-widgets/templatelayout.h +++ b/desktop-widgets/templatelayout.h @@ -34,16 +34,8 @@ signals: void progressUpdated(int value); }; -class YearInfo { -public: +struct YearInfo { stats_t *year; - YearInfo(stats_t& year) - :year(&year) - { - - } - YearInfo(); - ~YearInfo(); }; Q_DECLARE_METATYPE(template_options) |