Fix imperial cylinder sizes in equipment tab

Thiago Macieira thiago at macieira.org
Fri Jan 3 11:45:19 UTC 2014


On sexta-feira, 3 de janeiro de 2014 10:33:43, Thiago Macieira wrote:
> On sexta-feira, 3 de janeiro de 2014 10:31:40, Thiago Macieira wrote:
> > On quinta-feira, 2 de janeiro de 2014 21:36:01, Linus Torvalds wrote:
> > > This seems to fix it from quick testing. I'd love to make the "mbar"
> > > be a proper "pressure_t" rather than an unsigned int, but setting
> > > default values for arguments with complex types is a fairly recent
> > > thing, so compilers don't support it or require magic compile-time
> > > flags to enable it or at least not complain about it.
> > 
> > Indeed. For
> 
> [snip]
> 
> > QString get_volume_string(volume_t volume, bool showunit = false,
> > pressure_t mbar = {});
> 
> Of course, there's a much easier solution: overloads.
> 
> Instead of:
> -QString get_volume_string(volume_t volume, bool showunit = false);
> +QString get_volume_string(volume_t volume, bool showunit = false, unsigned
> int mbar = 0);
> 
> We can do:
>  QString get_volume_string(volume_t volume, bool showunit = false);
> +QString get_volume_string(volume_t volume, pressure_t mbar, bool showunit =
> false);

Here's another solution:

+static const pressure_t zero_pressure = {};
-QString get_volume_string(volume_t volume, bool showunit = false);
+-QString get_volume_string(volume_t volume, bool showunit = false, pressure_t 
mbar = zero_pressure);

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140103/f8e32dbc/attachment.sig>


More information about the subsurface mailing list