mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
cleanup: constify TankItem::setData()
The TankItem only displays the data. Pass pointers as const. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
84f48b7290
commit
98594c18d1
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -14,7 +14,7 @@ class TankItem : public QGraphicsRectItem
|
|||
{
|
||||
public:
|
||||
explicit TankItem(const DiveCartesianAxis &axis);
|
||||
void setData(struct plot_info *plotInfo, struct dive *d);
|
||||
void setData(const struct plot_info *plotInfo, const struct dive *d);
|
||||
|
||||
private:
|
||||
void createBar(int startTime, int stopTime, struct gasmix gas);
|
||||
|
|
Loading…
Add table
Reference in a new issue