cleanup: remove unused variable

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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-09-03 13:54:52 +02:00 committed by Dirk Hohndel
parent 4a7ee872f3
commit 0d92ef2835

View file

@ -35,13 +35,11 @@ static void exportHTMLsettings(const QString &filename, struct htmlExportSetting
} else if (prefs.unit_system == IMPERIAL) { } else if (prefs.unit_system == IMPERIAL) {
out << "\"unit_system\":\"Imperial\""; out << "\"unit_system\":\"Imperial\"";
} else { } else {
QVariant v; QString length = prefs.units.length == units::METERS ? "METER" : "FEET";
QString length, pressure, volume, temperature, weight; QString pressure = prefs.units.pressure == units::BAR ? "BAR" : "PSI";
length = prefs.units.length == units::METERS ? "METER" : "FEET"; QString volume = prefs.units.volume == units::LITER ? "LITER" : "CUFT";
pressure = prefs.units.pressure == units::BAR ? "BAR" : "PSI"; QString temperature = prefs.units.temperature == units::CELSIUS ? "CELSIUS" : "FAHRENHEIT";
volume = prefs.units.volume == units::LITER ? "LITER" : "CUFT"; QString weight = prefs.units.weight == units::KG ? "KG" : "LBS";
temperature = prefs.units.temperature == units::CELSIUS ? "CELSIUS" : "FAHRENHEIT";
weight = prefs.units.weight == units::KG ? "KG" : "LBS";
out << "\"unit_system\":\"Personalize\","; out << "\"unit_system\":\"Personalize\",";
out << "\"units\":{\"depth\":\"" << length << "\",\"pressure\":\"" << pressure << "\",\"volume\":\"" << volume << "\",\"temperature\":\"" << temperature << "\",\"weight\":\"" << weight << "\"}"; out << "\"units\":{\"depth\":\"" << length << "\",\"pressure\":\"" << pressure << "\",\"volume\":\"" << volume << "\",\"temperature\":\"" << temperature << "\",\"weight\":\"" << weight << "\"}";
} }