fix percentage concatenation on profile names
This commit is contained in:
parent
549b72b032
commit
398e950f8e
2 changed files with 6 additions and 2 deletions
|
@ -726,7 +726,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
|
||||||
profileSwitch = new ProfileSwitch();
|
profileSwitch = new ProfileSwitch();
|
||||||
profileSwitch.date = System.currentTimeMillis();
|
profileSwitch.date = System.currentTimeMillis();
|
||||||
profileSwitch.source = Source.USER;
|
profileSwitch.source = Source.USER;
|
||||||
profileSwitch.profileName = MainApp.getConfigBuilder().getProfileName();
|
profileSwitch.profileName = MainApp.getConfigBuilder().getProfileName(System.currentTimeMillis(), false);
|
||||||
profileSwitch.profileJson = MainApp.getConfigBuilder().getProfile().getData().toString();
|
profileSwitch.profileJson = MainApp.getConfigBuilder().getProfile().getData().toString();
|
||||||
profileSwitch.profilePlugin = ConfigBuilderPlugin.getActiveProfileInterface().getClass().getName();
|
profileSwitch.profilePlugin = ConfigBuilderPlugin.getActiveProfileInterface().getClass().getName();
|
||||||
profileSwitch.durationInMinutes = duration;
|
profileSwitch.durationInMinutes = duration;
|
||||||
|
|
|
@ -934,10 +934,14 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getProfileName(long time) {
|
public String getProfileName(long time) {
|
||||||
|
return getProfileName(time, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProfileName(long time, boolean customized) {
|
||||||
ProfileSwitch profileSwitch = getProfileSwitchFromHistory(time);
|
ProfileSwitch profileSwitch = getProfileSwitchFromHistory(time);
|
||||||
if (profileSwitch != null) {
|
if (profileSwitch != null) {
|
||||||
if (profileSwitch.profileJson != null) {
|
if (profileSwitch.profileJson != null) {
|
||||||
return profileSwitch.getCustomizedName();
|
return customized?profileSwitch.getCustomizedName():profileSwitch.profileName;
|
||||||
} else {
|
} else {
|
||||||
Profile profile = activeProfile.getProfile().getSpecificProfile(profileSwitch.profileName);
|
Profile profile = activeProfile.getProfile().getSpecificProfile(profileSwitch.profileName);
|
||||||
if (profile != null)
|
if (profile != null)
|
||||||
|
|
Loading…
Reference in a new issue