From 98594c18d11e619de05fc05cbd7ca006a01d184f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 11 Jan 2021 18:54:48 +0100 Subject: cleanup: constify TankItem::setData() The TankItem only displays the data. Pass pointers as const. Signed-off-by: Berthold Stoeger --- profile-widget/tankitem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'profile-widget/tankitem.cpp') 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); -- cgit v1.2.3-70-g09d2