use of net.runelite.api.events.ConfigChanged in project runelite by runelite.
the class ConfigManager method unsetConfiguration.
public void unsetConfiguration(String groupName, String key) {
log.debug("Unsetting configuration value for {}.{}", groupName, key);
String oldValue = (String) properties.remove(groupName + "." + key);
if (client != null) {
final Runnable task = () -> {
try {
client.unset(groupName + "." + key);
} catch (IOException ex) {
log.warn("unable to set configuration item", ex);
}
};
executor.execute(task);
}
Runnable task = () -> {
try {
saveToFile();
} catch (IOException ex) {
log.warn("unable to save configuration file", ex);
}
};
executor.execute(task);
ConfigChanged configChanged = new ConfigChanged();
configChanged.setGroup(groupName);
configChanged.setKey(key);
configChanged.setOldValue(oldValue);
eventBus.post(configChanged);
}
Aggregations