diff options
author | Patrick Valsecchi <patrick@thus.ch> | 2013-10-08 10:32:08 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-10-08 06:23:49 -0700 |
commit | d0e9d1f383c64b83b9124f96d1ad67e994efe8f9 (patch) | |
tree | 7a76f80031aa4a1f5e67630677b4decb98b92ebc /qt-gui.cpp | |
parent | a13992a44b6b4e6d36623e1e7d0cd0b94d284d34 (diff) | |
download | subsurface-d0e9d1f383c64b83b9124f96d1ad67e994efe8f9.tar.gz |
Fix edit + cancel = absolute zero
If a temperature in Kelvin is 0, I think we can safely assume it is
not set.
Fixes #207.
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-gui.cpp')
-rw-r--r-- | qt-gui.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp index 178ed52af..08eb9d538 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -269,7 +269,9 @@ QString get_cylinder_used_gas_string(cylinder_t *cyl, bool showunit) QString get_temperature_string(temperature_t temp, bool showunit) { - if (prefs.units.temperature == units::CELSIUS) { + if (temp.mkelvin == 0) { + return ""; //temperature not defined + } else if (prefs.units.temperature == units::CELSIUS) { double celsius = mkelvin_to_C(temp.mkelvin); return QString("%1%2%3").arg(celsius, 0, 'f', 1).arg(showunit ? (UTF8_DEGREE): "") .arg(showunit ? tr("C") : ""); |