Return DEFAULT_CONFIG_NAME if default name cannot be found in prefs
This commit is contained in:
parent
c598004ba0
commit
f4e9d0db45
@ -107,7 +107,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
this.fcid = _fcid;
|
this.fcid = _fcid;
|
||||||
}
|
}
|
||||||
this.rocket = rocket;
|
this.rocket = rocket;
|
||||||
this.configurationName = prefs.getDefaultFlightConfigName();
|
this.configurationName = getDefaultName();
|
||||||
this.configurationInstanceId = configurationInstanceCount++;
|
this.configurationInstanceId = configurationInstanceCount++;
|
||||||
|
|
||||||
updateStages();
|
updateStages();
|
||||||
@ -580,7 +580,15 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNameOverridden() {
|
public boolean isNameOverridden() {
|
||||||
return (!prefs.getDefaultFlightConfigName().equals(this.configurationName));
|
return (!getDefaultName().equals(this.configurationName));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getDefaultName() {
|
||||||
|
String name = prefs.getDefaultFlightConfigName();
|
||||||
|
if (name == null) {
|
||||||
|
name = DEFAULT_CONFIG_NAME;
|
||||||
|
}
|
||||||
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -592,7 +600,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
*/
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
if (configurationName == null) {
|
if (configurationName == null) {
|
||||||
configurationName = prefs.getDefaultFlightConfigName();
|
configurationName = getDefaultName();
|
||||||
}
|
}
|
||||||
return descriptor.format(configurationName, rocket, fcid);
|
return descriptor.format(configurationName, rocket, fcid);
|
||||||
}
|
}
|
||||||
@ -605,7 +613,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
*/
|
*/
|
||||||
public String getNameRaw() {
|
public String getNameRaw() {
|
||||||
if (configurationName == null) {
|
if (configurationName == null) {
|
||||||
return prefs.getDefaultFlightConfigName();
|
return getDefaultName();
|
||||||
}
|
}
|
||||||
return configurationName;
|
return configurationName;
|
||||||
}
|
}
|
||||||
@ -922,7 +930,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
|
|
||||||
public void setName(final String newName) {
|
public void setName(final String newName) {
|
||||||
if ((newName == null) || (newName.isEmpty())) {
|
if ((newName == null) || (newName.isEmpty())) {
|
||||||
this.configurationName = prefs.getDefaultFlightConfigName();
|
this.configurationName = getDefaultName();
|
||||||
return;
|
return;
|
||||||
} else if (!this.getId().isValid()) {
|
} else if (!this.getId().isValid()) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user