Commit be0c7005 authored by Gus Grubba's avatar Gus Grubba

Fix unit translators

It was broken when temperature translation was added in babbfbd1
The system wasn't quite setup to handle anything other than speed and distance. Changed so any arbitrary unit type can be converted to another.
parent e945aa15
This diff is collapsed.
......@@ -203,14 +203,20 @@ private:
static QVariant _celsiusToFarenheit(const QVariant& celsius);
static QVariant _farenheitToCelsius(const QVariant& farenheit);
struct AppSettingsTranslation_s {
const char* rawUnits;
const char* cookedUnits;
bool speed;
uint32_t speedOrDistanceUnits;
Translator rawTranslator;
Translator cookedTranslator;
enum UnitTypes {
UnitDistance = 0,
UnitArea,
UnitSpeed,
UnitTemperature
};
struct AppSettingsTranslation_s {
const char* rawUnits;
const char* cookedUnits;
UnitTypes unitType;
uint32_t unitOption;
Translator rawTranslator;
Translator cookedTranslator;
};
static const AppSettingsTranslation_s* _findAppSettingsDistanceUnitsTranslation(const QString& rawUnits);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment