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) {
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 << "\"}";
}