mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
Fix Weight stored in KGs
Recent commit 8eee2ddb got some of the logic
the wrong way round for converting weight to KGs
before saving (and when switching between metric
and imperial units).
We always store weight in KGs.
This commit is contained in:
@@ -831,12 +831,12 @@ RiderPage::unitChanged(int currentIndex)
|
||||
if (currentIndex == 0) {
|
||||
QString weighttext = QString(tr("Weight (%1)")).arg(tr("kg"));
|
||||
weightlabel->setText(weighttext);
|
||||
weight->setValue(weight->value() * LB_PER_KG);
|
||||
weight->setValue(weight->value() / LB_PER_KG);
|
||||
}
|
||||
else {
|
||||
QString weighttext = QString(tr("Weight (%1)")).arg(tr("lb"));
|
||||
weightlabel->setText(weighttext);
|
||||
weight->setValue(weight->value() / LB_PER_KG);
|
||||
weight->setValue(weight->value() * LB_PER_KG);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -845,7 +845,7 @@ RiderPage::saveClicked()
|
||||
{
|
||||
appsettings->setCValue(mainWindow->cyclist, GC_NICKNAME, nickname->text());
|
||||
appsettings->setCValue(mainWindow->cyclist, GC_DOB, dob->date());
|
||||
appsettings->setCValue(mainWindow->cyclist, GC_WEIGHT, weight->value() * (unitCombo->currentIndex() ? 1.0 : KG_PER_LB));
|
||||
appsettings->setCValue(mainWindow->cyclist, GC_WEIGHT, weight->value() * (unitCombo->currentIndex() ? KG_PER_LB : 1.0));
|
||||
|
||||
if (unitCombo->currentIndex()==0)
|
||||
appsettings->setCValue(mainWindow->cyclist, GC_UNIT, GC_UNIT_METRIC);
|
||||
|
||||
Reference in New Issue
Block a user