diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-01-11 18:54:48 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-20 10:01:50 -0800 |
commit | 98594c18d11e619de05fc05cbd7ca006a01d184f (patch) | |
tree | 85d255b4650c7c0ab77f502ff356f28ce4c2df85 /profile-widget/tankitem.cpp | |
parent | 84f48b729085e1dd4356b4300c9498361fbe81d1 (diff) | |
download | subsurface-98594c18d11e619de05fc05cbd7ca006a01d184f.tar.gz |
cleanup: constify TankItem::setData()
The TankItem only displays the data. Pass pointers as const.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/tankitem.cpp')
-rw-r--r-- | profile-widget/tankitem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp index 48d755dcf..75c3c35ba 100644 --- a/profile-widget/tankitem.cpp +++ b/profile-widget/tankitem.cpp @@ -61,7 +61,7 @@ void TankItem::createBar(int startTime, int stopTime, struct gasmix gas) label->setZValue(101); } -void TankItem::setData(struct plot_info *plotInfo, struct dive *d) +void TankItem::setData(const struct plot_info *plotInfo, const struct dive *d) { if (!d) return; @@ -73,7 +73,7 @@ void TankItem::setData(struct plot_info *plotInfo, struct dive *d) } // Find correct end of the dive plot for correct end of the tankbar. - struct plot_data *last_entry = &plotInfo->entry[plotInfo->nr - 1]; + const struct plot_data *last_entry = &plotInfo->entry[plotInfo->nr - 1]; plotEndTime = last_entry->sec; // We don't have enougth data to calculate things, quit. @@ -90,7 +90,7 @@ void TankItem::setData(struct plot_info *plotInfo, struct dive *d) // get the information directly from the displayed dive // (get_dive_dc() always returns a valid dive computer) - struct divecomputer *dc = get_dive_dc(d, dc_number); + const struct divecomputer *dc = get_dive_dc_const(d, dc_number); // start with the first gasmix and at the start of the dive int cyl = explicit_first_cylinder(d, dc); |