Fix imperial cylinder sizes in equipment tab

Thiago Macieira thiago at macieira.org
Fri Jan 3 04:33:43 UTC 2014


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);

-- 
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/67e9d3d3/attachment.sig>


More information about the subsurface mailing list