mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
8165abf2e7
commit
ef76905590
2 changed files with 2 additions and 20 deletions
|
@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue