mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-03 15:43:09 +00:00
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>
This commit is contained in:
parent
aacc688670
commit
93ddcce6fa
1 changed files with 4 additions and 8 deletions
|
@ -369,19 +369,17 @@ QString DiveItem::displayDuration() const
|
||||||
|
|
||||||
QString DiveItem::displayTemperature() const
|
QString DiveItem::displayTemperature() const
|
||||||
{
|
{
|
||||||
QString str;
|
|
||||||
struct dive *dive = get_dive_by_uniq_id(diveId);
|
struct dive *dive = get_dive_by_uniq_id(diveId);
|
||||||
if (!dive->watertemp.mkelvin)
|
if (!dive->watertemp.mkelvin)
|
||||||
return str;
|
return QString();
|
||||||
return get_temperature_string(dive->watertemp, false);
|
return get_temperature_string(dive->watertemp, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DiveItem::displayTemperatureWithUnit() const
|
QString DiveItem::displayTemperatureWithUnit() const
|
||||||
{
|
{
|
||||||
QString str;
|
|
||||||
struct dive *dive = get_dive_by_uniq_id(diveId);
|
struct dive *dive = get_dive_by_uniq_id(diveId);
|
||||||
if (!dive->watertemp.mkelvin)
|
if (!dive->watertemp.mkelvin)
|
||||||
return str;
|
return QString();
|
||||||
return get_temperature_string(dive->watertemp, true);
|
return get_temperature_string(dive->watertemp, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,14 +401,12 @@ QString DiveItem::displaySacWithUnit() const
|
||||||
|
|
||||||
QString DiveItem::displayWeight() const
|
QString DiveItem::displayWeight() const
|
||||||
{
|
{
|
||||||
QString str = weight_string(weight());
|
return weight_string(weight());
|
||||||
return str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DiveItem::displayWeightWithUnit() const
|
QString DiveItem::displayWeightWithUnit() const
|
||||||
{
|
{
|
||||||
QString str = weight_string(weight()) + ((get_units()->weight == units::KG) ? tr("kg") : tr("lbs"));
|
return weight_string(weight()) + ((get_units()->weight == units::KG) ? tr("kg") : tr("lbs"));
|
||||||
return str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DiveItem::weight() const
|
int DiveItem::weight() const
|
||||||
|
|
Loading…
Reference in a new issue