forked from I2P_Developers/i2p.i2p
* Router: When removing a config setting, remove from context also
This commit is contained in:
@@ -345,6 +345,8 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
*/
|
*/
|
||||||
public void removeConfigSetting(String name) {
|
public void removeConfigSetting(String name) {
|
||||||
_config.remove(name);
|
_config.remove(name);
|
||||||
|
// remove the backing default also
|
||||||
|
_context.removeProperty(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1279,7 +1281,7 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
if (value != null)
|
if (value != null)
|
||||||
_config.put(name, value);
|
_config.put(name, value);
|
||||||
else
|
else
|
||||||
_config.remove(name);
|
removeConfigSetting(name);
|
||||||
return saveConfig();
|
return saveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1298,7 +1300,7 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
_config.putAll(toAdd);
|
_config.putAll(toAdd);
|
||||||
if (toRemove != null) {
|
if (toRemove != null) {
|
||||||
for (String s : toRemove) {
|
for (String s : toRemove) {
|
||||||
_config.remove(s);
|
removeConfigSetting(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return saveConfig();
|
return saveConfig();
|
||||||
|
@@ -113,12 +113,26 @@ public class RouterContext extends I2PAppContext {
|
|||||||
/**
|
/**
|
||||||
* Modify the configuration attributes of this context, changing
|
* Modify the configuration attributes of this context, changing
|
||||||
* one of the properties provided during the context construction.
|
* one of the properties provided during the context construction.
|
||||||
|
*
|
||||||
* @param propName The name of the property.
|
* @param propName The name of the property.
|
||||||
* @param value The new value for the property.
|
* @param value The new value for the property.
|
||||||
|
* @since 0.8.4
|
||||||
|
* @deprecated Use Router.saveConfig()
|
||||||
*/
|
*/
|
||||||
public void setProperty(String propName, String value) {
|
public void setProperty(String propName, String value) {
|
||||||
_overrideProps.setProperty(propName, value);
|
_overrideProps.setProperty(propName, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a property provided during the context construction.
|
||||||
|
* Only for use by the router. Others use Router.saveConfig()
|
||||||
|
*
|
||||||
|
* @param propName The name of the property.
|
||||||
|
* @since 0.9
|
||||||
|
*/
|
||||||
|
void removeProperty(String propName) {
|
||||||
|
_overrideProps.remove(propName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addPropertyCallback(I2PPropertyCallback callback) {
|
public void addPropertyCallback(I2PPropertyCallback callback) {
|
||||||
|
Reference in New Issue
Block a user