From ea55ba06e1e0927ce035eb7e0f133f6fa1541950 Mon Sep 17 00:00:00 2001 From: Joern Date: Mon, 20 Jul 2015 14:40:52 +0200 Subject: [PATCH] LTM Translation Preparation ... fill "units" field with original "units" from Metrics if new Chart is created ... store original "unit" into LTMSettings for later reference in automatic translation ... use a new version of LTMSettings to be compatible with any written version --- src/LTMSettings.cpp | 6 +++++- src/LTMTool.cpp | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/LTMSettings.cpp b/src/LTMSettings.cpp index 98a971821..360411372 100644 --- a/src/LTMSettings.cpp +++ b/src/LTMSettings.cpp @@ -171,7 +171,7 @@ QDataStream &operator<<(QDataStream &out, const LTMSettings &settings) out<= 12) { in >> m.stressType; } + if (version >= 13) { + in >> m.units; + } bool keep=true; // check for deprecated things and set keep=false if diff --git a/src/LTMTool.cpp b/src/LTMTool.cpp index 8d959e830..72356a07a 100644 --- a/src/LTMTool.cpp +++ b/src/LTMTool.cpp @@ -210,8 +210,8 @@ LTMTool::LTMTool(Context *context, LTMSettings *settings) : QWidget(context->mai // set default for the user overiddable fields adds.uname = adds.name; - adds.units = ""; - adds.uunits = adds.metric->units(context->athlete->useMetricUnits); + adds.units = adds.metric->units(context->athlete->useMetricUnits); + adds.uunits = adds.units; // default units to metric name if it is blank if (adds.uunits == "") adds.uunits = adds.name;