mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add dive type to statistics window
This adds dive type based division to the "yearly statistics" window. Thus people can see the stats from individually from OC, CCR, PSCR and freedive. See #949 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b9000208fe
commit
37c10c8fd6
3 changed files with 40 additions and 1 deletions
|
@ -202,4 +202,18 @@ void YearlyStatisticsModel::update_yearly_stats()
|
|||
rootItem->children.append(item);
|
||||
item->parent = rootItem;
|
||||
}
|
||||
|
||||
/* 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) {
|
||||
if (stats_by_type[i].selection_size == 0)
|
||||
continue;
|
||||
YearStatisticsItem *iChild = new YearStatisticsItem(stats_by_type[i]);
|
||||
item->children.append(iChild);
|
||||
iChild->parent = item;
|
||||
}
|
||||
rootItem->children.append(item);
|
||||
item->parent = rootItem;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue