diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2016-01-22 22:27:56 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-24 21:29:13 -0800 |
commit | 8c709106e559c0c286c8266f7f6c5bf84d0f6600 (patch) | |
tree | 947ded0fbc60a7341c116fb7381707a316eb1b71 | |
parent | be303c0b5be59b2170a487348273c23c35016c11 (diff) | |
download | subsurface-8c709106e559c0c286c8266f7f6c5bf84d0f6600.tar.gz |
Show only as many stats as there are DC types
After reserving only the required amount of data for stats_by_type, we
showed an extra DC type on the statistics (no more extra space filled
with 0 at the end of the buffer)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-models/yearlystatisticsmodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/yearlystatisticsmodel.cpp b/qt-models/yearlystatisticsmodel.cpp index 1cc5a9087..955f0e8ee 100644 --- a/qt-models/yearlystatisticsmodel.cpp +++ b/qt-models/yearlystatisticsmodel.cpp @@ -206,7 +206,7 @@ void YearlyStatisticsModel::update_yearly_stats() /* Show the statistic sorted by dive type */ if (stats_by_type != NULL && stats_by_type[0].selection_size) { YearStatisticsItem *item = new YearStatisticsItem(stats_by_type[0]); - for (i = 1; i <= sizeof(dive_comp_type) + 1; ++i) { + for (i = 1; i <= NUM_DC_TYPE; ++i) { if (stats_by_type[i].selection_size == 0) continue; YearStatisticsItem *iChild = new YearStatisticsItem(stats_by_type[i]); |