Commit 5d3b2f5b authored by Lucas Beeler's avatar Lucas Beeler

Changes the semantics of "unsetting" a configuration key in the GSettings...

Changes the semantics of "unsetting" a configuration key in the GSettings configuration engine to mean "reset the GSettings key to its default value." In the past, unsetting was a no-op. Closes #6578.
parent 251316cf
...@@ -239,6 +239,14 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object { ...@@ -239,6 +239,14 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object {
schema_object.set_string(key, value); schema_object.set_string(key, value);
} }
private void reset_gs_to_default(string schema, string key) throws ConfigurationError {
check_key_valid(schema, key);
Settings schema_object = new Settings(schema);
schema_object.reset(key);
}
private static string? clean_plugin_id(string id) { private static string? clean_plugin_id(string id) {
string cleaned = id.replace("/", "-"); string cleaned = id.replace("/", "-");
...@@ -411,7 +419,13 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object { ...@@ -411,7 +419,13 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object {
} }
public void unset_plugin_key(string domain, string id, string key) { public void unset_plugin_key(string domain, string id, string key) {
; // "unsetting" has no meaning in the world of GSettings string schema_name = make_plugin_schema_name(domain, id);
try {
reset_gs_to_default(schema_name, make_gsettings_key(key));
} catch (ConfigurationError err) {
critical("GSettingsConfigurationEngine: error: %s", err.message);
}
} }
public FuzzyPropertyState is_plugin_enabled(string id) { public FuzzyPropertyState is_plugin_enabled(string id) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment