diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-07-25 21:23:19 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-01 07:48:43 -0700 |
commit | 89e0c3f46498ba3e0844514b6709a07c200a68df (patch) | |
tree | 8609c84130cb04180d9db4bb43f2dfc11cf563c3 /qt-models/yearlystatisticsmodel.cpp | |
parent | 236f0512bec2946b35052abf637c7c8df97f34bf (diff) | |
download | subsurface-89e0c3f46498ba3e0844514b6709a07c200a68df.tar.gz |
Cleanup: make DiveTripModel a global object
DiveTripModel (the model describing the dive-list) was destroyed
and recreated on every reset of the list. This seems excessive.
Instead - in analogy to most other models - make it a single
global object.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/yearlystatisticsmodel.cpp')
-rw-r--r-- | qt-models/yearlystatisticsmodel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qt-models/yearlystatisticsmodel.cpp b/qt-models/yearlystatisticsmodel.cpp index 9cbb19a1d..c83a803c2 100644 --- a/qt-models/yearlystatisticsmodel.cpp +++ b/qt-models/yearlystatisticsmodel.cpp @@ -187,7 +187,7 @@ void YearlyStatisticsModel::update_yearly_stats() month++; } rootItem->children.append(item); - item->parent = rootItem; + item->parent = rootItem.get(); } @@ -199,7 +199,7 @@ void YearlyStatisticsModel::update_yearly_stats() iChild->parent = item; } rootItem->children.append(item); - item->parent = rootItem; + item->parent = rootItem.get(); } /* Show the statistic sorted by dive type */ @@ -213,6 +213,6 @@ void YearlyStatisticsModel::update_yearly_stats() iChild->parent = item; } rootItem->children.append(item); - item->parent = rootItem; + item->parent = rootItem.get(); } } |