> On 09 Feb 2016, at 19:24, Dirk Hohndel <[email protected]> wrote: > > On Tue, Feb 09, 2016 at 06:03:24PM +0100, Joakim Bygdell wrote: >> Since we only show the first cylinder we can also only edit the first >> cylinder. >> >> Signed-off-by: Joakim Bygdell <[email protected]> >> --- >> subsurface-core/subsurface-qt/DiveObjectHelper.cpp | 23 >> ++++++++++++++++++++++ >> subsurface-core/subsurface-qt/DiveObjectHelper.h | 4 ++++ >> 2 files changed, 27 insertions(+) >> >> diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp >> b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp >> index 2f058f4..b7542f8 100644 >> --- a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp >> +++ b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp >> @@ -33,6 +33,17 @@ static QString getFormattedCylinder(struct dive *dive, >> unsigned int idx) >> return fmt; >> } >> >> +static QString getPressures(struct dive *dive, unsigned int idx) >> +{ >> + cylinder_t *cyl = &dive->cylinder[0]; >> + QString fmt; >> + if (idx == 0) >> + fmt = get_pressure_string(cyl->start, true); >> + if (idx == 1) >> + fmt = get_pressure_string(cyl->end, true); >> + return fmt; > > I find that API a bit strange - idx sounds like it would be the cylinder > number. Instead you switch between start and end. How about a bool > parameter "returnEndPressure”? Jepp, it occurs to me while eating dinner that this could have been implemented a bit nicer but I had already sent in the patched by then.
/Jocke
_______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
