fix tests
This commit is contained in:
parent
3c025e97a8
commit
bf6449f201
|
@ -75,9 +75,9 @@ public class ProfileStore {
|
||||||
if (store.has(profileName)) {
|
if (store.has(profileName)) {
|
||||||
profile = cachedObjects.get(profileName);
|
profile = cachedObjects.get(profileName);
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
if (store.has("units")) {
|
JSONObject profileObject = store.getJSONObject(profileName);
|
||||||
String units = store.getString("units");
|
if (profileObject!= null && profileObject.has("units")) {
|
||||||
profile = new Profile(store.getJSONObject(profileName), units);
|
profile = new Profile(profileObject, profileObject.getString("units"));
|
||||||
cachedObjects.put(profileName, profile);
|
cachedObjects.put(profileName, profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,11 @@ object LocalProfilePlugin : PluginBase(PluginDescription()
|
||||||
.shortName(R.string.localprofile_shortname)
|
.shortName(R.string.localprofile_shortname)
|
||||||
.description(R.string.description_profile_local)), ProfileInterface {
|
.description(R.string.description_profile_local)), ProfileInterface {
|
||||||
|
|
||||||
|
override fun onStart() {
|
||||||
|
super.onStart()
|
||||||
|
loadSettings()
|
||||||
|
}
|
||||||
|
|
||||||
private val log = LoggerFactory.getLogger(L.PROFILE)
|
private val log = LoggerFactory.getLogger(L.PROFILE)
|
||||||
|
|
||||||
private var rawProfile: ProfileStore? = null
|
private var rawProfile: ProfileStore? = null
|
||||||
|
@ -54,10 +59,6 @@ object LocalProfilePlugin : PluginBase(PluginDescription()
|
||||||
internal var numOfProfiles = 0
|
internal var numOfProfiles = 0
|
||||||
internal var currentProfileIndex = 0
|
internal var currentProfileIndex = 0
|
||||||
|
|
||||||
init {
|
|
||||||
loadSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun currentProfile() = profiles[currentProfileIndex]
|
fun currentProfile() = profiles[currentProfileIndex]
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
|
|
Loading…
Reference in a new issue