diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2018-02-27 07:06:39 +0100 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2018-03-05 16:28:18 +0100 |
commit | 93ddcce6fad7912af579acb6a0697d3574dd35b3 (patch) | |
tree | 96a25462a00a1b171a5e41ec4ed5586eb3c0b645 /qt-models | |
parent | aacc6886705e720809d253d22e0f6f49444993e0 (diff) | |
download | subsurface-93ddcce6fad7912af579acb6a0697d3574dd35b3.tar.gz |
Cleanup: Remove superfluous QString constructions in divetripmodel.cpp
Remove superfluous QString constructions in a couple of simple functions
in divetripmodel.cpp
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/divetripmodel.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index 2e9058d6e..5addeeb08 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -369,19 +369,17 @@ QString DiveItem::displayDuration() const QString DiveItem::displayTemperature() const { - QString str; struct dive *dive = get_dive_by_uniq_id(diveId); if (!dive->watertemp.mkelvin) - return str; + return QString(); return get_temperature_string(dive->watertemp, false); } QString DiveItem::displayTemperatureWithUnit() const { - QString str; struct dive *dive = get_dive_by_uniq_id(diveId); if (!dive->watertemp.mkelvin) - return str; + return QString(); return get_temperature_string(dive->watertemp, true); } @@ -403,14 +401,12 @@ QString DiveItem::displaySacWithUnit() const QString DiveItem::displayWeight() const { - QString str = weight_string(weight()); - return str; + return weight_string(weight()); } QString DiveItem::displayWeightWithUnit() const { - QString str = weight_string(weight()) + ((get_units()->weight == units::KG) ? tr("kg") : tr("lbs")); - return str; + return weight_string(weight()) + ((get_units()->weight == units::KG) ? tr("kg") : tr("lbs")); } int DiveItem::weight() const |