summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/yearlystatisticsmodel.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/qt-models/yearlystatisticsmodel.cpp b/qt-models/yearlystatisticsmodel.cpp
index 47d9891f2..1cc5a9087 100644
--- a/qt-models/yearlystatisticsmodel.cpp
+++ b/qt-models/yearlystatisticsmodel.cpp
@@ -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;
+ }
}