Base: refactor unit formatting defaults
Defaults for both precision (number of digits after decimal point) and denominator (number of fractions) are defined on various places making difficult to find which default is used for various tasks. Store these values at one central place: UnitsApi. Unless overriden by user, default values are defined by unitSchemasDataPack.
This commit is contained in:
@@ -200,7 +200,7 @@ void DlgSettingsGeneral::saveUnitSystemSettings()
|
||||
hGrpu->SetInt("FracInch", FracInch);
|
||||
|
||||
// Set the actual format value
|
||||
QuantityFormat::setDefaultDenominator(FracInch);
|
||||
UnitsApi::setDenominator(FracInch);
|
||||
|
||||
// Set and save the Unit System
|
||||
if (ui->checkBox_projectUnitSystemIgnore->isChecked()) {
|
||||
@@ -272,7 +272,7 @@ void DlgSettingsGeneral::loadSettings()
|
||||
ui->checkBox_projectUnitSystemIgnore->setChecked(hGrpu->GetBool("IgnoreProjectSchema", false));
|
||||
|
||||
// Get the current user setting for the minimum fractional inch
|
||||
FracInch = hGrpu->GetInt("FracInch", QuantityFormat::getDefaultDenominator());
|
||||
FracInch = hGrpu->GetInt("FracInch", UnitsApi::getDenominator());
|
||||
|
||||
// Convert fractional inch to the corresponding combobox index using this
|
||||
// handy little equation.
|
||||
|
||||
Reference in New Issue
Block a user