mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: pass const-reference to RulerItem2::setPlotInfo()
Instead of passing a pointer, pass a cons reference. This is more idiomatic and consistent with RulerNodeItem2::setPlotInfo(). Also make the reference passed to RulerNodeItem2::setPlotInfo() const, to make clear that the argument is copied. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
dc254716cf
commit
e19b71709d
3 changed files with 8 additions and 8 deletions
|
@ -718,7 +718,7 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
|
||||||
cylinderPressureAxis->setMinimum(plotInfo.minpressure);
|
cylinderPressureAxis->setMinimum(plotInfo.minpressure);
|
||||||
cylinderPressureAxis->setMaximum(plotInfo.maxpressure);
|
cylinderPressureAxis->setMaximum(plotInfo.maxpressure);
|
||||||
#ifndef SUBSURFACE_MOBILE
|
#ifndef SUBSURFACE_MOBILE
|
||||||
rulerItem->setPlotInfo(&plotInfo);
|
rulerItem->setPlotInfo(plotInfo);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SUBSURFACE_MOBILE
|
#ifdef SUBSURFACE_MOBILE
|
||||||
|
|
|
@ -26,7 +26,7 @@ RulerNodeItem2::RulerNodeItem2() :
|
||||||
setFlag(ItemIgnoresTransformations);
|
setFlag(ItemIgnoresTransformations);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RulerNodeItem2::setPlotInfo(plot_info &info)
|
void RulerNodeItem2::setPlotInfo(const plot_info &info)
|
||||||
{
|
{
|
||||||
pInfo = info;
|
pInfo = info;
|
||||||
entry = pInfo.entry;
|
entry = pInfo.entry;
|
||||||
|
@ -152,11 +152,11 @@ RulerNodeItem2 *RulerItem2::destNode() const
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RulerItem2::setPlotInfo(plot_info *info)
|
void RulerItem2::setPlotInfo(const plot_info &info)
|
||||||
{
|
{
|
||||||
pInfo = *info;
|
pInfo = info;
|
||||||
dest->setPlotInfo(*info);
|
dest->setPlotInfo(info);
|
||||||
source->setPlotInfo(*info);
|
source->setPlotInfo(info);
|
||||||
dest->recalculate();
|
dest->recalculate();
|
||||||
source->recalculate();
|
source->recalculate();
|
||||||
recalculate();
|
recalculate();
|
||||||
|
|
|
@ -18,7 +18,7 @@ class RulerNodeItem2 : public QObject, public QGraphicsEllipseItem {
|
||||||
public:
|
public:
|
||||||
explicit RulerNodeItem2();
|
explicit RulerNodeItem2();
|
||||||
void setRuler(RulerItem2 *r);
|
void setRuler(RulerItem2 *r);
|
||||||
void setPlotInfo(struct plot_info &info);
|
void setPlotInfo(const struct plot_info &info);
|
||||||
void recalculate();
|
void recalculate();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -37,7 +37,7 @@ public:
|
||||||
explicit RulerItem2();
|
explicit RulerItem2();
|
||||||
void recalculate();
|
void recalculate();
|
||||||
|
|
||||||
void setPlotInfo(struct plot_info *pInfo);
|
void setPlotInfo(const struct plot_info &pInfo);
|
||||||
RulerNodeItem2 *sourceNode() const;
|
RulerNodeItem2 *sourceNode() const;
|
||||||
RulerNodeItem2 *destNode() const;
|
RulerNodeItem2 *destNode() const;
|
||||||
void setAxis(DiveCartesianAxis *time, DiveCartesianAxis *depth);
|
void setAxis(DiveCartesianAxis *time, DiveCartesianAxis *depth);
|
||||||
|
|
Loading…
Add table
Reference in a new issue