mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
be303c0b5b
commit
8c709106e5
1 changed files with 1 additions and 1 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Reference in a new issue