Skip to content

Commit

Permalink
cleanup: remove unused variable
Browse files Browse the repository at this point in the history
A QVariant was initialized but never used.

While doing so, remove construct/assign pairs of a number of
QStrings. Directly construct the QStrings with the desired
values.

Signed-off-by: Berthold Stoeger <[email protected]>
  • Loading branch information
bstoeger authored and dirkhh committed Sep 3, 2022
1 parent 4a7ee87 commit 0d92ef2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions core/divelogexportlogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ static void exportHTMLsettings(const QString &filename, struct htmlExportSetting
} else if (prefs.unit_system == IMPERIAL) {
out << "\"unit_system\":\"Imperial\"";
} else {
QVariant v;
QString length, pressure, volume, temperature, weight;
length = prefs.units.length == units::METERS ? "METER" : "FEET";
pressure = prefs.units.pressure == units::BAR ? "BAR" : "PSI";
volume = prefs.units.volume == units::LITER ? "LITER" : "CUFT";
temperature = prefs.units.temperature == units::CELSIUS ? "CELSIUS" : "FAHRENHEIT";
weight = prefs.units.weight == units::KG ? "KG" : "LBS";
QString length = prefs.units.length == units::METERS ? "METER" : "FEET";
QString pressure = prefs.units.pressure == units::BAR ? "BAR" : "PSI";
QString volume = prefs.units.volume == units::LITER ? "LITER" : "CUFT";
QString temperature = prefs.units.temperature == units::CELSIUS ? "CELSIUS" : "FAHRENHEIT";
QString weight = prefs.units.weight == units::KG ? "KG" : "LBS";
out << "\"unit_system\":\"Personalize\",";
out << "\"units\":{\"depth\":\"" << length << "\",\"pressure\":\"" << pressure << "\",\"volume\":\"" << volume << "\",\"temperature\":\"" << temperature << "\",\"weight\":\"" << weight << "\"}";
}
Expand Down

0 comments on commit 0d92ef2

Please sign in to comment.