+ add further log messages at startup for better troubleshooting, fix possible crash, fix typos
This commit is contained in:
@@ -80,16 +80,19 @@ UnitsApi::~UnitsApi()
|
||||
|
||||
void UnitsApi::setSchema(UnitSystem s)
|
||||
{
|
||||
if(UserPrefSystem){
|
||||
if (UserPrefSystem) {
|
||||
UserPrefSystem->resetSchemaUnits(); // for schemas changed the Quantity constants
|
||||
delete UserPrefSystem;
|
||||
UserPrefSystem = 0;
|
||||
}
|
||||
switch (s) {
|
||||
case SI1 : UserPrefSystem = new UnitsSchemaInternal(); break;
|
||||
case SI2 : UserPrefSystem = new UnitsSchemaMKS(); break;
|
||||
case Imperial1: UserPrefSystem = new UnitsSchemaImperial1(); break;
|
||||
case ImperialDecimal: UserPrefSystem = new UnitsSchemaImperialDecimal(); break;
|
||||
default : UserPrefSystem = new UnitsSchemaInternal(); s = SI1; break;
|
||||
}
|
||||
|
||||
actSystem = s;
|
||||
UserPrefSystem->setSchemaUnits(); // if necesarry a unit schema can change the constants in Quantity (e.g. mi=1.8km rather then 1.6km).
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user